Cannot get my e paper to work

Posted on
  • Hi guys,
    I just got my e paper from http://www.smart-prototyping.com/E-ink-E­-paper-new-version-display-module-3.3V-2­.04-inch-177x72.html?search=e%20paper

    And I've been following this great tutorial http://www.espruino.com/SSD1606

    When I plug in the Pico, the blue LED on the epaper lights up, so there are connection.

    Only problem is, that when I save this to the pico and also write save(); nothing happens on the display

    // per default turn display off
    digitalWrite(A7, LOW);
    
    // run following code onInit
    E.on('init', function() {
      // SPI configuration
      var spi = SPI1;
      spi.setup({
        mosi: B5,
        sck:  B3
      });
      // create display instance
      var display = require('SSD1606').connect({
        displayType: 'GDE021A1',
        spi        : spi,
        cs1Pin     : B6,
        dcPin      : B7,
        resetPin   : A8,
        busyPin    : A5,
        bs1Pin     : A6, // optional, but if not provided, you need to set the correct SPI mode 4-wire by yourself
        powerPin   : A7  // optional, just do not use the on() or off() function if you do not provide it
      });
      // activate the power to run the display, just a comfort function, 
      // you can control the power by yourself as well
      display.on();
      display.hwReset(function(){
        display.init(
          function(err){
            // (optional) fill the internal buffer for all pixels with color white, 
            // without this the default color will be black
            display.g.clear(0xFF);
            // not optional - rotate the display x and y coordinates 90 degrees to the right
            display.g.setRotation(1);
            // from here it shows the normal usage
            // set color black for subsequent uses
            display.g.setColor(0x00);
            // set fontsize, see Graphics and Fonts modules for further options
            display.g.setFontVector(20);
            display.g.drawString('Hello World!', 22, 22);
            // from here it shows the needed part
            // (needed) copy internal buffer to display buffer
            display.g.flip();
            // run the display update
            display.refreshScreen(function(err){
              // do whatever you like here, e.g. turn it off when the update is done
              // again just a comfort function
              display.off();
            });
          },
          // clearScreenColor is optional, but prevents e-paper ghosting
          // shadow of an image may be visible after refreshing (only) parts of the screen
          { clearScreenColor: 0x00 }
        );
      });
    });
    

    And I get this in the IDE

    >save()
    =undefined
    Erasing Flash.....
    Writing.............
    Compressed 81600 bytes to 10374
    Checking...
    Done!
    

    1 Attachment

    • IMG_0446.jpg
  • Are you sure you've connected it exactly as it said on that SSD1606 page?

    It's suggesting that you could connect the 3.3v power pin to A7 - so if that's the case then when you plug it in the Blue LED shouldn't be lit.

    I'm sure you could power it directly with 3.3v, but I wonder if the code is expecting the display to be in a certain state after it's powered on, so doesn't cope well if the display is permanently powered?

  • Gordon, I tried to unplug the 3.3v > A7 but without any luck, nothing happend.

    I would imagine, that when I run this methode

    // per default turn display off
    digitalWrite(A7, LOW);
    

    then I turn off the display, but this is not the case.

    Any other suggestions ... please:)?

  • Just to check - are you using an up to date firmware on the Pico?

    I guess it's possible that the display is being powered through the other data pins. You could use digitalWrite to set them all to 0 - but I'm surprised that wasn't an issue originally.

    Actually @MichaelPralow is the guy that wrote this module - I wonder if he has any ideas?

  • I would try to separate pulling the resources from the connect... Some device modules have an initialization sequence built into the connect function to put them into the state to be used. Some of that state may be volatile and get lost when powering the device down. The lost part has to be be redone when re-powered (is so with ave() with modules where .connect() initializes device (such as RFID reader MFRC522)).

    I do not know puck well enough yet nor the e-paper display, but for any other Espruino board noty just I put the connect into the onInit(), which is called after the save() - and on every power on cycle ...or even into application controlled function to power up and connect. This other conversation may give you some insight combined with what you find on debugging your issue, which also will show the various differences - if there even are - between behavior of puck vs the other Espruino boards. I know though very well that since that conversation Promise(s) has been implemented which gives a nice relieve for coding... but the hardware 'challenges'/devices' own life cycle still stand and have to be addressed.

  • Hi @allObject & @Gordon, thank you for your input, I found that there were an error in the mapping of the display in the code example:

    var display = require('SSD1606').connect({
        displayType: 'GDE021A1',
       spi        : spi,
          cs1Pin     : B6,
          dcPin      : B7,
          resetPin   : A5,
          busyPin    : A8,
          bs1Pin     : A6, 
          powerPin   : A7  
      });
    

    and when I added a simple digitalWrite in the init method, it actually worked.

  • Thanks - I'll update the docs!

  • sry i did only now see the question (is it possible to subscribe to specific topics here?)
    i will test it soon, but it should work out of the box

    can you point to the specific mapping problem?

  • Hello, I'm also trying this e paper display, after I send the demo code to pico, and run save(), the display doesn't work, and with some error:

    save()
    =undefined
    Erasing Flash.....
    Writing.............
    Compressed 81600 bytes to 10333
    Checking...
    Done!
    Uncaught Error: Invalid BPP
    at line 1 col 118
    ...Y,this.display.bpp,{msb:!0});b.clear=­function(a){(new Uint8A...
    in function "grfx" called from line 1 col 364
    ....powerPin;this.g=this.grfx();this.csb­TimeOut=a.clearScreenTi...
    in function "b" called from line 1 col 8
    new b(a)
    in function "connect" called from line 16 col 4
    });
    in function called from system

    here is the code

    // per default turn display off
    digitalWrite(A7, LOW);
    // run following code onInit
    E.on('init', function() {
      // SPI configuration
      var spi = SPI1;
      spi.setup({
        mosi: B5,
        sck:  B3
      });
      // create display instance
      var display = require('SSD1606').connect({
        displayType: 'GDE021A1',
         spi        : spi,
          cs1Pin     : B6,
          dcPin      : B7,
          resetPin   : A5,
          busyPin    : A8,
          bs1Pin     : A6,
          powerPin   : A7
      });
      // activate the power to run the display, just a comfort function, 
      // you can control the power by yourself as well
      display.on();
      display.hwReset(function(){
        display.init(
          function(err){
            // (optional) fill the internal buffer for all pixels with color white, 
            // without this the default color will be black
            display.g.clear(0xFF);
            // not optional - rotate the display x and y coordinates 90 degrees to the right
            display.g.setRotation(1);
            // from here it shows the normal usage
            // set color black for subsequent uses
            display.g.setColor(0x00);
            // set fontsize, see Graphics and Fonts modules for further options
            display.g.setFontVector(20);
            display.g.drawString('Hello World!', 22, 22);
            // from here it shows the needed part
            // (needed) copy internal buffer to display buffer
            display.g.flip();
            // run the display update
            display.refreshScreen(function(err){
              // do whatever you like here, e.g. turn it off when the update is done
              // again just a comfort function
              display.off();
            });
          },
          // clearScreenColor is optional, but prevents e-paper ghosting
          // shadow of an image may be visible after refreshing (only) parts of the screen
          { clearScreenColor: 0x00 }
        );
      });
    });
    

    My firmware got updated.

    Anyone can help? Please :)


    1 Attachment

    • espruino.png
  • Strange nobody reported this before, but it looks like a bug in the module itself. I've just fixed it I think (but I have nothing to test with!).

    Please can you upload again and see if that fixes it?

  • Hello Gordon, Thanks a lot! The ink can work now. But I still have an issue there. Only half of the display is working, the other part cannot display correctly. Could you please help?

    The code is exactly the example code from https://www.espruino.com/SSD1606
    Here is the picture for your reference:


    1 Attachment

    • espruino1.png
  • So this is the whole right-hand side of the display? Do you have a link to where you bought the display from?

    Also, if you change the code that draws to Graphics, is the top left corner aligned properly?

  • Hi Gorden, the e-ink display is from https://www.smart-prototyping.com/E-ink-­E-paper-new-version-display-module-3.3V-­2.04-inch-177x72.html
    I tried to use g.drawCircle() to display some circle, the result is fine.

            display.g.drawCircle(100,40,30);
             display.g.drawCircle(40,40,30);
            display.g.drawCircle(140,40,30);
    

    1 Attachment

    • espruino2.png
  • Ok, so that sounds like it all seems to be working? Or there's some issue drawing text?

    What if you remove setFontVector - which will use the bitmap font... Do you have issues drawing text with that?

  • g.drawString() still has issue, I removed setFontVector(), the text still can not display on the right side of display. but the g.drawCircle() function works well.
    When I changed the g.setRotation() from 1 to 0, the whole display is working, but text is 90 degree rotated.

     function(err){
            // (optional) fill the internal buffer for all pixels with color white,
            // without this the default color will be black
            display.g.clear(0xFF);
            // not optional - rotate the display x and y coordinates 90 degrees to the right
            display.g.setRotation(0);
            // from here it shows the normal usage
            // set color black for subsequent uses
            display.g.setColor(0x00);
            // set fontsize, see Graphics and Fonts modules for further options
            display.g.setFontVector(12);
            display.g.drawString('Hello World!', 0, 10);
            display.g.drawString('Hello World!', 0, 50);
             display.g.drawString('Hello World!', 0, 100);
             display.g.drawString('Hello World!', 0, 140);
            display.g.drawCircle(40,40,30);
             display.g.drawCircle(40,100,30);
            display.g.drawCircle(40,140,30);
    

    1 Attachment

    • resruino3.png
  • Ok, thanks - I found out what the problem is - it's a firmware problem when writing to displays that are higher than they are wide and rotated! I'll try and get a fix out for this now.

  • Ok, if you flash a 'cutting-edge' firmware from http://www.espruino.com/binaries/travis/­7b70d0ee960d9ae14ccb082bf007c7b9693b4ddd­ (copy the link to espruino_1v93_pico_1r3.bin and paste it into the flasher).

    Then this should be fixed. It'll be in the proper 1v94 release as well, but it could be a while before that gets released.

  • Yes! It is working! Thanks a lot! Looking forward 1v94!


    1 Attachment

    • espruino4.png
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Cannot get my e paper to work

Posted by Avatar for user71789 @user71789

Actions