PDA

View Full Version : TRIS E setting for 18F2550



Squibcakes
- 23rd May 2007, 01:03
Hi Guys,

I want to use Pin 1 (TrisE/MCLR input) as a digital input and having problems trying to set TRISE.3 as a digital input.

I get error [113] symbol not previously defined.

I've set CONFIG MCLRE = OFF in the .inc file to disable MCLR, but that doesn't help.

I know it's simple but just can't figure it out.....



' SETUP THE PORTS
ADCON1 = $0F
SSPCON1 = 0
CMCON = $07
TRISA = $FF
TRISB = %00000001
TRISC = %00000001
TRISE = %11111111

Cheers
Squib

skimask
- 23rd May 2007, 03:34
Hi Guys,
I want to use Pin 1 (TrisE/MCLR input) as a digital input and having problems trying to set TRISE.3 as a digital input.
I get error [113] symbol not previously defined.
I've set CONFIG MCLRE = OFF in the .inc file to disable MCLR, but that doesn't help.
I know it's simple but just can't figure it out.....
Cheers
Squib

If you program and then do a readback of the '2550, is the MCLRE bit still set or reset?
Sounds to me like the CONFIG isn't being set in the PIC itself.

paul borgmeier
- 23rd May 2007, 06:07
I've set CONFIG MCLRE = OFF in the .inc file to disable MCLR, but that doesn't
Something to try ...try this in your .inc file


__CONFIG _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H

EDIT - In the above, I added the "_MCLRE_OFF_3H" to the already exisiting __CONFIG _CONFIG3H line of the inc file

Squibcakes
- 23rd May 2007, 07:47
Ok thanks guys sussed it.

I was right in the fist place to use CONFIG MCLRE = OFF , the only thing is that I didn't need to use TRISE = ....., This pin is input only anyway.

Cheers
Squib