Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 13 of 13

Thread: Is there a simple E-paper driver for Teensy LC?

  1. #1
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,253

    Question Is there a simple E-paper driver for Teensy LC?

    I bought one of the SPI e-paper displays (specifically the Waveshare 200x200 display):


    I found a full featured driver for it at:


    And it seems to work well on my Teensy 3.2 (and 3.5 if memory serves), but for a particular project I am using a Teensy LC to light up a wooden bowtie with neopixel rings. However, the bowtie is just barely bigger than the Teensy, so I can't use the 3.2 and the LC prop shield to translate the Teensy pin voltages to VIN (or use an external chip to do the same thing). I used the LC to drive the LEDs. The LC is great for this. I only have 12-32 rings, so the LC has enough space for the neopixels.

    I want to measure how long the bowtie will last on the battery. In the past when I would use the 3.2 for similar projects, I would write into EEPROM memory every 15 minutes or so, and when the Teensy rebooted, it would print the previous runtime to the USB monitor. I could run it until the battery drained, and then boot it again under USB to see how long it lasted.

    As I understand it, it is not a good idea to write a lot to the LC simulated EEPROM, so I figured get an epaper display and just print the uptime every 5-10 minutes The problem is the GxEPD driver is too big for the LC. Does anybody know of a slimmer e-paper driver that would work on the LC? I don't care about graphics, fonts, etc. I just want some simple text.

    I've figured there are other ways to do this (make a USB cable that doesn't include the power line; write serial to a second Teensy that is running the display, and powered via USB; use an i2c or spi display that has separate power provided, but does use common grounds, etc.), but I was curious if there was a simpler driver for the epaper display.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,556

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,253
    I actually have that display as well somewhere in my work bench (the key is finding it once again). Thanks for the reminder.

    I would need to plug the display into a breadboard, and reroute A3 and change the source. The display uses 11, 13, A0-A3. A3 is the CS pin. As I look at the source, it is all software SPI. The example also uses the String library. Yuck and yuck. But it is fairly simple, and just does text with no graphics. The screen on that 202x112 display takes 2,912 bytes (my 200x200 display would take 5,000 bytes which I didn't consider the LC when I bought it).

    <edit>
    The updated library is at https://github.com/jarek319/EPD215, and it does allow overriding the CS/DC/RS/BS pins. It does use hardware SPI, but the begin transaction call has been commented out. The quote example uses 27,720 bytes of flash (43%) and 5,636 (68%) of DRAM. This library does include the Adafruit_GFX library.
    Last edited by MichaelMeissner; 03-18-2018 at 01:38 PM.

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,253
    As a followup, the crowd supply teensy e-paper supply kit and the Pervasive Displays E2215CS062 (originally this was an option with the e-paper kit, but now you have to buy it separately) works with a Teensy LC. I have enough space that I can load all of the neopixel libraries that I use along with e-paper library.



    My particular sketch uses:
    Code:
    Sketch uses 27164 bytes (42%) of program storage space. Maximum is 63488 bytes.
    Global variables use 5800 bytes (70%) of dynamic memory, leaving 2392 bytes for local variables. Maximum is 8192 bytes.
    Unfortunately, it looks like the E2215CS062 isn't currently available. There is a Waveshare 1.52" 152x152 display that has a similar memory size for the screen:
    Last edited by MichaelMeissner; 03-18-2018 at 09:31 PM.

  5. #5
    Michael. I have that same 1.54 inch display, actually both versions, B/W and B/W/R. However, I am having trouble getting it to work with the Teensy 3.2 which I wish to use for a meter project. I am using the GxEPD library as well. Would you mind posting how you connected the display to your teensy and any changes or tweaks you might have made? I did get the displays to work with nano, ESP8266 and ESP32 WROOM micro-controllers for other projects but I wish to use the Teensy 3.2 for this more complicated one.

    Thank you in advance.

    Mark

  6. #6
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    107
    Hallo Michael,
    You may want have a look at the attached code. It runs on a TeensyLC. Not much RAM left, but at least you can display a scalable font.

    Code:
    Sketch uses 26392 bytes (41%) of program storage space. Maximum is 63488 bytes.
    Global variables use 7004 bytes (85%) of dynamic memory, leaving 1188 bytes for local variables. Maximum is 8192 bytes.
    I took the code from Waveshare and copied some font code from Shabaz123. For references, see the top of the INO file.
    For a different display, you may want to edit the DisplayInit function.

    Regards,
    Paul

    Click image for larger version. 

Name:	TeensyLC plus 2.9in EPD.jpg 
Views:	105 
Size:	66.6 KB 
ID:	13701
    Attached Files Attached Files

  7. #7
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,253
    Thanks. I didn't notice this earlier.

  8. #8
    Member
    Join Date
    Sep 2015
    Location
    Mechelen, Belgium
    Posts
    21
    Hello Paul,

    thanks for your code. I can confirm this code also works unchanged on a Teensy 3.6 running @240MHz.
    I also have the 1.54" e-ink screen from Waveshare and later this week I will try to get this running.

    groeten, bedankt, Otto

  9. #9
    Hello Hersoft,

    My reaction is a little bit late of the last comment, but did you managed to run the code for the 1.54 e-ink screen from Waveshare? Could you share your code?
    This would be very nice. Thank you.

  10. #10
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,253
    FWIW, Adafruit has recently come out with a series of e-ink displays that have a flash memory controller along with the display. This means you don't have to dedicate a large chunk of SRAM to buffering the screen.



    Note, the mount for the feather wing displays is opposite to the way I mount the teensy feather adapter -- I usually mount the adapter on top of the Teensy and have the traditional Teensy pins underneath and female headers for the feather wings on top.

    I've tried the tri-color displays, and they are really slow (about 15 seconds to update the display).

    Obviously having the screen buffer in a separate flash memory region means you will have to first read from the flash memory before updating the screen, but you don't have to have the 5-7K screen buffer in your local memory (which as I said in the first post is a problem with the LC). However, the displays are slow enough that I doubt the extra time to read from the flash memory will be that noticeable.
    Last edited by MichaelMeissner; 04-28-2019 at 02:35 PM.

  11. #11
    Hi MichaelMeissner,

    Thank you for your fast feedback. But I like this little peace of code, because I can use it without some big change if I use an other board.
    The problem is, that I don't know how to rotate a picture.
    I would like to know, how I can rotate the ep_write_text() function from the example of PaulS.
    I try to extract this information from Adafruit GFX function, but I couldn't really find it.
    I see only two solution: Change the function or rotate the full picture.

    I know that I have a vector of some picture which will be build up in 200/8(xvalue) * 200 (yvalue) but I didn't find the right way to rotate it...

  12. #12
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,253
    Unfortunately, I haven't delved into the graphics part. I tend to mostly just spit out text.

  13. #13
    Member
    Join Date
    Sep 2015
    Location
    Mechelen, Belgium
    Posts
    21
    Hello,

    hmmm, I just started again with this display (1.54" 200x200 dots)
    Have been playing with the demo code from the library on Teensy 3.6 together with Ultimate GPS and Lipo batt etc.
    Yes, for me it is not easy to find the function description from the library, English is not my native language and this must be true also for the person who wrote the library I guess.

    I'll keep working @ it but might be tempted to switch over to a Waveshare 1.54 color Oled if I do not get it to work, however sad this would be because of power drain.

    Regards, Otto

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •