PDA

View Full Version : LCD Problem witch PIC16F676



microuser
- 11th August 2005, 09:49
Hi all!
I'm using a PIC16F676 with a 16x2 LCD (CDL4162) but I can't get LCDOut to work!
This LCD today work without problem with a PIC16F874A...

these are my DEFINES:

Define LCD_DREG PORTC ' Port for LCD Data
Define LCD_DBIT 4 ' so I have
' D7 on portc.5
' D6 on portc.4
' D5 on portc.3
' D4 on portc.2
Define LCD_RSREG PORTA ' Port for RegisterSelect (RS) bit
Define LCD_RSBIT 1 ' Port Pin for RS bit on porta.1
Define LCD_EREG PORTA ' Port for Enable (E) bit
Define LCD_EBIT 0 ' Port Pin for E bit on porta.0
Define LCB_BITS 4 ' Using 4-bit bus
Define LCD_LINES 2 ' Using 2 line Display
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 40 ' Data Delay (uS)

Are my connections true?

at the benigging of the program i added this:
ANSEL = 0
CMCON = 7

and I try to view something with:
lcdout $fe,1, "Hello Friends!"

Please help me!!
thanks to all!

Melanie
- 11th August 2005, 10:48
In four-bit mode for PICBasics LCD commands, your LCD connections can be...

Portx.0, Portx.1, Portx.2 and Portx.3

or

Portx.4, Portx.5, Portx.6 and Portx.7

Make your choice, then make your corrections.

microuser
- 12th August 2005, 08:11
Thank you very much Melanie.

Today I will try your suggestions.