|
|
View previous topic :: View next topic |
Author |
Message |
russk2txb
Joined: 30 Mar 2008 Posts: 109 Location: New Jersey
|
PIC18F14K50 fuses and reset issues |
Posted: Sat Mar 31, 2012 1:55 pm |
|
|
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
|
|
|
russk2txb
Joined: 30 Mar 2008 Posts: 109 Location: New Jersey
|
|
Posted: Sat Apr 07, 2012 9:52 am |
|
|
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
|
|
Posted: Sat Apr 07, 2012 12:11 pm |
|
|
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. |
|
|
|
|
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
|