E-paper and Teensy

Status
Not open for further replies.
Thank you for this heads up. I just went and reviewed it. As soon as I can get home tonight I am ordering the parts and pcb. This could be just the thing I need for several projects. I had been watching ePaper displays some months ago and then they seemed to go dormant and retailers stopped carrying the displays. Too expensive at that time perhaps. In any case I am in for one or more project iterations.
 
Yes, looks very interesting. Unfortunately, I could'nt find a distributor in Germany or China and digikey wants 18€ for shipping. I don't want to pay 18€ for shipping a 14€ thing, so I'm out...
 
Perhaps we might recall the good old german "Sammelbestellung" (bulk order of multiple customers) and lower the shipping costs a little ... :)
 
My OSHPark pcb order is on its way and I just received the parts from DigiKey. BUT, Digikey is out of several parts including the 34 position connector from Hirose Electric. It is back ordered until the end of December. I have no experience with this type of connector and have not found any other North American supplier yet. Nor have I found a suitable substitute.

Here is the DigiKey entry for the connector: http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=208129819&uq=636107316268610197

Still looking to complete parts package before my boards arrive.
 
I tried using an e-paper display from Seed studio for a bicycle dash display. The visibly is excellent and power draw small.

The problem is that rapidly changing values on the display mess it up. The contrast deteriorates. Tried many different ways but the only way to fix was to clear the complete display and start over. This takes about a full second and involves writing an inverse value to the display.

Maybe this display will have the problem solved.

edited: maybe not, on page 20 of link it says display refresh 2 seconds.
http://www.pervasivedisplays.com/LiteratureRetrieve.aspx?ID=232067

Probably still a nice display for the right app. I just looked at my disconnected board sitting in a box for over a year and it still crisply displays the last image I put on it.
 
Last edited:
Indeed - the great contrast as I read is from actual black particles suspended in the display. To write the display the black particles must be driven UP for black or DOWN for white. This is not fast - but is why the display is low power as the particles are static once moved and also why the black is real black as the particles are non-reflective.

Without a proper clearing ( not fast ) - then the particles may become lost.
 
I have a E-BOOK Reader with such a display. It is very smart with updates, and most of the time just makes the black pixels white. But from time to time, after a few pages, it clears the whole screen. An other ways seems to be, to use GUI-elements that only need white->black switching, not black->white. Usually, when the element is not needed anymore, the whole screen is cleared again.

Nice is, the screen needs NO power, and even shows the cover of the book when the reader is switched off.
 
Last edited:
Indeed my newest Kindle gives the option of full redraw on each page turn or you can turn pages faster but risk 'artifacts' with no screen refresh.
 
I haven't put together the control board even though I have my PCBS. I have purchased Embedded Adventures' e-paper display with break out board: http://www.embeddedadventures.com/epaper_display_EPD-200200B.html and will try that out.

Also, I have purchased the 4.3 inch e-paper board that is SPI driven: http://www.ebay.com/itm/4-3inch-e-P...758939?hash=item3aa74a2b1b:g:JJ0AAOSwstxVKMn5

Will report on results when I have them.

Matadormac

I am very intrigued by the ePaper display. I wonder why these are so low in the resolution/DPI department, given that they are monochrome?

Also, this disclaimer on the page is rather ominous:

Limited by the hardware processing, it usually takes 1.5s to refresh each single frame image, therefore, this e-Paper is NOT capable of playing animations.
 
Last edited:
My quick research says that one of the reasons for the slow refresh rate is that actual carbon particles have to "float" to the surface of the e-paper. Also, going white from black may be faster. Some people only change the characters that need changing and not the whole screen. There seem to be a variety of reasons for the slow refresh. In my case, I am not doing animations and the sampling rate of my sensor system is 3.5 seconds and could be 5 seconds so the slow refresh rate I am hoping will not be that much of an issue.

Matadormac
 
Well, I have had my Waveshare 4.3 inch e-paper display for 24 hours now and have had it working (on Arduino Uno) for the past two hours with different sketches to learn the commands and capabilities. Given the lazy refresh I am very impressed with the contrast and definition of the display. I can live with the slow refresh.
BUT, I can't get this display to work with my various Teensy 3.2 units.

At this time I am stumped. I have tried connecting to the Teensy digital pins 0 (for Rx) and 1 (for Tx) with no luck and have then tried digital pins 11 for Dout and 12 for Din.

Any help would be greatly appreciated (as usual, thank you very much to the forum for all the help in the past too!).

I have used the same pinouts as required by the manual and which worked on the Uno. These are:
View attachment 8778

