View previous topic :: View next topic |
Author |
Message |
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
PIC24FJ256GAxxx in debug forces Analog inputs to Digital |
Posted: Thu Jul 14, 2011 2:21 pm |
|
|
Hello,
We are using a PIC24FJ256GA106 in our own hardware. Compiler version is 4.122. We are trying to debug the hardware with an ICD-U64 connected to the PGED2/C2 pair (RB6 & 7). When we load the program with the ICD enabled, it appears that the part is forcing RB0 and RB1 to Digital IO. We have single stepped through the code to the point where the Analog config register is set (set_ADC_ports()) and the code tries to load #FFC5 (sAN1|sAN3|sAN4|sAN5), but reading the register back the value is #FFC7. RB1 has been forced to a digital input. This has been duplicated on an Explorer 16 board with a PIC24FJ256GA110. The question is has anybody else encountered this and is there a work around. I have checked the latest errata and there doesn't appear to be anything associated with this type of problem. We can load the same code with debug off and no icd enabled and it works fine, we have analog inputs.
Code: |
.................... setup_adc_ports(sAN1|sAN3|sAN4|sAN5, VSS_VREF);
00A04: MOV #FFC5,W4
00A06: MOV W4,32C
00A08: MOV #2000,W4
00A0A: MOV W4,322
|
Code: |
#device ICD=2
// #device ICD=TRUE
#FUSES NOWDT // No Watch Dog Timer
#FUSES WDT32 //Watch Dog Timer PreScalar 1:32
#FUSES WPOSTS1 //Watch Dog Timer PostScalar 1:1
#FUSES XT //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD
// #FUSES PR_PLL //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD
// #FUSES OSCIO //OSC2 is general purpose output
#FUSES CKSFSM //Clock Switching is enabled, fail Safe clock monitor is enabled
#FUSES PR //Primary Oscillator
// #FUSES ICSP2 // ICD uses PGC1/PGD1 pins
// #FUSES NODEBUG // No Debug
#FUSES DEBUG // No Debug
#FUSES NOWRT // Program memory not write protected
#FUSES NOPROTECT // Code not protected from reading
#FUSES NOJTAG // JTAG is disabled
|
|
|
|
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
Latest breaking "news" ? |
Posted: Thu Jul 14, 2011 9:26 pm |
|
|
Continued attempts to diagnose the problem have resulted in making the target processor on the Explorer 16 board unprogrammable. Any attempt to program the device results in a verification error in congifuration word 4. Curious that this word is not one of the "standard" config words. Must be something to do with the debugger.
All of the CCS engineers that are familiar with the PIC24 are on vacation this week. Time for me to work on something else. Hope my boss and program manager will understand! (NOT). |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Jul 15, 2011 11:26 am |
|
|
Did you try with any Microchip debugging adapters, too? With REAL ICE, AD1PCFGL is set to 0xFFC5 without problems. I expect an ICD-U64 software problem. |
|
|
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
|
Posted: Wed Jul 20, 2011 8:45 am |
|
|
Thanks FvM for your suggestion.
I have loaded the sw for my ICD3 and rerun the experiment. You are correct: the register is set correctly with the ICD3.
CCS is scratching their heads on this one. |
|
|
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
|
Posted: Thu Jul 21, 2011 8:18 pm |
|
|
Seems that there is an error in the ICD-U64 device data file. CCS support sent me an update and the problem is corrected. Should be included in the next release, V4.124? They also cautioned me to not update the icd firmware to 2.90 as there is a bug that was discovered.
Hope I didn't let the cat out of the bag on this one!
Charlie |
|
|
|