各位大哥,帮忙看下中断时间设置的对不对,我采用6MHZ的频率,整体程序是1S数字加一,可实际仿真时,却是13S左右加一,真奇怪;麻烦各位大哥帮忙看看,程序哪出了问题,为什么会是过13S加一呢?而不是过1S加一呢? ajmp main org 0bh acall zd back: reti main:mov dptr,#tab mov r6,#10 mov 30h,#0 mov 31h,#0 mov 32h,#0 mov tmod,#1 mov th0,#3ch mov tl0,#0b0h setb ea setb et0 setb tr0 loopo:mov r1,#30h mov r7,#0f7h loopi:mov p2,#0ffh mov a,@r1 movc a,@a+dptr mov p0,a mov p2,r7 inc r1 mov a,r7 rr a mov r7,a cjne r7,#7fh,loopi sjmp loopo zd: mov th0,#3ch mov tl0,#0b0h djnz r6,back mov r0,#30h inc @r0 cjne @r0,#10,back mov 30h,#0 inc r0 inc @r0 cjne @r0,#10,back mov 31h,#0 inc r0 inc @r0 cjne @r0,#10,back mov 32h,#0 reti tab:db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,80h,90h,88h end |