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

PIC24FJ256GAxxx in debug forces Analog inputs to Digital

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



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PIC24FJ256GAxxx in debug forces Analog inputs to Digital
PostPosted: Thu Jul 14, 2011 2:21 pm     Reply with quote

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

View user's profile Send private message

Latest breaking "news" ?
PostPosted: Thu Jul 14, 2011 9:26 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jul 15, 2011 11:26 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jul 20, 2011 8:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 21, 2011 8:18 pm     Reply with quote

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
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