PDA

View Full Version : 16f877 to 18f4620 need help



vicce67
- 4th January 2010, 01:48
Dear Friends,

I use 16f877 there are many years with pbp 2.47 and mcs 2.3.0.0 with this configuration

@ device pic16F877,xt_osc, wdt_on, pwrt_on, bod_on, lvp_off, protect_on,wrt_off
OPTION_REG = $7F; ENABLE PORTB PULLUPS
HE/SHE/YOU DEFINES OSC 04

I need to migrate for the 18f4620

how to configure the 4620 equal to the 877 and how to compile?

I need an example

in advance thankful,

vicce

mackrackit
- 4th January 2010, 04:50
To start with you need to have MPASM, PM will not do now.

Then look at the 18f4620.inc in your PBP directory and see how the fuses are set there.
Then to find all of the options for your chip goto the MPASM directory in program files/microchip. There you will find another *.inc file for your chip. Do not make changes to it but look near the end and ALL of the config options will be there.

BrianT
- 4th January 2010, 08:20
I made the same transition a couple of years back.

PBP 2.47 supports the 18F4620 but has some bank switching issues that may affect you. PBP 2.60+ is worth the upgrade because you get signed LONGs which are very handy for high precision arithmetic and saves a lot of checking to make sure a PIC16F877 results never goes negative.

You will need to open the MPASM file P18F4620.inc and search for the first occurrence of the word DEBUG. Comment this out by placing
;
in the first column followed by a space. Otherwise the PBP reserved word DEBUG gets confused with the MPASM reserved word DEBUG and everything falls apart.

HTH
BrianT