??? 12/23/04 10:36 Read: times |
#83691 - here is code prahlad and andy Responding to: ???'s previous message |
hi
here is simple code for 89c51rd2bn mcu from philips,timer0 not interrupting timer1,although timer0 has higher priority where is mistake org 0000h sjmp program_start org 000bh sjmp timer0 org 001bh sjmp timer1 program_start: mov ie,#10001010b ; enable timer interrupts mov tmod,#11h ;16 bit mode of timer1 & timer0 mov th0,#0ffh mov tl0,#9ch mov th1,#0ffh mov tl1,#9ch mov iph,#00000011 ;interrupt priority level mov ip,#00001001 ; timer0 leve2,timer1 level1 setb tcon.6 ; start timer1 there: sjmp there timer0: cpl port3.1 mov th0,#0ffh mov tl0,#9ch reti timer1: setb tcon.4 ; in timer1 start timer0 infinte_loop: cpl port3.0 nop nop nop nop nop nop nop ;infinte loop timer0 should nop ;interrupt timer1,beacuse of nop ;high proirity to generate nop ;square pulse at port3.1 nop ; but there is no pule at port3.1 nop ; pulse is there at port3.0 nop nop nop nop sjmp infinte_loop reti |