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 support@ccsinfo.com

config bits programming

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







config bits programming
PostPosted: Fri Oct 05, 2007 4:07 am     Reply with quote

Hiii Everybody

When programming with MPLAB v7.40, do I absolutely have to choose config tab from pull-down menu then adjust the configuration bits option ?

is it so? Even if I put all config options in #FUSE statements in the code. I am asking that especially for 18FxxJxx family devices.

in other words, if the settings in the code and MPLAB IDE config/configuration bits,
are different from each other, which one will be programmed into the chip.whenever I click on “program” tab.

I think , in 18FxxJxx family devices, config registers work a little different then that of the devices with no “J” letter in their names.

Any help will be appreciated

hundil
Ttelmah
Guest







PostPosted: Fri Oct 05, 2007 5:11 am     Reply with quote

When you compile the code, the entries from the fuses in the code, should appear as the current values in the pull down window in MPLAB. They _won't_, if you are using a pre V4 compiler. The fuse bits on the 'J' chips, are stored in RAM on the chip, not ROM. During boot, the chip itself, automatically copies the entries from the top few bytes of the program memory (normally 8 words), into the 'real' fuses. The values in the fuses window in MPLAB, reflect the values stored in the program memory at this point The new compilers, correctly store the fuse values required into the top of memory locations, but the older compilers, incorretctly tried to put then in the 'normal' locations for the other chips. On these, you can work with the chips, by manually setting the values in MPLAB, or adding a #ROM statement to the code, putting the required values into the program memory.

Best Wishes
laserted
Guest







Manually enter Config words via #ROM statement
PostPosted: Sat Nov 03, 2007 1:48 pm     Reply with quote

I'm still using CCS C 3.239, and probably falling victim the the same config words error (using 18F45J10 parts, my PicKit2 says that no config words are defined)...
So if for example, my config words were:
Word 1: 04A0 NODEBUG NOXINST STVREN NOWDT NOPROTECT
Word 2: 07C5 H4_SW WDT128 FCMEN IESO PRIMARY
Word 3: 03F8 CCP2C1

How would I craft the #Rom statement for a 45J10? I found no hint of the org location where the device reads these on bootup, just that it does.

Experimenting with the generic ROM statement doesn't work, as it's expecting decimal integers......

Thanks,

Ted
Guest








PostPosted: Wed Nov 21, 2007 6:34 pm     Reply with quote

I am running into a similar problem. I am using a V4 compiler and a PIC16F648A. I notice that the Configuration bits window updates every time I compile, but it does not update with correct values from code(when "Configuration bits set in code" is set). Also, when this checkbox is not checked I can manually change the bits to be programmed with pull down windows. The problem here is that each time I compile the default values come back and I can't seem to find a way to program the chip with PUT, MCLR, and BROWNOUT.
Any help would be greatly appreciated, Thanks
SET



Joined: 15 Nov 2005
Posts: 161
Location: Glasgow, UK

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Nov 23, 2007 9:18 am     Reply with quote

Here's how I do it for a 18F87J10:

Code:
#include <18F87J10.h>

// CCS Version 3 Issue - fuse data is put in wrong place in hex file (0x300000)
// Version 4 fixes this but is way too buggy at this time
// Use #rom directive to force correct values into hex file at 0x1FFF8h
#fuses NOWDT, EMCU16, H4_SW, BW8, EASHFT, NOXINST
// if you modify the above, you must change these values
// (look at the end of the list file)

#rom 0x1FFF8 = {0xF4A0,0xFFC5,0xF390}


Hope that helps
Ttelmah
Guest







PostPosted: Fri Nov 23, 2007 11:30 am     Reply with quote

The 'J' family, and the normal chips, are completely different.
This thread was about the 'J' chips, which on the V3 compilers, had a fault, that the configuration data was not written to the different locations, that these chips require (hence the #ROM fix).
The 16F648 chip, is a completely 'normal' chip, and the fuses should update directly from the compiled code, into MPLAB, without problems. Which 'V4 compiler'?. I have just tried three (4.051, 4.056, and 4.063), and all happily updated the fuses correctly into the MPLAB window. What version of MPLAB?. There have been some problems with some releases (I still use a slightly older version because of this), and it may be this, rather than CCS, that has the problem.

Best Wishes
Guest








PostPosted: Mon Nov 26, 2007 1:40 pm     Reply with quote

Thanks Ttelmah,
I am running CCS V4.038, and MPLAB 7.60. Should I upgrade these versions to solve the problem?
Chad
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