http://www.picbasic.co.uk/forum/showthread.php?t=3251
Be sure to read the first eight post.
http://www.picbasic.co.uk/forum/showthread.php?t=3251
Be sure to read the first eight post.
Dave
Always wear safety glasses while programming.
OK. This looks good. Thanks.
I think the overkill blinking light is the right for me to use. I am unlear what to change to get timer 1 to fire off every 22ms.
I assume it starts with this seting
T1CON = $31 ; Prescaler = 8, TMR1ON
I have two different harware setups I am trying to put it in. Both use the PIC16F887, one with an external 20MHz Osc, the other with an internal 8MHz. It looks like a prescaler of 1:8 is the max, so I suspect I need to do a counter in the interupt routine that only fires my event every nth time to acheive the 22ms event? Is this a big burden or is there a simpler way? Can someone show me some examples of how to do the math to get the event to fire off properly with the two oscillator speeds?
Thanks,
Charlie
Charlie, play with the attached little tool to find out.Can someone show me some examples of how to do the math to get the event to fire off properly with the two oscillator speeds?
How to use it: click on the box enter the new value and press enter.
Cheers
Al.
Last edited by aratti; - 26th October 2010 at 09:54.
All progress began with an idea
Timer 1 is 16 bit.
At 8 Mhz with a prescale of 1 and a peload of 21537 will give 22.0 mSec
At 20 Mhz with a prescale of 2 and a peload of 10536 will give 22.0 mSec
http://www.picbasic.co.uk/forum/cont....-PICMultiCalc
http://www.picbasic.co.uk/forum/show...3259#post23259
Dave
Always wear safety glasses while programming.
I am not sure if I shoudl reply to this thread or the main interupt thread.
Anyways, I am getting errors when compiling. It looks like its all with the includes files.
I have attached a screenshot showing the errors and my code
Can anyone let me know what I am doing wrong?
Thanks,
Charlie
The answers are in the errors. They tell you what you need to do.
DT
...perhaps the errors mean something to those who know, but I am not smart enough to know (hence the reason I am for asking for help). A little more guidance would be appreciated. am I suposed to edit pbppic14.lib, if so how and where, its a huge file. Or am I suposed to change the includes file for the PIC16F887?
Thanks,
Charlie
Bookmarks