Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 17th February 2004, 09:10 PM   #1
Default PIC timer0 / timer1 for SONAR application

i just discovered this site and i'm wondering if anyone can help me with PIC timing. i'm using a PIC16F872 clocked at 20 MHz. ideally i'd like to use timer1 (16 bit) at a frequency of 625 kHz, so in CSS i iniated it with:

setup_timer_1(T1_DIV_BY_8);

i expected the following:
20 MHz freq of oscilation / 4 cycles per clock tick = 5 MHz internal clocking
5 MHz / 8 = 625 kHz timer1 frequency

when i read from the timer at an interval that should be within its range at this frequency, i am getting negative values. i need to measure intervals ranging from 100 uSec to 100 mSec. any help would be greatly appreciated.
zenoneder is offline  
Reply

Tags
application, pic, sonar, timer0, timer1

Thread Tools
Display Modes




All times are GMT. The time now is 02:54 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker