??? 07/23/08 10:32 Read: times |
#156973 - wrong window comparator Responding to: ???'s previous message |
Hi Milan, Didnt You change + and - inputs of U2 comparators? About software: 1) - disable INT0 and TIMER0 irq EX0=0 ;ET0=0 ; - clear variable MYTIMER0_HIGHEST - clear flag myReady0 - turn on discharge transistor Q10 - wait P3.2 goes low. - prepare TIMER0 to count when P3.2/INT0 is high clear TH0 TL0 and TF0 - prepare IT0=1 ==INTERRUPT 0 to be edge active , clear interrupt flag IE0 enable EX0 ;interrupt 0 - enable ET0 ;timer 0 irq 2) turn off Q10 3) turn on charging transistor - for example Q5 4)wait flag myReady0 - if timer0 interrupts : increment variable MYTIMER0_HIGHEST - if interrupt0 occurs : disable INT0 and TIMER0 irq, set myReady0 flag 5 ) - disable Q5 MYTIMER0_HIGHEST * 65536 + TH0TL0 gives You charging time betveen 1/3VCC and 2/3VCC. regards |
Topic | Author | Date |
Measure time of signal! | 01/01/70 00:00 | |
Starting | 01/01/70 00:00 | |
To Steve | 01/01/70 00:00 | |
wrong window comparator | 01/01/70 00:00 | |
Again question! | 01/01/70 00:00 | |
re:again question | 01/01/70 00:00 | |
Why not test middle range first? | 01/01/70 00:00 | |
You are right.![]() | 01/01/70 00:00 | |
Wrong window comparator | 01/01/70 00:00 | |
in every mode interrupt is on transition to 0x000 | 01/01/70 00:00 |