Jump to content

Recommended Posts

Hi

 

Recently I am playing around this compiler on 16LF1936 chip. Everything looks fine but one problem I found that is:

 

I wrote the following code:

 

#pragma DATA _CONFIG1, _FCMEN_OFF & _IESO_OFF & _CLKOUTEN_OFF & _BOREN_NSLEEP & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_OFF & _WDTE_OFF & _FOSC_INTOSC

#pragma DATA _CONFIG2, _LVP_OFF & _BORV_19 & _STVREN_ON & _PLLEN_OFF & _WRT_OFF

 

and it generate the following config figures:

 

	ORG 0x00008007
8007  CDE4	  DW 0xCDE4
8008  DEFF	  DW 0xDEFF

 

but when I use CCS's programmer via ccsloader I have a problem in verifying the code from the chip. The reason is the CONFIG read from the chip is not match with the CONFIG in the .hex file.

 

The read value are:

8007 = 0x0DE4

8008 = 0x1EFF

 

So how can I make the compiler not to put '1' at the most significant bit?

 

Can anyone tell me how to do that if there is anyway I can do it!

 

Thank you in advance

Link to post
Share on other sites
You can simply add a 0x7fff to the config string like this;

 

#pragma DATA _CONFIG2, _LVP_OFF & _BORV_19 & _STVREN_ON & _PLLEN_OFF & _WRT_OFF & 0x7fff

 

Cheers

 

Reynard

 

It is the right method, but I do not agree with the specified constant - instructions and configuration is 14 bits wide, and it should give a 0x3FFF mask.

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...