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!