I'd like to share here some experience working with 186x64 graphic LCD while work in multiple-SPI device environment. I bought a 128x64 LCD on eBay. Manufacturer is unknown and it could be like Raystar Optronic RG12864,
DFrobot or any other with the same dimension (93x70mm) and controller device (ST7920). It looks like this:
Documentation is minimal and it says that you can be connected using parallel or serial bus. Pinouts is usually as follows:
Using serial has an obvious advantage since it does not require so many lines while access speed is still very good. I tested it first without invoking any other SPI devices on the same bus, and that works fine as it's presented
here.
So far so good. The problem appears when multiple devices starts to be addressed (ADC, DAC...) after LCD was "initialized" (actively used to display any content). For example this is an screenshot when LCD is addressed alone.
... and below you can see what is happened when some other SPI devices are accessed after LCD:
First I thought that something is wrong with used u8glib library. I tested it with some other but the result was the same. While accessing another SPI device unwanted content starts to appear. After all I come to conclusion that the way how such LCD has to be connected is not really in line with SPI "standard". What I found until now as proper way to made serial connection is:
SCLK --> E (Pin 6)
MOSI --> RW (Pin 5)
CS --> RS (Pin 4)
E stands for enable and you will presume that CS has to be connected there but that is not a case. It seems that when you trying to send something to other SPI device and what include SCLK activity make LCD also active with unwanted result. To fix this problem I decide to use "brute force" by using an 125 gate controlled by CS signal as shown below.
I'm wondering if someone else have similar problem and if there is a better way to resolve it. Thanks.