CFGS: Flash Program/Data EEPROM or Configuration Select bit
1 = Access Configuration registers
0 = Access Flash program or data EEPROM memory
Once I saw that, I knew it could be done, it was just a matter of figuring out how. The datasheet was really vague, and it simply said that it was similar to writing to Flash Memory. After a little trial and error, I found that it really is just that easy. So maybe, you want to add a routine to verify that the chip has been programmed with the proper config settings for the program. Or maybe you need to change the settings according to the users input from a menu. Now you can.
This option is available on every 18F that I've looked at so far, so that means it's been around for years. And, no, it's not available on any 16F's that I've seen.<HR>
This program presents the following macros:
<b><pre>@ ReadConfig?CB _CONFIG3H, tempbyte</pre></b>
Obviously there are some issues to think about before using these macro's. Such as, an oscillator must be running to be able to execute code. So trying to set the oscillator config at run-time will only work if you start off with a configuration that allows a system clock. Other changes in mid stream might put the CCP output on a pin that has a low impeadance signal on the input, causing damage. It's up to you to make sure these things don't happen. Which I guess is no different than if you're using ICSP.
<br>
http://www.darreltaylor.com/RTconfig/RTconfig.inc.txt
http://www.darreltaylor.com/RTconfig/TestConfig.pbp.txt
Re: Connecting 24vdc power supply to 110vac
I agree with Henrik. It will be dangerous to sell devices that depend on the connection of the plug since in Europe there is no way to know where is Live and where is Neutral.
Ioannis Yesterday, 15:02So, regarding the...