Here is one of the sketches which worked fine on the Uno:
Code:
/*********************************************************************************************************
*
* File                : Arduino-epd
* Hardware Environment: 
* Build Environment   : Arduino
* Version             : V1.6.1
* By                  : WaveShare
*
*                                  (c) Copyright 2005-2015, WaveShare
*                                       http://www.waveshare.net
*                                       http://www.waveshare.com
*                                          All Rights Reserved
*
*********************************************************************************************************/
#include <epd.h>



const int led = 13;                           //user led


/*******************************************************************************
* Function Name  : void base_draw(void)
* Description    :
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void base_draw(void)
{
  int i, j;

  /*
  draw pixel
  */
  epd_clear();
  for (j = 0; j < 600; j += 50)
  {
    for (i = 0; i < 800; i += 50)
    {
      epd_draw_pixel(i, j);
      epd_draw_pixel(i, j + 1);
      epd_draw_pixel(i + 1, j);
      epd_draw_pixel(i + 1, j + 1);
    }
  }
  epd_udpate();
  delay(3000);

  /*
  draw line
  */
  epd_clear();
  for (i = 0; i < 800; i += 100)
  {
    epd_draw_line(0, 0, i, 599);
    epd_draw_line(799, 0, i, 599);
  }
  epd_udpate();
  delay(3000);

  /*
  fill rect
  */
  epd_clear();
  epd_set_color(BLACK, WHITE);
  epd_fill_rect(10, 10, 100, 100);

  epd_set_color(DARK_GRAY, WHITE);
  epd_fill_rect(110, 10, 200, 100);

  epd_set_color(GRAY, WHITE);
  epd_fill_rect(210, 10, 300, 100);

  epd_udpate();
  delay(3000);

  /*
  draw circle
  */
  epd_set_color(BLACK, WHITE);
  epd_clear();
  for (i = 0; i < 300; i += 40)
  {
    epd_draw_circle(399, 299, i);
  }
  epd_udpate();
  delay(3000);

  /*
  fill circle
  */
  epd_clear();
  for (j = 0; j < 6; j++)
  {
    for (i = 0; i < 8; i++)
    {
      epd_fill_circle(50 + i * 100, 50 + j * 100, 50);
    }
  }
  epd_udpate();
  delay(3000);

  /*
  draw triangle
  */
  epd_clear();
  for (i = 1; i < 5; i++)
  {
    epd_draw_triangle(399, 249 - i * 50, 349 - i * 50, 349 + i * 50, 449 + i * 50, 349 + i * 50);
  }
  epd_udpate();
  delay(3000);
}



void draw_text_demo(void)
{
  char buff[] = {'G', 'B', 'K', '3', '2', ':', ' ', 0xc4, 0xe3, 0xba, 0xc3, 0xca, 0xc0, 0xbd, 0xe7, 0};
  epd_set_color(BLACK, WHITE);
  epd_clear();
  epd_set_ch_font(GBK32);
  epd_set_en_font(ASCII32);
  epd_disp_string(buff, 0, 50);
  epd_disp_string("ASCII32: Hello, World!", 0, 300);

  epd_set_ch_font(GBK48);
  epd_set_en_font(ASCII48);
  buff[3] = '4';
  buff[4] = '8';
  epd_disp_string(buff, 0, 100);
  epd_disp_string("ASCII48: Hello, World!", 0, 350);

  epd_set_ch_font(GBK64);
  epd_set_en_font(ASCII64);
  buff[3] = '6';
  buff[4] = '4';
  epd_disp_string(buff, 0, 160);
  epd_disp_string("ASCII64: Hello, World!", 0, 450);


  epd_udpate();
  delay(3000);
}

void draw_bitmap_demo(void)
{
  epd_clear();
  epd_disp_bitmap("PIC4.BMP", 0, 0);
  epd_udpate();
  delay(5000);

  epd_clear();
  epd_disp_bitmap("PIC2.BMP", 0, 100);
  epd_disp_bitmap("PIC3.BMP", 400, 100);
  epd_udpate();
  delay(5000);

  epd_clear();
  epd_disp_bitmap("PIC7.BMP", 0, 0);
  epd_udpate();
}




void setup(void)
{
  /*
  user led init
  */
  pinMode(led, OUTPUT);
  digitalWrite(led, LOW);
  
  epd_init();
  epd_wakeup();
  epd_set_memory(MEM_NAND);
}

void loop(void)
{
  char flag = 0;
  
  base_draw();

  /*
  Draw text demo
  */
  draw_text_demo();

  /*
  Draw bitmap
  */
  draw_bitmap_demo();

  epd_enter_stopmode();
  while (1)
  {
    if(flag)
    {
      flag = 0;
      digitalWrite(led, LOW);
    }
    else
    {
      flag = 1;
      digitalWrite(led, HIGH);
    }
    delay(500);
  }
}

