Epaper display driver on a Xenon [Solved with 0.9.0]

I am developing a lightweight driver for an 2.13" e-paper display. I have got an initial code working fine on a Photon (0.8.0-RC.14) and I am now trying to get it to work on a Xenon. I get nothing out when running the code built for 0.8.0-RC.27 on the Xenon. Any reasons why this might be? I have assumed this is down to the SPI or perhaps timing.

In the begin method I call SPI.begin(); then to write commands or data to the display controller the following;

// private method - write command via SPI to display
void GDEH0213B72::Epaper_Write_Command(const uint8_t command)
{
    pinResetFast(_CS_Pin);                   
    pinResetFast(_DC_Pin);   // command write
    SPI.beginTransaction(__SPISettings(4*MHZ, MSBFIRST, SPI_MODE0));
    SPI.transfer(command);
    SPI.endTransaction();
    pinSetFast(_CS_Pin);
}
// private method - write data via SPI to display
void GDEH0213B72::Epaper_Write_Data(const uint8_t data)
{
    pinResetFast(_CS_Pin);                   
    pinSetFast(_DC_Pin);   // command write
    SPI.beginTransaction(__SPISettings(4*MHZ, MSBFIRST, SPI_MODE0));
    SPI.transfer(data);
    SPI.endTransaction();
    pinSetFast(_CS_Pin);
}

[0.9.0 released] I just tried this again with the exact same application code built on 0.9.0 and it works - so clearly 0.8.0-RC.27 SPI wasn’t working correctly!

3 Likes

Thank you for posting your solution!

Yup, there was an issue with SPI - especially when calling SPI.begin() more than once.

Although that issue is still open it was fixed in 0.9.0-rc.1
Another issue that affected some SPI devices (e.g. SDFat) was about the “fuzzy” timing and other quirks which was addressed with 0.9.0 too.

3 Likes