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 error on 24F16KA101

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



Joined: 29 Nov 2009
Posts: 25

View user's profile Send private message

Config error on 24F16KA101
PostPosted: Sun Nov 07, 2010 9:22 pm     Reply with quote

Hey,

Anyone got any ideas here as I'm lost.

I'm running 4.099 MPLAB 8.53 on windows 7.

code is...
Code:

#include <24F16KA101.h>

#fuses NOWRTB
#fuses NOBSS
#fuses NOPROTECT
#fuses NOWRT
#fuses FRC_PLL
#fuses NOIESO
#fuses NOPR
#fuses OSCIO
#Fuses POSCFREQ_H
#fuses SOSC_HIGH
#fuses NOCKSFSM
#Fuses NOWINDIS
#fuses NOWDT
#fuses BROWNOUT
#fuses BROWNOUT_NOSL
#fuses BROWNOUT_SW
#Fuses PUT
#fuses BORV_MID
#fuses NOMCLR
#fuses ICSP3
#fuses NODEBUG
#fuses DSBOR

#use delay (clock=32000000)

#use fast_io(a)
#use fast_io(b)

int16 firststage;

void main()
{
   SET_TRIS_A(0b0000000001000000);
   SET_TRIS_B(0b0100000000000000);
   
   output_b(0b0000000000010000);
}   

and MPLAB says...
Quote:

The configuration bits in the file are invalid and may cause problems if programmed.
Do you want to set them to their default values?
Please note that you may need to either rebuild the file or export memory again to correct the file.
Config Field : ICS

After this no matter what I do when programming it, an error comes up at 00F8000C that says expected value 3, received value 83.

Help
Crying or Very sad
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Nov 08, 2010 12:47 am     Reply with quote

You can generally trust MPLAB checking the fuse settings. CCS forgot to implement correct settings for a few fuses, in most cases, the suggested correction by MPLAB is appropriate. 4.099 is an old version, I think, the setting for 24F16KA101 have been corrected with newer PCD versions. But you're are basically able to change them yourself by editing the fuses section of the device database with the device editor tool.

To understand, why MPLAB is complaining about a particular fuse settings, you have to consult the chip datasheet and compare with the fuse coding found in the CCS *.lst file or read by MPLAB.
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Mon Nov 08, 2010 3:27 am     Reply with quote

The error, is 'note 2' on the FPOR register.

Best Wishes
Langton



Joined: 29 Nov 2009
Posts: 25

View user's profile Send private message

PostPosted: Mon Nov 08, 2010 8:41 pm     Reply with quote

Thanks for the reply guys. I just got PCWHD 4.114 today so I can edit the fuses and even zero'ing the MCLRE / NOMCLRE fuses I still continue to get the same error. I am attempting to flash it with a ICD-U64 and have also tried REAL ICE. I did see the 'note 2'...

2: The MCLRE fuse can only be changed when using the VPP-Based ICSP™ mode entry. This prevents a
user from accidentally locking out the device from the low-voltage test entry.


...but disregarded it as the U64 and ICE are both Vpp based right?
I think I must be going mad, surely the fault must be me right?
eoinoc



Joined: 30 Apr 2009
Posts: 16

View user's profile Send private message

PostPosted: Tue Nov 09, 2010 3:23 am     Reply with quote

I have used that exact chip a lot and never received any errors about Configuration bits and I use an older version of CCS.

Although I have noticed that the MCLR fuse doesn't get set correctly when you compile in CCS, so I end up having to put in the pullup. I compile CCS from within MPLAB and don't get the same error as you.

I never tried programming it with U-64. I only ever used PIC-KIT2.
Worked fine for me.
Code:

#include <24F16KA101.h>
//#device adc =8
#use fast_io(a)
#use fast_io(b)
#type unsigned
#fuses    NOPROTECT,NOWDT,icsp3,MCLR,NOBSS,DEBUG,put,nobrownout,nopr,nocksfsm,nodswdt,nodsbor
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Nov 09, 2010 3:47 am     Reply with quote

Obviously, you have to enable the option "Use high voltage on MCLR" in MPLAB programmer settings.
Langton



Joined: 29 Nov 2009
Posts: 25

View user's profile Send private message

PostPosted: Tue Nov 09, 2010 3:32 pm     Reply with quote

Thanks again for the replies. Unfortunately the 'Use high voltage on MCLR' was not so obvious to me as a) I'd never heard of it and b) I was attempting to use the CCS IDE which does not appear to have that function on the Real Ice or U64, it's a shame as this is the first time I've used the CCS IDE and I would like to see what it's like.

In any case, with MPLAB and Real Ice everything is working fine now, thanks heaps for your help guys, this will vastly improve my otherwise crap week Very Happy
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