I am trying to get the Nokia 5110 screen up and running on BeagleBone Black rev b. I am using…
- Ken Keller's BeagleBone Nokia 5110 LCD Bonescript library
- An Adafruit recycled Nokia 5110/3310 monochrome LCD
When I hook all pins up and run the test program below, it doesn't output anything on the screen. I tested all the pins with a voltmeter and got these readings:
– VCC = 3.373V Constant
– RST = 1.63V Constant
– CS = Sits at .001V when program runs, but has a few pulses up to .040V
– D/C = 3.3V Constant
– DIN = fluctuates between 0-.3xx (so assuming it is sending data)
– CLK = fluctuates as well
Code:
var lcd = require('./LCD_5110.js');
var b = require('bonescript');
var timeout = 0;
var inverseIndex;
//
// Must define the following outputs to use LCD_5110.js
//
lcd.PIN_SDIN = "P9_21";
lcd.PIN_SCLK = "P9_22";
lcd.PIN_SCE = "P9_23";
lcd.PIN_DC = "P9_24";
lcd.PIN_RESET = "P9_25";
lcd.setup();
setTimeout(loop, 5);
function loop() {
// test bitmap write
lcd.clear();
lcd.bitmap(beagle);
inverseIndex = 0;
setTimeout(loop0, 1000*timeout);
}
function loop0() {
// test inverse video
if(inverseIndex % 2) {
lcd.inverse(lcd.LCD_INVERSE);
} else {
lcd.inverse(lcd.LCD_NORMAL);
}
inverseIndex++;
if(inverseIndex < 19) {
setTimeout(loop0, 50*timeout);
} else {
setTimeout(loop1, 50*timeout);
}
}
function loop1() {
// test normal character write
lcd.clear();
for ( index = 0x41 ; index < 0x7b ; index++)
lcd.character(String.fromCharCode(index));
setTimeout(loop2, 2000*timeout);
}
function loop2() {
// test bitmap and string write
lcd.clear();
lcd.bitmap(world_map);
setTimeout(loop3, 1000*timeout);
}
etc.
Best Answer
Found out how to do it, here is the code