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

PIC18F14K50 fuses and reset issues

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



Joined: 30 Mar 2008
Posts: 109
Location: New Jersey

View user's profile Send private message

PIC18F14K50 fuses and reset issues
PostPosted: Sat Mar 31, 2012 1:55 pm     Reply with quote

Ok, I finally got to the point where I can program the PIC and get the program to run, but there are still a lot of issues. First, I guess, the crystal oscillates but when I try to run the oscillator and debug test in the CCS Load diagnostics it fails, saying there must be some problem with oscillator fuses. I tried a lot of different settings but what works best still causes the test to fail. Here is what I have for fuses and clock setting:
Code:
 
#fuses NOIESO, NOFCMEN, PCLKEN, NOPUT, NOBROWNOUT, NOWDT, MCLR, NOHFOFST, LVP, NOXINST
   
  // configure 12MHz clock for USB operation and 48Mhz CPU operation
  #fuses HS
  #fuses PLLEN   //enable pll, we can now use CPUDIVx fuses
  #fuses CPUDIV1 //CPU clock set to 48MHz
  #fuses USBDIV2 //when using low speed USB, need to divide 12MHz by
     2.  this fuse has no effect when using full speed.

  #use delay(clock=48M)

The crystal is 12M.

I am unable to turn off LVP. If I use NOLVP then I get errors for registers 2 and 4. The reg 2 error is complaining that the expected value is 1A09 but actual is 1A29. So bit 5 is being set but according to the device editor bit 5 is unused. The reg 4 error says expected 0089, actual 008D. The extra bit is to turn off LVP but it won't accept that.

Also the actual fuse value in the hex file for reg 2 IS 1A09 as expected. But the actual fuse value in hex file for reg4 is 8000 which does not at all agree with my set fuses. Confusing!

Finally reset by grounding MCLR is strange. At first it did not work at all but then I used the MCLR fuse and now it stops the program but the program will not restart after reset. Also clicking the 'Run Target Program' button in CCS Load will not start the program. However rebooting by power cycling will cause the program to run ok.

Ok, I know this is a lot but I think that these errors are all related so I hope one of you more experienced guys has some ideas or suggestions.

Using compiler 4.131 and ICD-U64 firmware 2.93 and CCS Load v 4.037.

Thanks, Russ
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 31, 2012 3:13 pm     Reply with quote

You seem to want to start a new thread every day on this. Basically, you
have the same old CCSLoad/ICD problem with "verification errors".
CCSLoad and CCS ICD are notorious for these problems, it seems.

The only time I have seen this type of problem when I'm using MPLAB and
Microchip ICD2, is when the PIC selected in the Configure/ Select Device
of MPLAB doesn't match the PIC in the #include statement of my CCS
program that I'm compiling.

Here is just a sample of the threads on Verification Errors with
CCSLoad and ICD-Uxx.
http://www.ccsinfo.com/forum/viewtopic.php?t=46659
http://www.ccsinfo.com/forum/viewtopic.php?t=47790
http://www.ccsinfo.com/forum/viewtopic.php?t=43959
http://www.ccsinfo.com/forum/viewtopic.php?t=43437
http://www.ccsinfo.com/forum/viewtopic.php?t=40951
See if one of these will suggest an answer for you, and if not,
get a backup programmer from Microchip !
russk2txb



Joined: 30 Mar 2008
Posts: 109
Location: New Jersey

View user's profile Send private message

PostPosted: Sat Apr 07, 2012 9:52 am     Reply with quote

HI PCM Programmer. Well FYI, it turns out that using CCS tools works just fine. The problem was mine and a discussion with a CCS engineer revealed the problem. I was using external power supply to supply the demo board, and had neglected to remove the jumper that put 5 volts on VUSB on the PIC. Once that was corrected, everything started working ok.

I can now program the PIC with the ICD-U64 and CCSLoad program, and the program loads and runs correctly. I really do not think you need to be advising people to use the Microchip PICKIT (unless you have Microchip stock).

Now I have some other issues not related to programming or debugging and I will start a separate thread so that the title of the thread is meaningful to my situation.

Regards. Russ
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 07, 2012 12:11 pm     Reply with quote

I'm advising PicKit 3 because it's one of the cheapest ways to get an
alternate programmer. At the company I work for, we have Pickit 2,
ICD2 (several), ICD3, and PicStart-Plus. If one of those breaks,
we have an alternate one to use, and we're not shut down. That was
my point. Don't ever let one non-working gadget stop your
development process.
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