| ??? 11/12/03 06:47 Read: times |
#58363 - AC linearization -Cant compare TH0 & TL0 |
Hi all,
I have build a look up table to linearize the AC curver for a light dimmer, and I need to compare this 16-bit value with the timer 0 value, when I compare just the high byte the dimmer works, but when I try to simply read the look up for the low byte it get stuck. sorry,... bute here is the code: mov dptr, #0x1E00 ; High byte look up table mov a, LIGHTLVL ; light level from 0-255 mov dpl, a mov a, #0x00 movc a, @a+dptr clr c clr TR0 ; stop the timer subb a, TH0 ; test high byte inc dph ; 0x1F00 = low byte look up table mov a, #0x00 movc a, @a+dptr subb a, TL0 ; test low byte setb TR0 ; timer 0 on jnc DontGate ; Dont trigger light if TIMER 0 is ; less then the look up value Thanks already....., crying to sleep (3:47am), Gabriel |
| Topic | Author | Date |
| AC linearization -Cant compare TH0 & TL0 | 01/01/70 00:00 | |
| RE: AC linearization -Cant compare TH0 & TL0 | 01/01/70 00:00 | |
| RE: AC linearization -Cant compare TH0 & TL0 | 01/01/70 00:00 | |
| RE: AC linearization -Cant compare TH0 & | 01/01/70 00:00 | |
RE: AC linearization -Cant compare TH0 & | 01/01/70 00:00 | |
| RE: AC linearization -Cant compare TH0 & TL0 | 01/01/70 00:00 | |
| RE: AC linearization -Cant compare TH0 & TL0 | 01/01/70 00:00 |



