PDA

View Full Version : PORTC constants



Forkosh
- 18th October 2007, 01:36
How can I do a constant to control my LCD connected to PORTC.3
I tried LCD CON PORTC.3 but it didn't work.

For example
How can I control my LCD by doing something like this
SEROUT LCD,6, ["Hello World"]

{where LCD is the constant representing PORTC.3}

Instead of doing this
SEROUT portc.3,6 ,["Hello World"]


I am using a PIC16f616 with a serial 16x2 LCD display.

The LCD cannot be connected to a PORT B pin because the PIC16f616 has no portB, so it must be portc.3

Thank You

,Eric

Forkosh
- 18th October 2007, 01:38
Nevermind ,
After researching it in google more , i was able to find the SYMBOL command

All is well

Archangel
- 18th October 2007, 05:43
Hi Eric,
Dunno if CON works that way but VAR does.


TrisC = %11110111 ' portC.3 as Output all others as Inputs
INCLUDE "Modedefs.bas" ' must include if not using mode
LCD VAR PortC.3

start:
SEROUT LCD,6,$FE,1 "Hello World"
pause 1000

main:
do something
goto main
end

JS

I personally never use the mode command preferring to use T9600 or N9600, just my personal choice. - PBP manuel ver 2.47 page 137 says pin may be a constant or variable number 0 - 15 or a variable name like PortA.0