Hot!*HELP* 12F683 timer not working as expected

Page: < 123 Showing page 3 of 3
Author
1and0
Access is Denied
  • Total Posts : 8660
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: *HELP* 12F683 timer not working as expected 2018/12/10 03:35:17 (permalink)
+1 (1)
al_bin
Write why the alternative is worse, instead of excluding it

Where in this thread have I said about excluding it? I asked how OSCTUNE can be used to automatically set a desired frequency, given the datasheet stated only "maximum frequency" and "minimum frequency" for the extremes of the tuning range. And your reply in Post #28 quoted below is to "use Timer2"..?!?!
 
al_bin
1and0
I've always wonder how one uses the OSCTUNE to automatically adjust the high-frequency internal oscillator, which is already factory calibrated, to a desired frequency.?



Use TMR2 do it ? ;-)



 
But now I see that you want to alter the internal oscillator frequency to get 1ms from 256 timer counts, provided the tuning steps can provide that frequency.
#41
1and0
Access is Denied
  • Total Posts : 8660
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: *HELP* 12F683 timer not working as expected 2018/12/10 03:38:09 (permalink)
+2 (2)
nemo4all
qhb
Use Timer 2 and the PR2 register.
Set Prescaler to 1:16 and PR2=124 and it will roll over once per millisecond with an 8MHz clock.

Would you please show with an example how to do this please..

Take a look to the "Timer2 Module" chapter of your PIC datasheet. Set the Timer2 prescaler to 1:16 in the T2CON register and the period to 124 in the PR2 register.
 
#42
1and0
Access is Denied
  • Total Posts : 8660
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: *HELP* 12F683 timer not working as expected 2018/12/10 08:32:40 (permalink)
0
PStechPaul
The OSCTUNE register can adjust the frequency +/- 12% with a 5 bit register. Thus it can be adjusted within 1% (actually 12/16 or 0.75% per count).
 
http://ww1.microchip.com/...en/AppNotes/00244a.pdf


The OSCTUNE register in that App Note is a 6-bit register, while it is only 5 bits in OP's PIC device. So we don't really know if the tuning range is the same +/- 12%. ;)
 
#43
Page: < 123 Showing page 3 of 3
Jump to:
© 2019 APG vNext Commercial Version 4.5