Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
If you work with a crystal multiple of 2 ( i.e. 32,768 KHz used at RTC ), yes you can obtain the exact value generating some interruption.
However, due that frequency is very slow to most applications, the best choice could be using this at external oscilator generating interrupt on pin.
Knowing your uC freq. you could loop doing nothing as many times as needed. here is asm code generator for this.
Or if you're using C there's probably some delay function provided with your compiler.
Hi-tech has __delay_ms and __delay_us for example.
Just remarking that if absolute precision be required ( i.e, to avoid cummulative error ) you also could use a crystal of 3,27680MHz - not so usual like the other used at RTC. If this oscilator inputs at a 16-Bits timer, can generate precise interruption of 10ms ( 100Hz ).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.