konaboy wrote:Also the pinout of the NOkia 5110 LCD on the schematic looks different to the pinouts published elsewhere on the web and in the data sheet. Here is what is shown on the schematic:
1 VCC
2 CLK
3 MOSI
4 DC
5 CD
6 EXT CLOCK
7 GND
8 VOUT
9 RST
But the pinouts shown elsewhere is:
1 VCC
2 GND
3 SCE
4 RST
5 DC
6 DN MOSI
7 SCLK
8 LED
SO, not surprising I'm confused. Many questions from a novice, any help appreciated.
Rodot uses the plain LCD in his schematic. If you buy a so-called "LCD breakout" from for example ebay, it is not only the LCD. It is the LCD + the small PCB that it is attached to. So you are comparing the pinout of the
plain LCD (Gamebuino) to the pinout of a
Nokia 5110 LCD breakout. That is the reason for the difference. If you look closely at the PCB of a LCD breakout, you will notice, that on that PCB are actually the same connections as on the Gamebuino - they are simply not connected to the pins of the breakout, because they are unnecessary (like CLKOUT).
It is also common, that pins are called a bit different names. That is why it is important to learn what each pin does. I suggest you get the datasheet for the display controller (I cant remember what it was, it was a Philips something).
1 VCC -> 3.3V for plain LCD, 3.3V or 5V on a breakout (the voltage level drop from 5 to 3.3V is usually built in the breakouts)
2 CLK -> clock signal, same as SCLK, sometimes also marked SCK, this is the "hearbeat" of the SPI bus. Without it, nothing works
3 MOSI -> same as DN MOSI -> Master Out, Slave In of SPI bus -> this is the actual data that is being sent to the lcd
4 DC -> DC or D/C -> select between if the sent data on MOSI is pure data (D) or a control command (C) to the screen
5 CD -> its not CD, it is CE -> CE is the same as SCE -> low on this means "Chip Enable", high is chip disable. Through this pin, every peripheral on the same SPI bus (in this case there are the SD card and LCD), knows who the master (the MCU) is "talking to". This is very important
6 EXT CLOCK -> not needed if breakout is used
7 GND -> Ground
8 VOUT -> Voltage out. Not needed and not available on a typical Nokia 5110 lcd breakout
9 RST -> reset. This is pulled low for a short period in the initialization of the LCD to reset it
Connecting a Nokia LCD breakout to an Arduino is very simple. Just go pin by pin and try to understand what each pin is doing. Later on, you will want to experiment with different displays and other SPI devices. It will be worthwhile to really understand the pinout of a SPI device. Do not just look at pinouts done by others. Get the datasheet of the display and read it through. It will make your learning progress much faster, even if you do not understand everything in the datasheet.
Happy hacking !
UPDATE: here is the datasheet for the display
https://www.sparkfun.com/datasheets/LCD/Monochrome/Nokia5110.pdfAnd here is the ATMega328P (the flat TQFP version that is on the Gamebuino) to Arduino pinout
The yellow marked numbers are the digital pins of Arduino. The red pins are the so-called "Analog" pins of Arduino. Next to those numbers, are marked the actual Port and Pin names of the ATMega328P. So for example yellow "5" on Arduino is actually D5 = Port D, pin 5 on the Atmega. It is also pin number 9 in the TQFP packaged ATMega328P. A6 and A7 are special pins that are for input only. They are used as ambinet level light monitoring and battery level monitoring on the Gamebuino. You can connect the battery level to constant high, if you do not want to build a battery charging circuit yet.