Hi to all of you... I am using a ATmega128 at 16Mhz. And I want to measure the time duration of each logiclevel (1 and 0). At speeds of max 2500Hz. To keep my problem simple for you, I want to make a pulse on evvery edge of the input signal, so my input is on "IC1, portD,4 of the mega128". I want to use input capture because I need to measure the time as aqurate as possible. (Not using INt0 and INT1 !!). After each capture I want to change the edge detection, some fist time rising, then falling, then rising again etc.. But the problem is that this changing of edge is not working. please take a look at my test programm, and try to find why it's not working. thanks for taking you time to read me... qyuip
C: TCCR1B=TCCR1B^0b01000000; toggle edge select listing from Compiler: in r30, 0x2e ldi r26, low(64) eor r30, r26 out 0x2e, r30 Basic ?
thanks Crazy horse, using the "simulate" part of my bascom I found out that cbi and sbi for the TCCR1B register is NOT working. NOT WORKING: ( but why not ??) cbi TCCR1B,ICES1 sbi TCCR1B,ICES1 therefore I found also a other way of doing the job. (in attach) I will also try your sollution ! Thanks dear horse :-)
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.