HI, guys. I have one question about how to wire up LCD to Arduino In my project, I connect MCP4822 with Arduino through SPI. So pin 12 and pin 10 are used for Arduino. Now I want to use LCD to show the output current. But Most of tutorials show the LCD using 12-10 for RS and RW. So I want to know could I use Pin 1-3 instead of pin 12-10. I just want to make sure this. Thanks
If you are not using Pin 13 for SCK, then you are not using SPI. Maybe faking it with software SPI.
CrossRoads: If you are not using Pin 13 for SCK, then you are not using SPI. Maybe faking it with software SPI.
I mean it looks like they are conflict with each other
With SPI, pins 13-12-11 are connected to all devices. Unique Slave Select pins are used to enable one device at a time.
CrossRoads: With SPI, pins 13-12-11 are connected to all devices. Unique Slave Select pins are used to enable one device at a time.
If you are using a ST7920-based graphic LCD, then unfortunately it does not have a CS input. This means that it cannot share the SPI pins with another device. Here are a few solutions:
Drive one of the devices using software SPI. The ST7920 can be drive using ShiftOut, although ShiftOut is unnecessarily slow, and it'e easy to write a faster version.
If you are not using the UART, you can use the UART in SPI mode to get a second SPI channel.
Use an external and-gate to gate the clock to the ST7920.
However, if it's a text LCD (which uses about 5 other pins as well), then you can use any pins you like for RS and RW.