Here is the epd.h and epd.cpp files needed to run on the Arduino platform:
View attachment epd.cpp, View attachment epd.h
 

Attachments

  • displayconnections.JPG
    displayconnections.JPG
    48.9 KB · Views: 225
The problem is within epd.cpp. It's sending to "Serial".

Code:
static void _putchars(const unsigned char * ptr, int n)
{
        int i, x;

        for(i = 0; i < n; i++)
        {
            x = ptr[i];
                Serial.write(x);
        }
}

On Arduino Uno, there's only one Serial.

On Teensy, there are several. Serial communicates to the USB serial. Serial1 communicates with pins 0 & 1. When you run this, it's sending the data to your PC, not the display. If you select the correct port in Serial > Ports, and then open Arduino's serial monitor, you should see the data which was meant to be sent to the display.

To make this work on Teensy, you need to edit all the "Serial" to "Serial1" within that code.
 
Hello Paul. Thank you for your help and your very clear explanation. Although I had actually tried this sometime in the early morning today an other issue prevented the sketch from working at that time.

I went back to the original files from Waveshare and did this minor edit as you described and all my e-paper sketches now not only compile but they run as they should.

Thank you.

Mark MacKenzie
Alcalde, NM
 
Dear Mark,

is it possible with this display to add single pixels to the display without a complete refresh? I would like to use the display to monitor the change of temperature, humidity and pollution. So I have to add a few pixels for example every five minutes to draw three graphs.

Best

Peter
 
Peter,
As noted in reply #7 above fast screen refresh is not a feature but five minutes would be ideal, just refresh the whole screen. Since white to black changes don't mess thing up, you could keep track of whats changing but why bother? The refresh is pretty obvious so its not like you wouldn't know whats going on. I could try posting a video of my experiences if anyone is interested.

later
 
I don't know about the low levels of the epaper interface, but in general I believe the interface is to rewrite the entire screen at once. I don't think there is a general interface to rewrite part of the screen.

This means you will need to buffer the entire screen either in SDRAM or in flash memory/sd card (or possibly re-generate the screen image each time you write to it). You would update the buffer to reflect what you want on the screen, and then do the command to send everything to the screen.

This means you are limited to the sizes of epaper displays you can use. Unfortunately, when I last checked, that display wasn't available any longer. You can get other e-paper displays as long as you adjust the height and width. However, most of the displays use too much memory for the Teensy 3.2.

Adafruit came out with an interesting variant, where in addition to the display (152x152 with 2 colors which needs a 5.7K buffer), they provide an 8K flash memory on the breakout board, and they have a library that as your program updates the screen, it updates the flash memory, and then when you update the screen, it reads the flash memory and writes to the screen. This would allow you to use an epaper display on a low memory system (like the LC) or without using most of the SDRAM on a Teensy 3.2. I bought one last week, but I haven't had time to play with it. I suspect the Adafruit_GFX in the Teensy release may need to be replaced with the Adafruit version in case the new library needs new GFX support:

Here is a library that supports various sized epaper displays:
 
Last edited:
Thank you for your answer. A video would be great!

Peter
It's a little slower than I remembered. Note the contrast changing by the Gear number after I stop pedaling. Pressing the button includes a 3 second delay for a serial terminal connection not shown. I think the actual paper good refresh was about 2 seconds. This was ~4 years ago and with a mega although the display was the limiting device. I don't think you would have these issues drawing a few pixels every five minutes.
 
I have found this interesting video. I have ordered the same display shown in the video yesterday. It does not have that great resolution of the display Mark used, but I will give it a try. The advantage is that Ben Krasnow has programmed a library that supports partial refresh and works obviously with a teensy. If I get it to work, I will post my result. If not I will ask more questions. :)
 
Hi Frickelpiet,
You may want to have a look at my post earlier this year.
By using a 2 different LUTs you can use partial refresh on the epaper display to show a clock without refreshing the whole display every second.

Paul
 
Hey guys, so i came accross this thread looking for help. i also tried using the GxEPD library but was not working with the LC (memory issues) so im trying any other library. i saw the post from Ben Krasnow but i cannot get his demo to work on my setup. I have the waveshare 4.2 inch e-paper display. using a teensy LC

pins are as followed:
BUSY>7
RST>8
DC>9
CS>10
CLK>13
DIN>11
GND>GND next to pin 0
3.3V>3.3V next to pin 23

I am new to this kind of thing and any help would be great.

When i upload his code to my teensy LC it somehow breaks it. doesnt show up on my com ports or serial or anything. i have to press the program button and re-upload another sketch like blink to regain access. very strange. anyone having these problems?

Thanks.

PS: i had to remove his butterfly and applied science logos as it was saying there wasnt enough ram.
 
Status
Not open for further replies.
Back
Top