I am doing a little sideproject and for that I need an LCD display to show some text and some graphical images, I opted for a model that was available at Farnell, and wanted to work with what I got. However, it seems that I am stuck at the start of it.
I know that the NT7107 is compatible with the KS0108 libraries. It seems that manufacturers have 10 different ways of wiring the LCD and I can't really figure out how to hook it up.
So far I have hooked it up with an external powersupply instead of using the arduino build in one.
The board I am using is an Arduino Nano the one based on the ATMEGA328P.
I am using a Midas display LCD datasheet
The resolution is 128x64 pixels.
All I get is a black screen. I am happy to supply any additional information that you may need. as I hope it's simply a dumb mistake on my part, but right now I am not getting anywhere with staring at the same piece of paper for hours.
Additional to this, the potmeter right is connected to 5V.
All of this is from what I can tell is needed for it to function. All I am getting is a black screen that I can adjust the contrast on.
LCD PIN | to | NANO PIN |
---|---|---|
1 | >>> | GND |
2 | >>> | +5V |
3 | >>> | POT Slider |
4 | >>> | D2 |
5 | >>> | D3 |
6 | >>> | D4 |
7 | >>> | D5 |
8 | >>> | D6 |
9 | >>> | D7 |
10 | >>> | D8 |
11 | >>> | D9 |
12 | >>> | D10 |
13 | >>> | D11 |
14 | >>> | D12 |
15 | >>> | D13 |
16 | >>> | A0 |
17 | >>> | A1 |
18 | >>> | POT left (-5V) |
19 | >>> | +5V |
20 | >>> | GND |
Lastly the code that I tried running is the Hello world example from u8g2lib.
/*
HelloWorld.ino
Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
Copyright (c) 2016, olikraus@gmail.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <Arduino.h>
#include <U8g2lib.h>
/*
U8g2lib Example Overview:
Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption
Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards.
U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only.
*/
// Please UNCOMMENT one of the contructor lines below
// U8g2 Contructor List (Frame Buffer)
// The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp
// Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected
//U8G2_KS0108_128X64_F(rotation, d0, d1, d2, d3, d4, d5, d6, d7, enable, dc, cs0, cs1, cs2 [, reset])
U8G2_KS0108_128X64_F u8g2(U8G2_R0, 5, 6, 7, 8, 9, 10, 11, 12, 4, 2, 13, A0, U8X8_PIN_NONE, A1); // Set R/W to low!
// End of constructor list
void setup(void) {
u8g2.begin();
}
void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}