Hi Sir/Mdm,
I want to use 1.54 inch e-paper module from waveshare with nRF52840 dongle with Zephyr RTOS.
I have read the documentation from Zephyr about the display and noticed that the display can only be used with a board that provides a configuration for Arduino connectors and defines node aliases for SPI and GPIO interfaces (see Shields for more details).
However, based on the board configuration code provided by zephyr in nrf52840dongle_nrf52840.dts, it doesn't come with a configuration for Arduino connectors like in nrf52840dk_nrf52840.dts did.
Hence, I added
arduino_header: connector {
compatible = "arduino-header-r3";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio0 3 0>, /* A0 */
<1 0 &gpio0 4 0>, /* A1 */
<2 0 &gpio0 28 0>, /* A2 */
<3 0 &gpio0 29 0>, /* A3 */
<4 0 &gpio0 30 0>, /* A4 */
<5 0 &gpio0 31 0>, /* A5 */
<6 0 &gpio1 1 0>, /* D0 */
<7 0 &gpio1 2 0>, /* D1 */
<8 0 &gpio1 3 0>, /* D2 */
<9 0 &gpio1 4 0>, /* D3 */
<10 0 &gpio1 5 0>, /* D4 */
<11 0 &gpio1 6 0>, /* D5 */
<12 0 &gpio1 7 0>, /* D6 */
<13 0 &gpio1 8 0>, /* D7 */
<14 0 &gpio1 10 0>, /* D8 */
<15 0 &gpio1 11 0>, /* D9 */
<16 0 &gpio1 12 0>, /* D10 */
<17 0 &gpio1 13 0>, /* D11 */
<18 0 &gpio1 14 0>, /* D12 */
<19 0 &gpio1 15 0>, /* D13 */
<20 0 &gpio0 26 0>, /* D14 */
<21 0 &gpio0 27 0>; /* D15 */
};
and arduino_spi: &spi3 {
status = "okay";
sck-pin = <47>;
miso-pin = <46>;
mosi-pin = <45>;
cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
};
into the nrf52840dongle_nrf52840.dts file and it does build without giving an error.
These are the pins config in the waveshare_epaper.overlay file I'm supposed to connect:
E-paper display Pins |
Arduino Pins |
nRF52840 dongle Pins |
Vcc |
5V |
5V |
GND |
GND |
GND |
DIN |
D11 |
P1.13 |
CLK |
D13 |
P1.15 |
CS |
D10 |
P1.12 |
DC |
D9 |
P1.11 |
RST |
D8 |
P1.10 |
BUSY |
D7 |
P1.08 |
The problem I'm facing is there are only a few pins on the dongle that I could connect them directly, hence I'll need to do some configuration.
These are the steps that I tried and it didn't work out:
1. I tried matching the original pins (which directly copied from nrf52840dk.overlay) without changing anything but it didn't work because there are only 5 matching pins (including analog pins).
2. I tried with the analog pins cuz there are there are P0.29 and P0.31 match with the dongle and still couldn't work.
3. I tried changing the gpio to match with the pins on the dongle as the example below which I changed the D7, D9 and D10 to P0.xx and it still didn't display anything.
arduino_header: connector {
compatible = "arduino-header-r3";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio0 3 0>, /* A0 */
<1 0 &gpio0 4 0>, /* A1 */
<2 0 &gpio0 28 0>, /* A2 */
<3 0 &gpio0 29 0>, /* A3 */
<4 0 &gpio0 30 0>, /* A4 */
<5 0 &gpio0 31 0>, /* A5 */
<6 0 &gpio1 1 0>, /* D0 */
<7 0 &gpio1 2 0>, /* D1 */
<8 0 &gpio1 3 0>, /* D2 */
<9 0 &gpio1 4 0>, /* D3 */
<10 0 &gpio1 5 0>, /* D4 */
<11 0 &gpio1 6 0>, /* D5 */
<12 0 &gpio1 7 0>, /* D6 */
<13 0 &gpio0 24 0>, /* D7 */
<14 0 &gpio1 10 0>, /* D8 */
<15 0 &gpio0 20 0>, /* D9 */
<16 0 &gpio0 22 0>, /* D10 */
<17 0 &gpio1 13 0>, /* D11 */
<18 0 &gpio1 14 0>, /* D12 */
<19 0 &gpio1 15 0>, /* D13 */
<20 0 &gpio0 26 0>, /* D14 */
<21 0 &gpio0 27 0>; /* D15 */
};
4. I tried changing to different digital pins in the epaper.overlay file and didn't manage to get it work as well.
5. I also couldn't find much things related to arduino pins configuration for the nRF52840 dongle.
This is my github repo for the current project.
Please do provide suggestions and solutions that I can try out for this.
Thanks and Regards,
Xian Cong.