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.
18F25K20 RESET PIN AS INPUT ?
Moderators: David Barker, Jerry Messina
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
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
P18F25K20.inc
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
The *.inc file is not parsed in the same way as *.bas file so be very careful when editing this file.
18F25K20.bas
Code: Select all
LATE As Byte Absolute $0F8D,
PORTE As Byte Absolute $0F84,
Code: Select all
PORTE EQU 0x0F84
LATE EQU 0x0F8D
Code: Select all
// system ports...
Public System Port
PORTE As Byte Absolute $0F84,