打印

GIE·t0ie都打开了 为什么PC不进04h?请教好心人

[复制链接]
3733|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
57tm|  楼主 | 2008-5-12 09:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
刚开始用PIC 手头的片子是16c73 自己写的练习小程序 可是到这中断怎么也进不去 t0if溢出的时候 要不跑飞 要不直接跳过去 找了一小天了,水平太菜 还望DX指教程序如下:
仿真器用的是wave6000 有人说他的定时器不好用 有人用过吗 ?
include "test.inc"
org     00h
bcf     intcon,gie
btfsc   intcon,gie
goto    $-2
goto    main

org     04h
;======================================================
;                 中断服务程序
;======================================================
interrupt:
movwf   temp_w

swapf   status,w
movwf   temp_status

movf    fsr,w
movwf   temp_fsr

movf    pclath,w
movwf   temp_pclath
;-------------------------------------------------------------------
;中断查询
btfsc   intcon,t0if
goto    t0int
;bcf     intcon,t0if
btfsc   pir1,tmr1if
goto    t1int
;bcf     PIR1,TMR1IF
t0int:
call    display
bcf     intcon,t0if
goto    recover
t1int:
call    led_g
bcf     intcon,tmr1if
goto    recover



;--------------------------------------------------------------------
recover:
movf    temp_pclath,w
movwf   pclath

movf    temp_fsr,w
movwf   fsr

swapf   temp_status,w
movwf   status

movf    temp_w,w

retfie
;========================================================
;                   中断查询执行
;
;
;========================================================

main:

;timer1int:
;clrf    t1con
;clrf    tmr1h
;clrf    tmr1l

;clrf    intcon

;bsf     status,rp0
;clrf    pie1
;bcf     status,rp0
;clrf    pir1
;movlw   00110000h
;movwf   t1con
;bsf     t1con,tmr1on





timer0int:
clrf    tmr0
clrf    intcon
bsf     status,rp0
movlw   01001011b
movwf   OPTION_REG
bcf     status,rp0

bsf     intcon,t0ie

bsf     intcon,peie
bsf     intcon,gie




protaint:
bsf     status,rp0
movlw   07h           ;配置 adcon1
movwf   adcon1
bcf     status,rp0

bsf     status,rp0
movlw   0f8h           ;配置porta 012-o 345-i
movwf   trisa
bcf     status,rp0

other_int:
clrf    led_flag


main_pro:



nop
nop
nop
nop
nop





goto    main_pro



沙发
zhusonglinw| | 2008-5-12 18:06 | 只看该作者

wqve软件仿真进不了中断的

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

30

主题

79

帖子

2

粉丝