Hi to all, I'm new to the forum and I'm working on ESP32 for around one year.
In this days I started to work with the 2.9" EPaper Display (EPD) from Waveshare https://www.waveshare.com/wiki/2.9inch_ ... Module_(B), it's an interesting SPI Screen with 3 color (Black White and Red) after some Googling for a decent library for this 3 color EPD (I've find only the lobo library https://github.com/loboris/ESP32_ePaper_example but it isn't compatible with this EPD) I've ended up with writing my own library and publish it on GitHub.
After the headache with documentation of the EPD and the understanding of ESP32 SPI implementation on the Idf 3.1 I've 'mplemented all the code, but the CS PIN not work correctly it's working inverted (I know i can bypass the issue but this is a very strange thing).
So the problem is the CS PIN on ESP work inverted in every configuration it goes UP on SPI transmission.
My configuration is a DevKitC with these PINs configuration
EPD busy ---> GPIO_NUM_4
EPD reset -->GPIO_NUM_16
EPD DC ----->GPIO_NUM_17
EPD CS ----->GPIO_NUM_5
EPD MISO -->GPIO_NUM_23
EPD SCK --->GPIO_NUM_18
The complete code is on GitHub https://github.com/wperw/ESP32_SPIEPDLibrary
And yes comments for now are in italian (I'm italian too)
Attached the pulseview capture image, the capture file couldn't attached
Thank you so much for the help
-wperw
HELP with strange SPI issue
HELP with strange SPI issue
- Attachments
-
- second.PNG (31.86 KiB) Viewed 6375 times
-
- first.PNG (25.25 KiB) Viewed 6375 times
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: HELP with strange SPI issue
That's a strange thing... I see you're using the polling transmit function, does it also does that if you use the 'normal' SPI transmit function?
Re: HELP with strange SPI issue
Thanks for the fast response, I don't know, I'll try in this week to change from polling to interrupt.ESP_Sprite wrote:That's a strange thing... I see you're using the polling transmit function, does it also does that if you use the 'normal' SPI transmit function?
After the test I'll post the results.
Re: HELP with strange SPI issue
After a lot of time and hours at work I was able to find the time for modify the code as suggested.
The function object of the modify is the SPI_Writethat i report below
Old function:
New Function:
After the modify the problem wasn't change
The function object of the modify is the SPI_Writethat i report below
Old function:
Code: Select all
void IRAM_ATTR SPI_Write(uint8_t value, EPDDriverParams_t *driver)
{
esp_err_t ret;
spi_device_handle_t disp_spi = (spi_device_handle_t)driver->handle;
spi_transaction_t valueToSend =
{
.flags = SPI_TRANS_USE_TXDATA,
.cmd = 0,
.addr = 0,
.length = 8,
.rxlength = 0,
.user = NULL,
.tx_data = {value}
};
//ret = spi_device_transmit(disp_spi, &valueToSend);
if(ret != ESP_OK) printf("Fail to send SPI data to device with error %d\r\n", ret);
}
Code: Select all
void IRAM_ATTR SPI_Write(uint8_t value, EPDDriverParams_t *driver)
{
esp_err_t ret;
spi_device_handle_t disp_spi = (spi_device_handle_t)driver->handle;
spi_transaction_t valueToSend =
{
.flags = SPI_TRANS_USE_TXDATA,
.cmd = 0,
.addr = 0,
.length = 8,
.rxlength = 0,
.user = NULL,
.tx_data = {value}
};
//----START MODIFIED PART----//
ret = spi_device_queue_trans(disp_spi, &valueToSend, portMAX_DELAY);
if(ret != ESP_OK) printf("Fail to send SPI data to device with error %d\r\n", ret);
ret = spi_device_get_trans_result(disp_spi, &valueToSend, portMAX_DELAY);
if(ret != ESP_OK) printf("Fail to send SPI data to device with error %d\r\n", ret);
//----END MODIFIED PART----//
}
- Attachments
-
- after_Interrupt.PNG (18.82 KiB) Viewed 6287 times
Re: HELP with strange SPI issue
Problem persist, but I haven't find a solition. Can anyone help me?
Who is online
Users browsing this forum: No registered users and 155 guests