??? 05/23/06 20:10 Read: times |
#116981 - CPT registers Responding to: ???'s previous message |
@kai
ok, i know now what you mean... thank you for the explanation. i thought of that following way to compute the values of the timer2. the point is that the captured values of the first interrupt don't get erased when the second interrupt happens. main: mov a,ctlalt <- ctlold into accu subb a,ctlneu <- ctlnew-ctlneu mov ergl,a <- write result into ergl (ergl data 33h) mov a,cthalt <- cthold into accu subb a,cthneu <- cthold-cthnew mov ergh,a <- write result into ergh 8003h (((ext.int.sfr))) <-adress of external interrupt sub routine mov cthalt,cthneu <- move cthnew in cthold mov ctlalt,ctlneu <- move ctlnew in ctlold mov cthneu,cth <- move cth in cthhnew mov ctlneu,ctl <- move ctl in ctlnew i am sitting since 5pm at this problem, i hope that way works??? i don't have my microcontroller to hand, because we are not allowed to take the KIT home. please tell me if that way of computing 2 successive square pulses could work? thank you all for your help, to be honest i was pessimistic as i started that project but now i understand how the timer 2 works, thank you |