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.

  • 3
    RST looks low to me - what is it connected to? – Majenko Jun 24 '14 at 20:34
  • RST is connected to pin 9_25, it is reading a constant 1.629V – John Barbour Jun 25 '14 at 13:52
  • I'd expect 3.3V - maybe you have a damaged pin or the pin is used by something else. Try using a different pin. – Majenko Jun 25 '14 at 16:05
  • I did use a different pin which showed a voltage of 3.3V. But there was still nothing displayed on the screen. It appears the program was written for the BeagleBone, not the BeagleBone Black, but after checking the naming on the pins they are essentially the same. – John Barbour Jun 26 '14 at 13:11
  • Something must be different running this on BBB – John Barbour Jun 26 '14 at 13:11

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('');

Change the lcd.PIN_RESET = "P9_25"; to lcd.PIN_RESET = "P9_26"; in both software and hardware. The pin "P9_25" is used by the BBB for other purpose.

Regards, Abhishek.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.