PDA

View Full Version : 18F2620 compile problems in PBP



Joe Rocci
- 11th August 2006, 13:44
I'm trying to bring up a new design using the 18F2620 for the first time, using PBP 2.46. I'm getting compile error messages saying that the PBP assembler doesn't support the 18F2620, and suggesting that I use the MPASM assembler.

Does PBP support the 18F2620 natively, or do I really need to use MPASM?

Joe

Melanie
- 11th August 2006, 13:57
You can tell PBP to use MPASM rather than the default PM.

Example Command Lines (depending on your installation)...

PBPW -p18F2620 MyFile -ampasm

PBPW -p18F2620 MyFile -ampasmwin

mat janssen
- 11th August 2006, 14:00
The 18F2620 was already supported in version 2.45. When you use 2.46 it should work. Maybe you forgot something to tell to the compiler.

Joe Rocci
- 11th August 2006, 15:41
Thanks folks...I got it to compile/assemble using MPASM. Now I have another problem. I'm trying to use the Mecanique bootloader with Mecanique's standard 4 MHz 18F2620 bootloader hex file, but I want to use the internal 4 MHz PIC clock. The internal clock seems to be defaulting to 1 MHz. Can anyone suggest how to get around this without a custom bootloader file?

I'm using a Melabs USB programmer with Melabs driver to program the part.

Joe

Charles Linquis
- 12th August 2006, 01:30
If it works like the 8722, when you load the bootloader in the chip, you can set the config fuses so that the PLL is enabled. The 1Mhz default will be multiplied by 4, giving you the 4Mhz you want.

Bruce
- 12th August 2006, 04:06
The MCS boot-loader firmware has config fuse options already set. You cannot over-ride these when loading your code into the target using the boot-loader software.

I.E. whatever the config fuse settings are in the loader firmware you're stuck with.

The only way to change config fuse settings, when using the MCS boot-loader, is to re-program the PIC with a different boot-loader firmware file.

Whatever config fuse settings you may have embedded in your .hex file at compile time are simply ignored when you load your code using the boot-loader software. The boot-loading process does not alter config fuse settings.

Note: The MCS boot-loader works only with an external oscillator. If you change this in the loader firmware before programming, it probably isn't going to work. At least not reliably.

Joe Rocci
- 12th August 2006, 12:24
......Note: The MCS boot-loader works only with an external oscillator. If you change this in the loader firmware before programming, it probably isn't going to work. At least not reliably.

----------------

Bruce,

Why so? Why can't I write a loader that uses the internal clock? It certainly can't be an accuracy/stability issue - I have thousands of units in the field for a couple of years running serial comms with the internal clock over very wide temperature ranges. That much works fine.

And if I CAN write a loader that uses the internal clock, then why can't I modify the MCS loader to do the same by disassembling, modifying, and reassembling?

Thanks

Joe

Bruce
- 12th August 2006, 15:26
Hi Joe,

You can modify the MCS loader files if you like. They just won't work as-is
with the internal oscillator.

Charles Linquis
- 13th August 2006, 00:27
I over-rode the bootloader config settings.

I use the Microchip ICD2 to program the bootloader into the device. If you first load the proper bootloader file, you can then change the configuration fuse settings in the ICD2 "config" section. Program the part, and away you go.

I have programmed several 18F8722s that had no external oscillator whatsoever. I simply set the "PLL ENABLED" and "Internal OSC" options in MPLAB and programmed it with the 4Mhz bootloader. MCLoader had no trouble at all loading my program files.

Joe Rocci
- 13th August 2006, 10:11
Thanks for the helpful suggestion Charles. It's always great to hear waht CAN be done instead of what CAN't be done

Joe