Hello Jason,
The 44780 driver has a RS (register select) line that tells whether the byte
(or nibble) is a command or a data (0 = commands, 1 = data). Commands control
the internal working of the chip, data are to be written in (or read from)
data memory and displayed as characters.
Your "lcd_command" looks like writing into internal registers
("PORTB=cmd;//j;") and sending an E (enable) pulse. (By the way, 0.1s is a
very very looong duration for such a pulse.)
You should find somewhere a "lcd_data()" function to write data (something
like "PORTB=data;...), as I suppose that your PORTB drives the RS, R/W and E
lines of the display.
Now the "lcd_command()" function will be used to set up the display (cursor,
blinking, character definition etc. (which seems to have been done in your
programme)), then "lcd_data()" will actually write on the screen.
Keep in touch
JP
Le Monday 07 November 2011, Jason White a écrit :
> Hello, I am writing a program (using SDCC) for the pic16f887, it is driving
> a Hitachi HD44780 character LCD. In the code I am trying to write
> characters to the LCD. First: directly 1 character at a time and then
> Second: using what is essentially the puts function (void puts_lcd(char
> *s)). The puts function fails to send anything more than the first
> character. What am I doing wrong ? or is it a compiler error ? relevant
> files are attached. Thanks ...
>
> >void puts_lcd (char *s)
> >{
> >
> > REG_SEL=1;
> >
> > while (*s)
> > {
> >
> > lcd_command(*s++);
> >
> > }
> >
> > REG_SEL=0;
> >
> >}
--
Never jump into a loop!
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user