Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC timer0 / timer1 for SONAR application

Status
Not open for further replies.

zenoneder

New Member
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top