Sonsivri

Electronics => Pic Basic Languages => Topic started by: Cain on December 11, 2014, 03:44:15 15:44



Title: Porting older PBP code to 16F182x?
Post by: Cain on December 11, 2014, 03:44:15 15:44
Hi,

Anyone know the major differences between lets say 16F688 and eqvivalent 16F1825 (with the so called "Enhanced 14-bit core")?

I tried to port some old code but was surprised that hserin as well as the built in debug serial function did not work, same code works fine on the pin combatible 16F688?


Title: Re: Porting older PBP code to 16F182x?
Post by: Old_but_Alive on December 11, 2014, 04:24:41 16:24
the newer PIC1825 is much more flexible, and you can change which pins do what.

So you must in the startup code set up the pin allocation registers to suit.

it should only minor though.

fuses will probably also need adjusting


Title: Re: Porting older PBP code to 16F182x?
Post by: pickit2 on December 11, 2014, 06:11:24 18:11
it's a well know issue. A double word config.
example.

__CONFIG(WDTDIS & XT & UNPROTECT);  // Program config. word 1
__CONFIG(FCMEN);                    // Program config. word 2


Title: Re: Porting older PBP code to 16F182x?
Post by: Checksum8 on December 11, 2014, 10:56:58 22:56
Like Old but alive  mentioned more pins are multiplexed with other modules. If something is not working maybe another module is  using that pin by default.

See page 125 of the datasheet, you need to set these

APFCON0: ALTERNATE PIN FUNCTION CONTROL REGISTER 0
APFCON1: ALTERNATE PIN FUNCTION CONTROL REGISTER 1


Title: Re: Porting older PBP code to 16F182x?
Post by: Cain on December 12, 2014, 06:11:31 06:11
Thank you for the pointers. Was a while since I used PIC's so need to read up on the datasheet.

Funny thing is that I did Google quite a bit before posting this and nothing usefull showed up but thats maybe my Google skillz sucking ;)