Hi everyone,
i want to create a frequency that starts from 100hz and ends at 5hz when i press a pushbutton.the duration between start and end is 30 sec.i am using pic16f84a and want to use timer0 for this purpose.i am using ccs compiler version 4.020
i have no idea about using timers and interrupts.
can anyone give me a proper guidence from where i start.
have anyone any example.
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
Posted: Wed Sep 26, 2007 5:17 pm
A lot of example code come with CCS compiler. The files are installed into C:\Program Files\PICC\Examples directory. The descriptions of the examples are here – http://www.ccsinfo.com/devices.php?page=exlist
To start using timer, you should, probably look at the EX_STWT.C example. _________________ Read the label, before opening a can of worms.
hayee
Joined: 05 Sep 2007 Posts: 252
Posted: Wed Sep 26, 2007 10:40 pm
Thanks kender.
i have already saw the examples but i am still confused
how to use timer and interupts.can anyone have easy way/method from which i can understand.
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
Posted: Thu Sep 27, 2007 7:48 am
I would create a "numerically controlled oscillator" for this. Since you just want a square wave output you don't need any waveform lookup table. You just need to add another register for the delta frequency per computation cycle.
A few years ago I wrote one for a 16C58 running at 20MHz that synthesized a sonar burst between 24kHz and 32kHz, so working below 100Hz should be easy. _________________ The search for better is endless. Instead simply find very good and get the job done.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum