Skip to content

Commit

Permalink
Merge pull request #56 from vroland/v5
Browse files Browse the repository at this point in the history
V5
  • Loading branch information
vroland committed Jan 25, 2021
2 parents ddb2732 + 8914285 commit 322bcea
Show file tree
Hide file tree
Showing 37 changed files with 54,693 additions and 36,623 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "hardware/epaper-breakout/esp32-wrover-kicad"]
path = hardware/epaper-breakout/esp32-wrover-kicad
url = https://github.com/aliafshar/esp32-wrover-kicad
[submodule "hardware/epaper-breakout/tp4056"]
path = hardware/epaper-breakout/tp4056
url = https://github.com/alltheworld/tp4056/
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,29 @@ Ready-made DIY modules for this size and with 4bpp (16 Grayscale) color support

The EPDiy driver board targets multiple E-Paper displays. As the driving method for all matrix-based E-ink displays seems to be more or less the same, only the right connector and timings are needed. The EPDiy PCB v4 features a 33pin and a 39pin connector, which allow to drive the following display types: ED097OC4, ED060SC4, ED097TC2. With the upcoming revision v5, even more display types will be supported! For details, refer to the table below.

Revision 5 of the board is optimized for the use with LiPo batteries, featuring a LiPo charger and ultra-low deep sleep current.

Building It
-----------

If you want to build a board right now, there are two possible routes:
- Use the new v2 PCB (`hardware/epaper-breakout/gerbers_v4.zip`). This is a bit more fresh, but should work.

- Use the new v5 PCB (`hardware/epaper-breakout/gerbers_v5.zip`).
**So far, I only tested a prototype of it. The newest gerbers should work, but are untested!**
**If you have tested them, please let me know!**
The BOM is available at (`hardware/epaper-breakout/BOM.csv`).
Positioning files for SMT assembly are available at (`hardware/epaper-breakout/gerbers/epaper-breakout-top-pos.csv`).
Please double check the part positioning and Rotation with your assembly service!
More information on the order process and where to find parts is in the [documentation](https://epdiy.readthedocs.io/en/latest/getting_started.html#getting-your-board).

Make sure to select the `V5` board revision in `idf.py menuconfig` when building the examples.

- Use the old v4 PCB (`hardware/epaper-breakout/gerbers_v4.zip`). This is a bit more fresh, but should work.
The BOM is available at (`hardware/epaper-breakout/BOM.csv`).
Positioning files for SMT assembly are available at (`hardware/epaper-breakout/gerbers/epaper-breakout-top-pos.csv`).
Please double check the part positioning and Rotation with your assembly service!

Make sure to select the `V4` board revision in `idf.py menuconfig` when building the examples.
- Use the original v2 PCB (`hardware/epaper-breakout/gerbers_v2_rev0.zip`).
However, you might run into issue #3 with some selections of parts.

Make sure to select the `v2/v3` board revision in `idf.py menuconfig` when building the examples.

Gettings Started
----------------
Expand Down
3 changes: 3 additions & 0 deletions components/epd_driver/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ menu "E-Paper Driver"

config EPD_BOARD_REVISION_V4
bool "epdiy v4"

config EPD_BOARD_REVISION_V5
bool "epdiy v5"
endchoice
endmenu
25 changes: 25 additions & 0 deletions components/epd_driver/config_reg_v4.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include "ed097oc4.h"

typedef struct {
#if defined(CONFIG_EPD_BOARD_REVISION_V5)
bool power_enable : 1;
#else
bool power_disable : 1;
#endif
bool power_enable_vpos : 1;
bool power_enable_vneg : 1;
bool power_enable_gl : 1;
Expand All @@ -12,7 +16,11 @@ typedef struct {
} epd_config_register_t;

static void config_reg_init(epd_config_register_t *cfg) {
#if defined(CONFIG_EPD_BOARD_REVISION_V5)
cfg->power_enable = false;
#else
cfg->power_disable = true;
#endif
cfg->power_enable_vpos = false;
cfg->power_enable_vneg = false;
cfg->power_enable_gl = false;
Expand All @@ -39,14 +47,23 @@ static void IRAM_ATTR push_cfg(const epd_config_register_t *cfg) {
push_cfg_bit(cfg->power_enable_gl);
push_cfg_bit(cfg->power_enable_vneg);
push_cfg_bit(cfg->power_enable_vpos);
#if defined(CONFIG_EPD_BOARD_REVISION_V5)
push_cfg_bit(cfg->power_enable);
#else
push_cfg_bit(cfg->power_disable);
#endif

fast_gpio_set_hi(CFG_STR);
fast_gpio_set_lo(CFG_STR);
}

static void cfg_poweron(epd_config_register_t *cfg) {
// POWERON
#if defined(CONFIG_EPD_BOARD_REVISION_V5)
cfg->power_enable = true;
#else
cfg->power_disable = false;
#endif
push_cfg(cfg);
busy_delay(100 * 240);
cfg->power_enable_gl = true;
Expand Down Expand Up @@ -77,7 +94,15 @@ static void cfg_poweroff(epd_config_register_t *cfg) {
cfg->power_enable_vneg = false;
push_cfg(cfg);
busy_delay(100 * 240);

cfg->ep_stv = false;
cfg->ep_output_enable = false;
cfg->ep_mode = false;
#if defined(CONFIG_EPD_BOARD_REVISION_V5)
cfg->power_enable = false;
#else
cfg->power_disable = true;
#endif
push_cfg(cfg);
// END POWEROFF
}
17 changes: 10 additions & 7 deletions components/epd_driver/ed097oc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if defined(CONFIG_EPD_BOARD_REVISION_V2_V3) || defined(CONFIG_EPD_BOARD_REVISION_LILYGO_T5_47)
#include "config_reg_v2.h"
#else
#if defined(CONFIG_EPD_BOARD_REVISION_V4)
#if defined(CONFIG_EPD_BOARD_REVISION_V4) || defined(CONFIG_EPD_BOARD_REVISION_V5)
#include "config_reg_v4.h"
#else
#error "unknown revision"
Expand Down Expand Up @@ -36,25 +36,28 @@ void IRAM_ATTR busy_delay(uint32_t cycles) {
}

inline static void IRAM_ATTR push_cfg_bit(bool bit) {
fast_gpio_set_lo(CFG_CLK);
gpio_set_level(CFG_CLK, 0);
if (bit) {
fast_gpio_set_hi(CFG_DATA);
gpio_set_level(CFG_DATA, 1);
} else {
fast_gpio_set_lo(CFG_DATA);
gpio_set_level(CFG_DATA, 0);
}
fast_gpio_set_hi(CFG_CLK);
gpio_set_level(CFG_CLK, 1);
}

void epd_base_init(uint32_t epd_row_width) {

config_reg_init(&config_reg);

/* Power Control Output/Off */
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[CFG_DATA], PIN_FUNC_GPIO);
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[CFG_CLK], PIN_FUNC_GPIO);
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[CFG_STR], PIN_FUNC_GPIO);
gpio_set_direction(CFG_DATA, GPIO_MODE_OUTPUT);
gpio_set_direction(CFG_CLK, GPIO_MODE_OUTPUT);
gpio_set_direction(CFG_STR, GPIO_MODE_OUTPUT);

#if defined(CONFIG_EPD_BOARD_REVISION_V4)
#if defined(CONFIG_EPD_BOARD_REVISION_V4) || defined(CONFIG_EPD_BOARD_REVISION_V5)
// use latch pin as GPIO
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[V4_LATCH_ENABLE], PIN_FUNC_GPIO);
ESP_ERROR_CHECK(gpio_set_direction(V4_LATCH_ENABLE, GPIO_MODE_OUTPUT));
Expand Down Expand Up @@ -124,7 +127,7 @@ static inline void latch_row() {
config_reg.ep_latch_enable = false;
push_cfg(&config_reg);
#else
#if defined(CONFIG_EPD_BOARD_REVISION_V4)
#if defined(CONFIG_EPD_BOARD_REVISION_V4) || defined(CONFIG_EPD_BOARD_REVISION_V5)
fast_gpio_set_hi(V4_LATCH_ENABLE);
fast_gpio_set_lo(V4_LATCH_ENABLE);
#else
Expand Down
49 changes: 38 additions & 11 deletions components/epd_driver/ed097oc4.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@

#include "driver/gpio.h"

#if defined(CONFIG_EPD_BOARD_REVISION_V5)
#define D7 GPIO_NUM_23
#define D6 GPIO_NUM_22
#define D5 GPIO_NUM_21
#define D4 GPIO_NUM_19
#define D3 GPIO_NUM_18
#define D2 GPIO_NUM_5
#define D1 GPIO_NUM_4
#define D0 GPIO_NUM_25


/* Config Reggister Control */
#define CFG_DATA GPIO_NUM_23
#define CFG_CLK GPIO_NUM_18
#if defined(CONFIG_EPD_BOARD_REVISION_LILYGO_T5_47)
#define CFG_DATA GPIO_NUM_33
#define CFG_CLK GPIO_NUM_32
#define CFG_STR GPIO_NUM_0
#else
#define CFG_STR GPIO_NUM_19
#endif

/* Control Lines */
#define CKV GPIO_NUM_25
#define STH GPIO_NUM_26
#define CKV GPIO_NUM_26
#define STH GPIO_NUM_27

#define V4_LATCH_ENABLE GPIO_NUM_15

#define V4_LATCH_ENABLE GPIO_NUM_2

/* Edges */
#define CKH GPIO_NUM_5
#define CKH GPIO_NUM_15

/* Data Lines */
#else
#define D7 GPIO_NUM_22
#define D6 GPIO_NUM_21
#define D5 GPIO_NUM_27
Expand All @@ -34,6 +42,25 @@
#define D1 GPIO_NUM_32
#define D0 GPIO_NUM_33

#define CFG_DATA GPIO_NUM_23
#define CFG_CLK GPIO_NUM_18
#if defined(CONFIG_EPD_BOARD_REVISION_LILYGO_T5_47)
#define CFG_STR GPIO_NUM_0
#else
#define CFG_STR GPIO_NUM_19
#endif

/* Control Lines */
#define CKV GPIO_NUM_25
#define STH GPIO_NUM_26

#define V4_LATCH_ENABLE GPIO_NUM_15

/* Edges */
#define CKH GPIO_NUM_5

#endif

void epd_base_init(uint32_t epd_row_width);
void epd_base_deinit();
void epd_poweron();
Expand Down
5 changes: 5 additions & 0 deletions components/epd_driver/epd_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "freertos/semphr.h"
#include "freertos/task.h"
#include "xtensa/core-macros.h"
#include "driver/rtc_io.h"
#include <string.h>

#define RTOS_ERROR_CHECK(x) \
Expand Down Expand Up @@ -943,5 +944,9 @@ void epd_init() {
}

void epd_deinit(){
#if defined(CONFIG_EPD_BOARD_REVISION_V5)
gpio_reset_pin(CKH);
rtc_gpio_isolate(CKH);
#endif
epd_base_deinit();
}
2 changes: 1 addition & 1 deletion components/epd_driver/i2s_data_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void i2s_deinit() {
free(i2s_state.buf_b);
free((void *)i2s_state.dma_desc_a);
free((void *)i2s_state.dma_desc_b);

rtc_clk_apll_enable(0, 0, 0, 8, 0);
periph_module_disable(PERIPH_I2S1_MODULE);
}
43 changes: 25 additions & 18 deletions hardware/epaper-breakout/BOM.csv
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
Comment,Designator,Footprint,LCSC Part #
"SW2 Push button switch, generic, two pins",BOOT1,SW_TS-1187A,C318884
4.7uF Polarized capacitor,"C1,C6",C_0603_1608Metric,C19666
10uF Unpolarized capacitor,"C2,C3,C17",C_0603_1608Metric,C19702
0.1uF Unpolarized capacitor,"C4,C7,C13,C14",C_0603_1608Metric,C14663
10uF Unpolarized capacitor,"C2,C3,C21",C_0603_1608Metric,C19702
0.1uF Unpolarized capacitor,"C4,C7,C15,C16,C22,C23",C_0603_1608Metric,C14663
4.7pF Unpolarized capacitor,"C5,C10",C_0603_1608Metric,C1669
100pF Unpolarized capacitor,"C8,C11",C_0603_1608Metric,C14858
1uF Unpolarized capacitor,"C9,C12,C18,C19,C20",C_0603_1608Metric,C15849
1nF Unpolarized capacitor,"C15,C16",C_0603_1608Metric, C1588
1uF Unpolarized capacitor,"C9,C12,C13,C14,C18,C19,C20",C_0603_1608Metric,C15849
100uF Unpolarized capacitor,C17,CP_EIA-3528-15_AVX-H, C16133
"MBR0540 40V 0.5A Schottky Power Rectifier Diode, SOD-123","D1,D2,D3,D4,D5,D6",D_SOD-123,C21353
MountingHole Mounting Hole without connection,"H1,H2,H3",MountingHole_2.2mm_M2,
"XF2M-3315-1A ED097OC4 9.7"" epaper display",J1,CONN_ED097OC4,C231420
"1N5817 20V 1A Schottky Barrier Rectifier Diode, DO-41","D7,D10",D_SOD-123, C8598
LED GREEN Light emitting diode,D8,LED_0805_2012Metric,C2297
LED RED Light emitting diode,D9,LED_0805_2012Metric, C84256
"XF2M-3315-1A",J1,CONN_ED097OC4,C231420
C10418 USB Micro Type B connector,J2,USB_Micro-B_A01SB141B1-067,C10418
"Conn_02x06_Counter_Clockwise Generic connector, double row, 02x06, counter clockwise pin numbering scheme (similar to DIP packge numbering), script generated (kicad-library-utils/schlib/autogen/connector/)",J3,PinHeader_2x06_P2.54mm_Vertical,
ED060SC4 ,J4,HRS_FH26W-39S-0.3SHW(60),C92280
22uH Inductor,"L1,L2,L3,L4",L_6.3x6.3_H3,C326331
"IRLML6402 -3.7A Id, -20V Vds, 65mOhm Rds, P-Channel HEXFET Power MOSFET, SOT-23",Q1,SOT-23,C2593
10k Resistor,"R2,R3,R8,R9,R10,R13,R15,R19",R_0805_2012Metric,C17414
HRS_FH26W-39S-0.3SHW(60) ,J4,HRS_FH26W-39S-0.3SHW(60),C92280
22uH Inductor,"L1,L2,L3,L4",L_6.3x6.3_H3, C206321
"AO3401A -4.0A Id, -30V Vds, P-Channel MOSFET, SOT-23","Q1,Q2,Q5",SOT-23, C15127
"MMBT3904 0.2A Ic, 40V Vce, Small Signal NPN Transistor, SOT-23","Q3,Q4,Q6",SOT-23,C20526
10k Resistor,"R1,R10,R11,R13,R15,R19,R20",R_0805_2012Metric,C17414
100k Resistor,R2,R_0805_2012Metric,C17407
1k Resistor,"R3,R8,R12",R_0805_2012Metric,C17513
2M Resistor,R4,R_0805_2012Metric,C26112
120k Resistor,R5,R_0805_2012Metric, C17436
560k Resistor,R6,R_0805_2012Metric,C15785
39k Resistor,R7,R_0805_2012Metric,C25826
470 Resistor,"R11,R12",R_0805_2012Metric,C17710
6.8k Resistor,R9,R_0805_2012Metric, C17772
390k Resistor,R14,R_0805_2012Metric,C17656
300k Resistor,R16,R_0805_2012Metric, C17616
27k Resistor,R17,R_0805_2012Metric,C17593
110k Resistor,R18,R_0805_2012Metric,C17422
"SW1 Push button switch, generic, two pins",RESET1,SW_TS-1187A,C318884
680k Resistor,R21,R_0805_2012Metric, C17797
150k Resistor,R22,R_0805_2012Metric, C17470
200k Potentiometer,RV1,EVM3ESX50B25,C11958
TestPoint_Probe test point (alternative probe-style design),TP1,TestPoint_Pad_D1.0mm,
"MCP1700-3302E_SOT23 250mA Low Quiscent Current LDO, 3.3V output, SOT-23",U1,SOT-23,C39051
"LT1945 Dual Micropower DC/DC Converter with Positive and Negative Outputs, MSOP-10","U2,U3",MSOP-10_3x3mm_P0.5mm,
ESP32-WROVER ,U5,ESP32-WROVER,C503591
"CH330N USB serial converter, UART, SOIC-8",U6,SOIC-8_3.9x4.9mm_P1.27mm,C108996
"XC6206PxxxMR Positive 60-250mA Low Dropout Regulator, Fixed Output, SOT-23",U4,SOT-23, C5446
ESP32-WROVER-B ,U5,ESP32-WROVER-B, C503591
X05A20H34G,U6,X05A20H34G,
"LM358 Low-Power, Dual Operational Amplifiers, DIP-8/SOIC-8/TO-99-8",U7,SOP-8_3.76x4.96mm_P1.27mm,C7950
74HC4094-normal ,U8,SOIC-16_3.9x9.9mm_P1.27mm,C5651
74HC4094 ,U8,SOIC-16_3.9x9.9mm_P1.27mm,C5651
"MCP9700AT-ETT Low power, analog thermistor temperature sensor, ±2C accuracy, -40C to +125C, in SOT-23-3",U9,SOT-23,C127949
ED060SC7 ,U10,AXT334124,
TP4056 ,U11,TP4056_SOP-8-PP, C16581
"CH340C USB serial converter, UART, SOIC-16",U12,SOIC-16_3.9x9.9mm_P1.27mm, C84681

0 comments on commit 322bcea

Please sign in to comment.