Read SPI data from PIC and display on SPI 5110 LCD Display - Total Newby!

Hi All,

I have an Arduino Uno which is connected to a Nokia 5110 84x48 graphic display via SPI. I want to configure it as a dumb display to display text strings from a PIC, sent to the Arduino over SPI. Only two data lines are used by the PIC, one for data and one for CLK. The data is sent on rising edge and idle clk is zero, so I think that this is SPI Mode 0. Will I need a third data line for slave select or can I hard wire this as it will always be in slave mode?

I will be receiving data strings for each line of the display from a PIC16F87, over STI. The data is in the format 8-N-1 and will comprise 14 ascii characters. Arduino will be receive only, I do not need to send any data to the PIC. What is the best / easiest way to do this? There are five lines x 14 characters per line on the display, so I will have five different strings being sent over SPI. My thoughts were to set up a loop to capture each string and store it in one of five locations, then have a longer loop that reads each string and prints it to the LCD display. What sot of header and start/stop data does the PIC need to send?

Is there a problem because both the display and the PIC are operating over SPI?

I'm a total noob at this so be gentle with me, my last programming experience was on a Sinclair ZX81 when it was a new machine :blush: I've only recently started playing with Arduino's after years of dabbling in analog electronics but I'm hooked and eager to learn and any help is most gratefully received!

Thanks!
Allan

I have an Arduino Uno which is connected to a Nokia 5110 84x48 graphic display via SPI. I want to configure it as a dumb display to display text strings from a PIC, sent to the Arduino over SPI.

That would mean that the Arduino would be SPI master and slave at the same time. The hardware is able to be both, master and slave but not concurrently. Because implementing an SPI slave in software is much more complex than the master side I'd suggest that you drive the display with a software emulation while using the hardware to communicate with the PIC.

Will I need a third data line for slave select or can I hard wire this as it will always be in slave mode?

The slave select line is not for switching between slave and master but it signals the start of the communication. Without that signal the synchronization between the master and the slave will get quite complicated. So I would strongly suggest to use an SS signal.

The data is in the format 8-N-1

Are you sure that this is an SPI interface? 8N1 is the most common format for an asynchronous serial communication (UART) and I never heard of it's use in SPI communication.

Is there a problem because both the display and the PIC are operating over SPI?

Yes, as explained above.

The data is in the format 8-N-1

Are you sure that this is an SPI interface? 8N1 is the most common format for an asynchronous serial communication (UART) and I never heard of it's use in SPI communication.

Ah!, I'd assumed it was SPI but looks like I'm wrong :blush:

Can I capture it as asynchronous data then? Guess this would mean that I wouldn't need to worry about software SPI for the display.

Many thanks for pointing me in the right direction!

Can I capture it as asynchronous data then?

Yes, but for an asynchronous serial interface you need to know the baudrate. Do you have that?

Guess this would mean that I wouldn't need to worry about software SPI for the display.

Correct. In this case you can use the hardware SPI for that purpose.
The UNO has just one hardware UART (which does that asynchronous serial interface) and that one is used for the USB connection. You still can use it in your application but keep in mind that you won't have a debugging possibility over a serial connection.

pylon:

Can I capture it as asynchronous data then?

Yes, but for an asynchronous serial interface you need to know the baudrate. Do you have that?

Guess this would mean that I wouldn't need to worry about software SPI for the display.

Correct. In this case you can use the hardware SPI for that purpose.
The UNO has just one hardware UART (which does that asynchronous serial interface) and that one is used for the USB connection. You still can use it in your application but keep in mind that you won't have a debugging possibility over a serial connection.

Yes, I have found that the baud rate is 31250 which seems to be ok for arduino? I'll use hardware uart and just try to manage without debugging over usb. I'll give this a try and write some code and see if I can get it to work :slight_smile:

Many thanks!