View previous topic :: View next topic |
Author |
Message |
smee
Joined: 16 Jan 2014 Posts: 24
|
pic24fj256gb210 and programming prob - Solved |
Posted: Thu Jan 16, 2014 9:54 am |
|
|
Hi, i am using the 24fj256gb210 processor which i have been using on the explorer16 board. My hardware has since turned up and i am now running the icd2 with the board. I find that the icd2 fails with verification problems. I am assuming it's down to fuses as my board has no clock and i was hoping to use the internal rc oscillator. But like i said i can't program the device.
Is there a comprehensive list of fuses definitions as i can't get to the bottom of this ?
This is the beginning of my program:
Code: |
#include <24fj256gb210.h> // define the processor to use
#include <pins.h> // define the i/o map
#device icd=2
//-----------------------------------------------------------------------
// set fuses for the hardware
//#fuses PR_PLL,PLL2
#fuses frc_pll //internal fast rc osc with pll
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOJTAG //JTAG disabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES DEBUG // Debug mode for ICD
#FUSES ICSP2 //ICD uses PGC2/PGD2 pins
#FUSES WINDIS //Watch Dog Timer in non-Window mode
#FUSES WPOSTS16 //Watch Dog Timer PostScalar 1:32768
#FUSES NOIESO //Internal External Switch Over mode disabled
//#FUSES PR //Primary Oscillator
//#FUSES NOCKSFSM //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES NOOSCIO //OSC2 is clock output
//#FUSES HS //External clock with CLKOUT
#FUSES IOL1WAY //Allows only one reconfiguration of peripheral pins
#FUSES NOWPCFG
#FUSES NOWPDIS
#FUSES WPFP
//-------------------------------------------------------------------------
// specify the clock speed for the processor
#use delay(clock=32Mhz,xtal=8Mhz)
|
This is the error i am getting all the time from icd2:
MPLAB ICD 2 ready for next operation
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x87F)
Verifying...
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0x40690, Val Read = 0x0)
ICD0275: Programming failed.
MPLAB ICD 2 ready for next operation
Has anyone got any ideas as i am at my wits end.
Thank you.
Last edited by smee on Sat Jan 18, 2014 9:12 am; edited 1 time in total |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
Re: pic24fj256gb210 and programming prob |
Posted: Thu Jan 16, 2014 11:14 am |
|
|
Check your ICD2 cable length. The ICD2 originally shipped with a programming cable about 200mm long. This cable was too long for PIC24 series processors leading to programming and verification failures. (Actually the issue was true for any newer generation PICs). Later shipments of the ICD2 and other Microchip ICSPs shipped with 100mm cables which solved the problem. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
smee
Joined: 16 Jan 2014 Posts: 24
|
|
Posted: Sat Jan 18, 2014 9:10 am |
|
|
thanks for that, i remade my icd2 to target lead ( 50mm ) and hey presto all worked fine. |
|
|
|