PDA

View Full Version : Need help with migration 16F876 -> 18F252



NavMicroSystems
- 24th February 2004, 17:22
I have developped a System based on a 16F876 which works fine.
Due to the fact that the MCU is running out of memory and code space I'm planning to migrate to 18F252.

So far I have been using PBP2.43 with PM.
The 18F252 requires MPASM.

Now my (stupid) questions:

with PM it was quite simple to set programming options for the 16F876 in the source code i.e.

@ Device PIC16F876A, HS_OSC
@ Device PIC16F876A, WDT_ON
@ Device PIC16F876A, PWRT_ON
@ Device PIC16F876A, BOD_ON
@ Device PIC16F876A, LVP_OFF

First question:

What do I have to do to set the options (Configuration Bits)
for the 18F252 using MPASM (v3.5)?

I have tried:
@ __CONFIG _CONFIG7H, _EBTRB_OFF_7H
@ __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
@ __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
@ __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
@ __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
@ __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
@ __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_ON_4L & _DEBUG_OFF_4L
@ __CONFIG _CONFIG3H, _CCP2MX_ON_3H
@ __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
@ __CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_42_2L & _PWRT_OFF_2L
@ __CONFIG _CONFIG1H, _HS_OSC_1H & _OSCS_OFF_1H

but I receive lots of error messages like:

Error[118] . . . Overwriting previous address contents

What am I doing wrong ?

Second question:

I'm planning to use a boot-loader (Mecanique)

Is there any way of modifying one of the pre-defined loader files for a different clock speed (12 Mhz)?

or do you have a recommendation for a different Loader Software?

Many thanks in advance !