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

Problem Migrating from PIC18f452 to PIC18f4520

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



Joined: 12 Oct 2005
Posts: 7

View user's profile Send private message

Problem Migrating from PIC18f452 to PIC18f4520
PostPosted: Tue Mar 14, 2006 8:59 am     Reply with quote

Hi,

I'm trying to migrate code from the PIC18F452 to the PIC18F4520. I'm programming my device with the ICD-U40. When I initially download code onto the device, it runs fine but if I unplug the ICD and cycle power the device does not work.

Any ideas?

Thanks,

Alec
mpfj



Joined: 09 Sep 2003
Posts: 95
Location: UK

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Mar 14, 2006 10:47 am     Reply with quote

Could you post your #fuses settings ?

It sounds like the Oscillator mode or ICD setting in the config bits might be wrong.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Mar 14, 2006 11:42 am     Reply with quote

On power cycle the PLL of the H4 is reset. Do you use the H4 fuse?
also by disconecting the ICD use lose a ground wire to the PC. Are you determining working/not-working via RS232? If so you may need a gound common to the board and the PC. ((Which the ICD was providing))
alec



Joined: 12 Oct 2005
Posts: 7

View user's profile Send private message

PostPosted: Tue Mar 14, 2006 1:56 pm     Reply with quote

mpfj wrote:
Could you post your #fuses settings ?

It sounds like the Oscillator mode or ICD setting in the config bits might be wrong.


Thanks for replying. Here is some code:

We haven't changed anything here from when we were using the 452. We are using a 4MHz external oscillator that worked with the 452.

#use delay(clock=4000000)

#fuses XT, NOLVP, NOWDT

I would be very grateful if you could point out anything that might be causing the problem.

Thanks,

Alec
alec



Joined: 12 Oct 2005
Posts: 7

View user's profile Send private message

PostPosted: Tue Mar 14, 2006 1:58 pm     Reply with quote

treitmey wrote:
On power cycle the PLL of the H4 is reset. Do you use the H4 fuse?
also by disconecting the ICD use lose a ground wire to the PC. Are you determining working/not-working via RS232? If so you may need a gound common to the board and the PC. ((Which the ICD was providing))


Thanks for replying. I don't think we are using the H4 fuse. We don't refer to H4 at all in our #fuse statement. Could you please explain what the H4 fuse is?

Thanks,

Alec
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 14, 2006 2:33 pm     Reply with quote

I don't have the CCS ICD and PCWH. But I think it's similar to Microchip
ICD2 in operation. With ICD2 there is a debugger mode and a
programmer mode. These are selected within MPLAB. To program a
PIC to operate in stand-alone mode, you must use ICD2 as a
programmer, not a debugger. Look for a similar selection within the
CCS IDE. (Or someone who has PCWH can explain how to do it).
alec



Joined: 12 Oct 2005
Posts: 7

View user's profile Send private message

PostPosted: Tue Mar 14, 2006 4:02 pm     Reply with quote

PCM programmer wrote:
I don't have the CCS ICD and PCWH. But I think it's similar to Microchip
ICD2 in operation. With ICD2 there is a debugger mode and a
programmer mode. These are selected within MPLAB. To program a
PIC to operate in stand-alone mode, you must use ICD2 as a
programmer, not a debugger. Look for a similar selection within the
CCS IDE. (Or someone who has PCWH can explain how to do it).


Thanks for taking the time to post. I don't think this is the problem though. We are definitely trying to program the device using the ICD as a programmer. We are repeating a process that we have used successfully several thousand times when our device used the 452. This makes me think it is a migration issue.

Regards,

Alec
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 14, 2006 4:27 pm     Reply with quote

Quote:
We are using a 4MHz external oscillator that worked with the 452.

1. Try changing the oscillator mode to EC or ECIO instead of XT,
since you're using an external oscillator.

2. Make a 10 line test program (including all pre-processor statements)
that just blinks an LED.

3. Look at Microchip's "PIC18F452 →PIC18F4520 Migration" document:
http://ww1.microchip.com/downloads/en/DeviceDoc/39647a.pdf
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