Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 19th May 2004, 03:12 AM   (permalink)
Default Setting OSC bits in 16F628

Hi,

I am trying to set the osc bits in 16f628

I want to run 32k ext osc, but change in the program to intrc then back to 32k ext osc.

Any suggestions welcome.

Peter
PeterK is offline  
Old 19th May 2004, 09:19 AM   (permalink)
Default Re: Setting OSC bits in 16F628

Quote:
Originally Posted by PeterK
Hi,

I am trying to set the osc bits in 16f628

I want to run 32k ext osc, but change in the program to intrc then back to 32k ext osc.

Any suggestions welcome.

Peter
Just to make sure what you are wanting to do?, you want the PIC to run off it's internal 4MHz oscillator, but be able to switch to using an external 32KHz oscillator from within the program?.

You can't switch configuration fuse settings from within a program, only from a programmer.

Why do you want to do this?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 19th May 2004, 09:49 AM   (permalink)
Default

:wink:

Quote:
Why do you want to do this?.
Errrrm Nigel, someone once told me that the point of 32khz was all about saving power :wink: :wink: :roll: :lol:


Peter, take a look at the Datasheet, it tells you how to do what you want......

"14.3 Special Feature: Dual Speed
Oscillator Modes
A software programmable dual speed oscillator mode
is provided when the PIC16F62X is configured in either
ER or INTRC oscillator modes. This feature allows
users to dynamically toggle the oscillator speed
between 4MHz and 37kHz. In ER mode, the 4MHz setting
will vary depending on the size of the external
resistor. Also in ER mode, the 37kHz operation is fixed
and does not vary with resistor size. Applications that
require low current power savings, but cannot tolerate
putting the part into sleep, may use this mode."


Be aware though that the 32khz internal osc may not be as accurate as the external crystal you originally wanted to use, check the specs in the datasheet....

Hope this helps!
__________________
Regards


MATT!
Matt(Pic progger) is offline  
Old 19th May 2004, 09:54 AM   (permalink)
Default

Quote:
Originally Posted by Matt(Pic progger)
:wink:

Quote:
Why do you want to do this?.
Errrrm Nigel, someone once told me that the point of 32khz was all about saving power :wink: :wink: :roll: :lol:
That's why I asked :lol:

If it was about saving power, I was going to mention the internal oscillators low speed mode - but I wasn't bothering typing it all if it wasn't relevant 8)
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 19th May 2004, 10:06 AM   (permalink)
Default

:wink:

OK, i belive you Nigel..... honset, I do, I do!!!! :lol:

Anyway that aside, I love the 628, it's got some fantastic features...... Although, I have started using the 818 now as my "dogsbody" chip, it's nice to have the ADC's back :wink:
__________________
Regards


MATT!
Matt(Pic progger) is offline  
Old 21st May 2004, 03:54 AM   (permalink)
Default OSC Settings in 16f628

Thanks for all of the responses.

I was trying to save power by running @ 32 k, but I also wanted accuracy, hence not using the 37k.

I needed to output sounds, which will only work at 4 mhz correctly.

I did look at the specs further and found they are program only bits.

Howver i've resolved the problem by using another pic(12f series) to run at 32k getting my accuracy and using this to trigger the 16f628 out of sleep.

Therefore I get accuracy and low power consuptions (< 30ua) and 5 ma when it wakes up momentarily.

Thanks for all your inputs and this may help others.

Peter
PeterK is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:49 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker