PDA

View Full Version : How to read CONFIG1



dsicon
- 27th September 2014, 02:37
chip = PIC16F1933
if i put the register name
CONFIG1
in a statement PBP3 is not happy and will not compile

i am trying to debug something and i want to examine a few bits, just want to print a byte or word to my serial LCD to ponder what may be going on

is there a way to read CONFIG1 ? in PBP3

(in the MEL programmer software mePROG the config looks as expected)

will post more in another thread about the issue i am chasing

mackrackit
- 27th September 2014, 03:19
You either set the configs in the inc file or in your code. If you are relying on something else then you can have trouble.

pedja089
- 27th September 2014, 03:47
http://www.picbasic.co.uk/forum/showthread.php?t=4093

dsicon
- 27th September 2014, 04:12
yes i know, i just want to read CONFIG1, is that not possible ?

Demon
- 27th September 2014, 04:39
Maybe you should read that link again.

If that's not what you want, you'll have to give more details.

Robert

dsicon
- 27th September 2014, 19:56
Maybe you should read that link again.

If that's not what you want, you'll have to give more details.

Robert

Hi
i assume you mean the 4093 link above ? (the posts crossed at the same moment)
now i have read it, says it is only for 18F, i have 16F

what i was wanting was simply to inspect these 2 bits in CONFIG1 as i was having trouble with the mode functioning properly:
in CONFIG1 WDTE <4:3>
since one can access most any register in PBP by its name i was surprised that CONFIG1 was not available, perhaps there is some good reason

i imagine i could discover where it is in memory and looks that way (i assume it is a fixed location ?)

Demon
- 27th September 2014, 21:11
The CONFIGxx names are used within PBP and are listed in the include files.

The individual registers are used by Microchip and are described in the datasheet.

I suggest reading the register directly (check datasheet to see if readable). This will be much more efficient and easier to implement.

Robert

towlerg
- 1st October 2014, 06:41
Unless the PIC has CFGS you cannot read the fuses (otherwise known as config registers). This appears to be a PIC18 only thing. Unless you have a suspect PIC or programmer they are what you last wrote to them.

BTW always a good idea to check for an errata if your PIC wont do as it's told.

dsicon
- 1st October 2014, 19:05
Unless the PIC has CFGS you cannot read the fuses (otherwise known as config registers). This appears to be a PIC18 only thing. Unless you have a suspect PIC or programmer they are what you last wrote to them.

BTW always a good idea to check for an errata if your PIC wont do as it's told.

thanks for that confirmation about not being able to read those registers in a 16F, too bad about that

i did read the errata and did not spot a related issue, peda is helping me on another thread here that is related to what started this