18F25K20 RESET PIN AS INPUT ?

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
rubenpena
Registered User
Registered User
Posts: 32
Joined: Sun Mar 25, 2007 2:07 am
Location: Monterrey,Mexico

18F25K20 RESET PIN AS INPUT ?

Post by rubenpena » Wed Sep 26, 2012 10:45 pm

Dear friends:
I am using the 18f25k20 and always leave the reset pin as reset, but I now need one extra input and I configure the MCLRE = OFF . and add the line in my program as button in porte.3.However the compiler flags an error and do not accept the pin as input.
I did check in the Microchip includes and it appears as RE3 (P18f25k20.inc)
; MCLR Pin Enable bit:
; MCLRE = OFF RE3 input pin enabled; MCLR disabled
; MCLRE = ON MCLR pin enabled; RE3 input pin disabled

How can I declare this in my program...?
Thanks in advance...
Ruben de la Pena V.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Thu Sep 27, 2012 9:28 am

This was a subject of a very recent post by my ISP had a server issue and it may have been lost. Anyway, you need to (carefully) edit the device 18F25K20.bas file and the P18F25K20.inc file. Both these files can be found in the compile "includes" folder. Changes are:

18F25K20.bas

Code: Select all

LATE As Byte Absolute $0F8D,
PORTE As Byte Absolute $0F84,
P18F25K20.inc

Code: Select all

PORTE          EQU 0x0F84
LATE             EQU 0x0F8D 
You need to ensure that the additions are in the correct place. Search for PORTC and LATC in each file to locate the correct sport. For example, in the main device file PORTE must be in the PORTS section

Code: Select all

// system ports...
Public System Port
   PORTE As Byte Absolute $0F84, 
The *.inc file is not parsed in the same way as *.bas file so be very careful when editing this file.

rubenpena
Registered User
Registered User
Posts: 32
Joined: Sun Mar 25, 2007 2:07 am
Location: Monterrey,Mexico

PORTE

Post by rubenpena » Fri Sep 28, 2012 7:55 pm

David:
Thanks...
Now it is working OK.
Thanks again and take care...
Ruben de la Pena V.

Post Reply