Timer

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Re: Timer

Postby Brian Griffin » Thu Nov 03, 2011 12:24 pm

Or, from the respective microcontroller datasheet, there must be at least one Timer module which runs off at the 32.768kHz crystal (watch crystal), and make it a one-second timebase.

Then every Timer interrupt from the crystal, you add one to the counter.

So, every one hour is 3600 seconds, and only have to use one "unsigned int" for that. (unsigned int = 0-65535)

The watch crystal, you gonna get it from Cytron, or take it out from an old, broken clock. :)
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Previous

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 6 guests