Electronic – BeagleBone Black display

beaglebone black

I am trying to get the Nokia 5110 screen up and running on BeagleBone Black rev b. I am using…

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

/*This script writes variable headers and their values to a
/ Nokia 5110 screen on the BBB. The virtual HDMI cape must be disabled for
/ this to occur, and the LCD_5110.js file must be placed in the same directory.
/ verified to work with BBB REV C, use pins
/
/ lcd.PIN_SCLK = "P8_38";
/ lcd.PIN_SDIN = "P8_37";
/ lcd.PIN_DC = "P8_39";
/ lcd.PIN_SCE = "P8_41";
/ lcd.PIN_RESET = "P8_43";
/credit to kkeller's work @ github.com/kkeller/Nokia5110 
*/

var lcd = require('./LCD_5110.js');

lcd.PIN_SCLK = "P8_38";
lcd.PIN_SDIN = "P8_37";
lcd.PIN_DC = "P8_39";
lcd.PIN_SCE = "P8_41";
lcd.PIN_RESET = "P8_43";


var strokeInterval = 2300;
var voltage = 9;
var error = 'none';




lcd.setup();
lcd.gotoXY(0,0);
lcd.string('            CYCLES: '+strokeInterval);
lcd.clear();

lcd.gotoXY(0,0);
lcd.string('            VOLTAGE: '+ voltage);
lcd.clear();

lcd.gotoXY(0,0);
lcd.string('            ERRORS: '+ error);
lcd.clear();

lcd.string('');