CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Config Register settings

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kev
Guest







Config Register settings
PostPosted: Fri Jan 17, 2003 6:00 am     Reply with quote

Hi All,

I am using a 18F452 on a current project using PCH ver. 3.136. My question is this, is it possible to directly access the config registers? The FUSE values given in the compiler do not appear to cover all combinations regarding code protection.
Thanks for any help.

Regards, Kev
___________________________
This message was ported from CCS's old forum
Original Post ID: 10749
Woody
Guest







Re: Config Register settings
PostPosted: Fri Jan 17, 2003 8:16 am     Reply with quote

The configuration area 0x300000 - 0x3FFFFF an be accessed using table reads and writes (See data sheet - Special Features of th CPU).

The following code snippet would write CONFIG5L onwards.

Hope this helps.


void configuration (void)
{
#pragma ASM
MOVLW 0x08 // Set TBLPTR to 0x300008
MOVWF 0xFF6
MOVLW 0x00
MOVWF 0xFF7
MOVLW 0x30
MOVWF 0xFF8
MOVLW 0x0F // Value to write
TBLWT*+ // Write value
// MOVLW 0x06 // Value for 0x300009
// TBLWT*+ // write value etc...
#pragma ENDASM
}
___________________________
This message was ported from CCS's old forum
Original Post ID: 10751
R.J.Hamlett
Guest







Re: Config Register settings
PostPosted: Fri Jan 17, 2003 8:39 am     Reply with quote

:=Hi All,
:=
:=I am using a 18F452 on a current project using PCH ver. 3.136. My question is this, is it possible to directly access the config registers? The FUSE values given in the compiler do not appear to cover all combinations regarding code protection.
:=Thanks for any help.
:=
:=Regards, Kev
Worth realising, that the abilities of the FUSE statement are configurable from the device editor. At the top right of the screen for this, you get the fuse 'words', the mask they generate, and the register number to be used. You can add your own definitions here, or edit the supplied ones. :-)

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 10752
kev
Guest







Re: Config Register settings
PostPosted: Fri Jan 17, 2003 10:01 am     Reply with quote

Thanks.

Regards, Kev


:=:=Hi All,
:=:=
:=:=I am using a 18F452 on a current project using PCH ver. 3.136. My question is this, is it possible to directly access the config registers? The FUSE values given in the compiler do not appear to cover all combinations regarding code protection.
:=:=Thanks for any help.
:=:=
:=:=Regards, Kev
:=Worth realising, that the abilities of the FUSE statement are configurable from the device editor. At the top right of the screen for this, you get the fuse 'words', the mask they generate, and the register number to be used. You can add your own definitions here, or edit the supplied ones. :-)
:=
:=Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 10757
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group