![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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 | |
| |
| | (permalink) | |
| Quote:
You can't switch configuration fuse settings from within a program, only from a programmer. Why do you want to do this?. | ||
| |
| | (permalink) | |
| :wink: Quote:
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! | ||
| |
| | (permalink) | ||
| Quote:
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) | |||
| |
| | (permalink) |
| :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! | |
| |
| | (permalink) |
| 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 | |
| |