-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PaPiRus HAT Pinout / Arduino connection #187
Comments
SPI CE0 (BCM GPIO 8, pin 24) is used as the chip select for the SPI interface of the EPD COG(Chip-On-Glass). |
Thank you for your reply! Currently, I'm trying to connect the Display to an Arduino UNO using the Repaper/gratis repo mentioned in the Project description. According to this https://github.com/repaper/gratis/blob/master/doc/extension_board.md#pin-assignment, the already mentionet pinout (https://pinout.xyz/pinout/papirus_hat) and your hint I came up with this pin-connections:
Do you know whether this will work? If so, do you know which Demo-Code I could use from the RePaper-Repo? Thank you very much :) |
Agree with most of it. As you probably know the Arduino UNO uses 5V logic. The display only tolerated 3.3V logic. Regarding the sketches. Suggest to start with demo in Sketches/demo. |
Thank you for your reply. I was able to clear the screen and reading the temperature and clock👍! But displaying stuff seems to be a Problem :(. I'm using an 2.7" Display - and it seems that the UNO does not have enough SRAM for generating a buffer of this size. Next step: Connecting it to an ESP8266 using the Arduino Libraries and disable the WiFi-functionality for low power consumption :). |
Okay, I was able to connect it with an ESP32. But out of the blue - the Display claims that it's broken. Do you have an idea what this could cause? On an RPi the displays works perfectly... |
@Donderda No, not directly. The SPI transactions in the begin() function (where the breakage detection is located) for Arduino and Raspberry Pi look identical. |
Thank you for your reply. What makes me wonder is the fact that COG detection above those lines seem to work correctly. The last time it worked I had to change the static void SPI_on() {
SPI.end();
pinMode(SPI_cs, OUTPUT);
SPI.begin(SPI_clk, SPI_miso, SPI_mosi, SPI_cs);
SPI_put(SPI_cs, 0x00);
SPI_put(SPI_cs, 0x00);
Delay_us(10);
} static void SPI_put(uint8_t cs_pin, uint8_t c) {
ESP_LOGI("SPI_out", "%x", c);
SPI.beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE0)); // added
digitalWrite(cs_pin, LOW);
SPI.transfer(c);
digitalWrite(cs_pin, HIGH);
SPI.endTransaction(); // added
} My static uint8_t SPI_read(uint8_t cs_pin, const uint8_t *buffer,
uint16_t length) {
// CS low
digitalWrite(cs_pin, LOW);
//uint8_t rbuffer[4];
uint8_t result = 0;
// send all data
for (uint16_t i = 0; i < length; ++i) {
SPI.beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE0));
result = SPI.transfer(*buffer++);
ESP_LOGI("SPI_read", "%x", result);
/* Commented out. It isn't use anyway..
if (i < 4) {
rbuffer[i] = result;
}
*/
SPI.endTransaction();
}
// CS high
digitalWrite(cs_pin, HIGH);
return result;
} Here are some more debug infomartion I'm printing:
And here is the corresponding snippet from my // wait for COG to become ready
while (HIGH == digitalRead(this->EPD_Pin_BUSY)) {
Delay_us(10);
}
// read the COG ID
ESP_LOGI("SPI_read", "PRE SPI-READ COG");
int cog_id = SPI_read(this->EPD_Pin_EPD_CS, CU8(0x71, 0x00), 2);
cog_id = SPI_read(this->EPD_Pin_EPD_CS, CU8(0x71, 0x00), 2);
if (0x02 != (0x0f & cog_id)) {
this->status = EPD_UNSUPPORTED_COG;
this->power_off();
ESP_LOGE("EPaperPervasiv", "UNSUPPORTED COG");
return;
}
ESP_LOGI("SPI_read", "POST SPI-READ COG");
// Disable OE
SPI_send(this->EPD_Pin_EPD_CS, CU8(0x70, 0x02), 2);
SPI_send(this->EPD_Pin_EPD_CS, CU8(0x72, 0x40), 2);
// check breakage
ESP_LOGI("SPI_read", "PRE SPI-READ breakage");
SPI_send(this->EPD_Pin_EPD_CS, CU8(0x70, 0x0f), 2);
int broken_panel = SPI_read(this->EPD_Pin_EPD_CS, CU8(0x73, 0x00), 2);
ESP_LOGI("SPI_read", "POST SPI-READ breakage");
if (0x00 == (0x80 & broken_panel)) {
this->status = EPD_PANEL_BROKEN;
this->power_off();
ESP_LOGE("EPaperPervasiv", "EPD_PANEL_BROKEN: %x", broken_panel);
return;
}
Serial.println("AFTER EPD_PANEL_BROKEN CHECK"); Maybe @mrwastl could help? He worked on some ESP32 stuff work the repaper/gratis repository my work is based on...? |
@Donderda I assume your SPI_send calls SPI_put twice in code like |
@tvoverbeek: THANK YOU! I read the docs the whole day, dived really deep into the docs. But I overread this small detail. You saved me. 💋 Soon I will link an ESP32 example here (as soon as my source code is cleaned up 😇 ) |
Hey @Donderda, I was wondering if you ever got to clean that code up? Or if you mind posting it as is. I'm trying to hook up the HAT to ESP32, and having some code examples would be awesome! Vielen Dank! |
Hi Ivan, sure. I will have a look at it later and link you to a repo :-)
Written with two thumbs on my mobile device...
… Am 09.09.2020 um 11:10 schrieb Ivan Kasatenko ***@***.***>:
Hey @Donderda, I was wondering if you ever got to clean that code up? Or if you mind posting it as is. I'm trying to hook up the HAT to ESP32, and having some code examples would be awesome! Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hey @Donderda, would be great if you could provide it here as well :-D |
Hello @Donderda... I''m trying to use papirus zero with ESP32... Is your repo public? Thanks! |
If I remember correctly, I changed the functions
It's been a long time. Please let me know if this changes fix them. |
Here's a repo of the project I used the display for: https://github.com/Donderda/doorsign/ Feel free to check the code. It's not well documented, but maybe it helps @rlaltrello |
Hi everyone,
I found this webpage: https://pinout.xyz/pinout/papirus_hat where I was able to determine which pins are used for what. Can anyone tell me what CS0 and CS1 are used for? Which one is for FLASH_CS and which one for EPD_CS?
Thank you for your help :)
The text was updated successfully, but these errors were encountered: