Thanks Mac;
I am indeed using a single S/R in 8 bit mode using SPI with seperate EN and RS connections to the LCD from the MCU. I have possibly got the SPI connections mixed up, at present I have the MOSI conncted to pin 14, SPI CLK connected to pin 11 and SS to pin 13 (Output Enable on the 595). I thought OE was used to latch the data into output of the S/R. You suggest to use pin 12 (master reset on the 595) is that correct as this may be my problem.
Martin
Hello Martin,
Firstly I presume you are trying to interface with an alphanumeric LCD (not a graphical one). I am not entirely clear on the hardware connections you are attempting to use. So here are some possibilities for the interface between the HC595 and the LCD -
I suspect you may be attempting the third method. In all cases the RW line should be grounded. For the interface between the MCU and the HC595, the following connections would be required.
HC595
Pin 10 SCLR = High
Pin 11 SCK = SPI CLK
Pin 12 RCK = Strobe - needs to be a separate MCU output.
Pin 13 /G = Low
Pin 14 SER = SPI MOSI
The strobe signal would be pulsed at the completion of each SPI transaction, assuming a single S/R. The /SS output signal might be used as the strobe signal with a single S/R, because it outputs a positive edge at the conclusion of the transaction. Either of the following SPI modes should be suitable for the HC595 -
CPHA = 0, CPOL = 0 or
CPHA = 1, CPOL = 1
Before trying to test the operation of the LCD, I would suggest that the SPI operation be separately tested to confirm that the S/R outputs operate in the intended manner.
You will most likely need to allow a sufficient delay for the LCD to power-up, before trying to initialise it - I would tend to allow something like 200 milliseconds. Also, some LCD commands take much longer to execute than others.
Regards,
Mac