Jump to content
ELFORUM - Forumul electronistilor

intrebare timer

Recommended Posts

Folosesc Timer-ul 1 ca sa numar timpul intre doua impulsuri ce vin pe un pin de la Portul B (RB5). Vreau ca timpul sa poata fi mai mare de 0,013.. secunde (folosesc un cuartz de 20MHz). Cum pot face asta? Mentionez ca lucrez cu intreruperea de pe portul B. Adica vine impulsul si se declanseaza numaratoarea.Multumesc

Link to post
Share on other sites

Pai poti face asa: activezi si intreruperea la Tmr1 si folosesti inca un counter software care este resetat cand resetezi timer-ul si care este incrementat de fiecare daca cand s produce depasirea la Tmr1. Counter-ul aditional poate fi pe 8, 16 ori cati biti tu ai nevoie, in functie de durata maxima care vrei sa o masori. Timpul total va fi (cand se produce intreruperea pe RB5):counter<<16+TMR1H:TMR1L[/code]

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines