View previous topic :: View next topic |
Author |
Message |
alec
Joined: 12 Oct 2005 Posts: 7
|
Problem Migrating from PIC18f452 to PIC18f4520 |
Posted: Tue Mar 14, 2006 8:59 am |
|
|
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
|
|
Posted: Tue Mar 14, 2006 10:47 am |
|
|
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
|
|
Posted: Tue Mar 14, 2006 11:42 am |
|
|
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
|
|
Posted: Tue Mar 14, 2006 1:56 pm |
|
|
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
|
|
Posted: Tue Mar 14, 2006 1:58 pm |
|
|
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
|
|
Posted: Tue Mar 14, 2006 2:33 pm |
|
|
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
|
|
Posted: Tue Mar 14, 2006 4:02 pm |
|
|
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
|
|
Posted: Tue Mar 14, 2006 4:27 pm |
|
|
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 |
|
|
|