- Joined
- Jul 4, 2009
- Messages
- 16,458
- Helped
- 5,156
- Reputation
- 10,341
- Reaction score
- 5,194
- Trophy points
- 1,393
- Location
- Aberdyfi, West Wales, UK
- Activity points
- 139,286
CSB is the enable signal I mentioned earlier. When CSB goes low it tells the SPI device that D7 data is valid on the next rising edge of SCL. Normally, an SPI device will collect data but not use it until CSB goes high again to tell it all the bits have been sent and the data transfer is complete.
Generating SPI signals in the PIC is fairly easy although you do need to keep three GPIO pins free for the signals. Your problem is that the LCD module needs 4-bit parallel data plus 3 control signals so you can't connect directly to it. The solution, if you want to use SPI, is an expander. It is basically a shift register, it takes the bits in through the SPI side and presents them all together as 8-bit parallel data on the other side, you can then use these to drive the LCD.
There are SPI LCD modules which have the expander built into them but the 1602 requires you to do it yourself with extra circuitry.
Brian.
Generating SPI signals in the PIC is fairly easy although you do need to keep three GPIO pins free for the signals. Your problem is that the LCD module needs 4-bit parallel data plus 3 control signals so you can't connect directly to it. The solution, if you want to use SPI, is an expander. It is basically a shift register, it takes the bits in through the SPI side and presents them all together as 8-bit parallel data on the other side, you can then use these to drive the LCD.
There are SPI LCD modules which have the expander built into them but the 1602 requires you to do it yourself with extra circuitry.
Brian.