Input capture changing...

Gast #72239
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
Angehängte Dateien:
Gast #72241
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  :-)
Angehängte Dateien:

Antwort schreiben

Eine eigene Frage? Dieser Thread ist über 22 Jahre alt. Stell sie in einem eigenen Thread – dort lesen mehr Leute mit, und sie wird öfter und schneller beantwortet.

Neuen Thread starten

Eine Lösung, Ergänzung oder Rückmeldung zu diesem Thread? Dann antworte hier.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.