PDA

View Full Version : 8mhz internal osc and 455khz



Michael Wakileh
- 19th December 2007, 13:35
Hi there!

I am trying to create a quick and dirty HPWM SIGNAL AROUND 455khz
using nothing but the internal, factory calibrated, 8mhz oscillator of a pic16F690.
(I don't need high resolution duty cycle).

I believe this could either be done either by:

1) using prescaler 1:1, pr2 = 3
and tuning the pic down to around 7mhz using OSCTUNe register:
10000 = Minimum frequency (8mhz -12% = 7,04 ~ 7mhz)

2) using prescaler 1:1, pr2 = 4 and using OSCTUNE TO GET
UP TO AOUND 9 mhz

01111 = Maximum frequency (8mhz +12% = 8,96mhz ~ 9mhz)


For some reason I get the feeling I might be missing something though...
All comments appreciated...


greetz,
mike

Acetronics2
- 19th December 2007, 14:13
Hi, Michael

Steve's PWM calculator will confirm you an exact 455 Khz @ 50 % duty cycle with 7.28 Mhz clock ...

http://www.mister-e.org/pages/utilitiespag.html

Cheers !

Alain

Michael Wakileh
- 19th December 2007, 18:12
Thanks!

And here some help for others on how its solved:


Mister E's multi-calc outputs the following for the 8MHz oscillator when we want a 455khz pwm:

500,0 KHz prescaler1:1 PR2=3 6 Bit resolution

we want the pwm to be a bit slower so:

455/500= 0.91

0.91x8MHz = 7,28MHz