Using Teensy 4 with E-paper Display

lankanmon

Member
I am working on getting an e-paper display from waveshare (4.2 inch Black, White, Red) working with my teensy. This one: https://www.waveshare.com/4.2inch-e-Paper-Module-B.htm

They support Arduino and they supply code in a gitub repo here: https://github.com/waveshare/e-Paper/tree/master/Arduino/epd4in2bc

I got the Arduino code and wired up the display to by teensy as defined in the code, but I can't seem to get the display to turn on/display anything.

My wiring images: https://imgur.com/a/fyyBxGv

I am not sure where to start with debugging.

Should this work out of the box with Teensy, are there any changes I need to do to the Arduino code to make this work?

Thanks!
 
This webpage mentions a newer version of the display (V2) which requires an update to the driver. Do you have a V2 board (with V2 sticker on the back)?

Also, can you provide a photo of the back of your epaper display, showing the wiring?

Pete
 
This webpage mentions a newer version of the display (V2) which requires an update to the driver. Do you have a V2 board (with V2 sticker on the back)?

No, I haven't tried the v2 one. I used this because I thought the C at the end was designated for the color version. I will try the other one and report back shortly.



Here: [url]https://imgur.com/pocbYux
 
@el_supremo I tested the V2 code and there is more progress, I am getting stuff on the screen now, but it is still looking broken:
Here are two pictures. Note, there was some flashing of the screen before it settles on these views. The first one occurred on the first upload and the second after I tried uploading a few more times ( I tried putting the other code one more time before).

First View: https://imgur.com/KKPd3PC

Second View: https://imgur.com/fYUqaAX

Update: It does not seem to change at all from the second view.
 
Last edited:
Another update. I was not able to get that second view to change after some debugging, so as a sanity check to make sure the display was not broken, I plugged in an Arduino Uno that I had on hand and pushed the v2 code. It started working immediately.

Here it is working with the Arduino Uno:
https://imgur.com/A2mippA

So, whatever is happening is occurring on the Teensy. Is there something in that code that is not supported by the Teensy 4.0, but is supported by the Arduino Uno?
 
I think the problem may be that the T4.0 is much faster than the UNO and can, for example, set the DC pin high or low and send the first byte of command or data much faster than the epaper controller is expecting.

Other than the horrible noise on the display, I think it is working. It shows a solid red circle, which is the last thing that the example draws. The circle is on top of a filled black rectangle which is drawn just before the circle but it is obviously noisy.

I'll try to have a look at this sometime today. Meanwhile, which of the example sketches are you using? epd4in2b_V2.ino ?
If so, in epd4in2b_V2.cpp there's this code:
Code:
void Epd::SendCommand(unsigned char command) {
    DigitalWrite(dc_pin, LOW);
    SpiTransfer(command);
}

/**
 *  @brief: basic function for sending data
 */
void Epd::SendData(unsigned char data) {
    DigitalWrite(dc_pin, HIGH);
    SpiTransfer(data);
}
Add a delay immediately after the digitalWrite and see if that helps.
Code:
void Epd::SendCommand(unsigned char command) {
    DigitalWrite(dc_pin, LOW);
    delayMicroseconds(5);
    SpiTransfer(command);
}

/**
 *  @brief: basic function for sending data
 */
void Epd::SendData(unsigned char data) {
    DigitalWrite(dc_pin, HIGH);
    delayMicroseconds(5);
    SpiTransfer(data);
}
Five microseconds is probably way too much but it's a starting point. If it does help, reduce it to one microsecond and try again.

Pete
 
Yes, it was the v2 file that was able to produce a change at all in the above test. However, I just tried using your suggestion and I am still not seeing any changes on the screen when attached to the Teensy. The display does work.
 
Did you ever make any progress with the epaper display? I am currently in a very similar situation with the B&W version of the 4.2" display and a teensy 2.0. The demo program works perfectly fine with the arduino uno but nothing happens with the teensy.
 
Back
Top