Hello,
I'm trying to use a Hitachi 2x16 LCD with CCS C Compiler. but I cannot see any message on the lcd (I see the black boxes that appears when the LCD Poweres Up, and I test the LCD using another compiler). My code is this:

Thank you, Ezequiel
___________________________
This message was ported from CCS's old forum
Original Post ID: 10759

PCM programmer

Joined: 06 Sep 2003Posts: 20477

Re: LCD Problem

Posted: Fri Jan 17, 2003 3:21 pm

:=Hello,
:= I'm trying to use a Hitachi 2x16 LCD with CCS C Compiler. but I cannot see any message on the lcd (I see the black boxes that appears when the LCD Poweres Up, and I test the LCD using another compiler).
---------------------------------------------------------

What is the part number of the Hitachi LCD ?

Can you give us a list of the connections between the LCD
and the PIC ? (ie., which PIC pin goes to which LCD pin ?).
___________________________
This message was ported from CCS's old forum
Original Post ID: 10763

Take a look at your printf function, as it looks like a syntax error to me. printf(lcd_putc,"\%s", "test");.
But why not simply lcd_putc("test");

Phil
___________________________
This message was ported from CCS's old forum
Original Post ID: 10764

EzequielGuest

Re: LCD Problem

Posted: Sat Jan 18, 2003 3:50 am

Hello,
I'm using the LCD.C library that is include in the Driver directory (PCM and PCB 3.094), I set the define to use PortB. So, I have LCD DataBus (DB4 - DB7)at PortB Low Nib (RB.4 to RB.7). In PortB.0 I have the Enable Pin, and in PortB.1 I have the RS Pin. The LCD is a Powertip PC1602F B, and it's working okey (I tested it with a Basic Compiler for PIC).
Thank you very much
Ezequiel
___________________________
This message was ported from CCS's old forum
Original Post ID: 10775

EzequielGuest

Re: LCD Problem

Posted: Sat Jan 18, 2003 7:43 am

Hello,
I think I discovered something but don't know how to fix it.
I connected all PortB Pins with leds. My program works okey here, I could see
some blinks at the Enable Pin (RB.0), and in the Data Pins (RB.4 to RB.7). Also
the Led at PortA.0 and the TXPin at PortC.0 also "lights". So I disconnected all
leds at portB.0 and restart the PIC. What happens here?, The program starts, light
PortA.0 Led, and stops!!!. So, a pin in PortB needs a path to ground to work, I connected
PortB.7 to ground using a 10K resistor, and my program starts working Okey. Could anybody
tell me why? If the same PIC, and the same LCD, with a different compiler works okey
without any extra component. Then I hock up the LCD (with the pull down resistor at RB.7),
and the program start working, but I couldn't see anything on the LCD.
My programmer is EPIC Win Programmer, the fuses are: No WatchDog, HS Crystal,
Brown Ou Enable, Power Up Timer Enable, Code Proctection Off. My CcS Compiler is version 3.094
Does somebody writes another driver for Hitachi LCDs or everybody use CCS driver?
If I want to write my own driver, How I can write to the entire Port, or to the high nibble at once?

Hope somebody could help me,

Thank you very much.
Ezequiel
___________________________
This message was ported from CCS's old forum
Original Post ID: 10776

TomiGuest

Re: LCD Problem

Posted: Sat Jan 18, 2003 8:33 am

1. You have to use 3 control lines. You wrote about 2 lines but what is about R/W (to control the data direction: read or write) ?
2. You must connect pin3 of LCD to a small voltage dep'd on the LCD type. Try to connect it to GND.

:=Hello,
:= I think I discovered something but don't know how to fix it.
:=I connected all PortB Pins with leds. My program works okey here, I could see
:=some blinks at the Enable Pin (RB.0), and in the Data Pins (RB.4 to RB.7). Also
:=the Led at PortA.0 and the TXPin at PortC.0 also "lights". So I disconnected all
:=leds at portB.0 and restart the PIC. What happens here?, The program starts, light
:=PortA.0 Led, and stops!!!. So, a pin in PortB needs a path to ground to work, I connected
:=PortB.7 to ground using a 10K resistor, and my program starts working Okey. Could anybody
:=tell me why? If the same PIC, and the same LCD, with a different compiler works okey
:=without any extra component. Then I hock up the LCD (with the pull down resistor at RB.7),
:=and the program start working, but I couldn't see anything on the LCD.
:= My programmer is EPIC Win Programmer, the fuses are: No WatchDog, HS Crystal,
:=Brown Ou Enable, Power Up Timer Enable, Code Proctection Off. My CcS Compiler is version 3.094
:= Does somebody writes another driver for Hitachi LCDs or everybody use CCS driver?
:=If I want to write my own driver, How I can write to the entire Port, or to the high nibble at once?
:=
:= Hope somebody could help me,
:=
:=Thank you very much.
:=Ezequiel
___________________________
This message was ported from CCS's old forum
Original Post ID: 10777

EzequielGuest

Re: LCD Problem

Posted: Sat Jan 18, 2003 10:18 am

Hello,
I've the LCD R/W set with a 10k resistor to ground (Write Mode), and I have a variable resistor to control the contrast in the LCD Vo Pin.
Ezequiel
___________________________
This message was ported from CCS's old forum
Original Post ID: 10781

TomiGuest

Re: LCD Problem

Posted: Sat Jan 18, 2003 10:44 am

Fault. You _must_ control the R/W bit. A byte or a nibble is written into the LCD as:
1. Set R/W to 1 (read mode) and the port to input.
2. Read D7 (the busy signal) and wait until the LCD is busy.
3. Reset R/W and write out the next byte.

:=Hello,
:= I've the LCD R/W set with a 10k resistor to ground (Write Mode), and I have a variable resistor to control the contrast in the LCD Vo Pin.
:=Ezequiel
___________________________
This message was ported from CCS's old forum
Original Post ID: 10783

EzequielGuest

Re: LCD Problem

Posted: Sat Jan 18, 2003 11:13 am

Thank you very much, I was used to avoid the use of the RW line, as my Basic Compiler doesn't need it.
Ezequiel
___________________________
This message was ported from CCS's old forum
Original Post ID: 10784