mcauser / micropython-waveshare-epaper

MicroPython drivers for Waveshare e-paper modules
MIT License
321 stars 81 forks source link

Wemos D1 mini throwing epc1=0x40100002 Fatal exception upon initializing epaper1in54 #25

Closed lasithf closed 1 year ago

lasithf commented 1 year ago

Hello,

I am using Wemos D1 mini with Waveshare 1.54" epaper (Rev 2.1) 4-line SPI with following configurations.

Wemos D1 mini running MicroPython v1.19.1 1.54" e-paper wiring:

DIN      -D7   (Pin 13)
CLK      -D5   (Pin 14) 
CS        -D8   (Pin 15)
DC       -D3   (Pin 0)
RST      -D4   (Pin 2)
BUSY   -D2    (Pin 4)
GND    -GND
VCC     -3V3

Below is the code I am running on the device (test.py):

import epaper1in54
from machine import SPI, Pin
import framebuf

spi = SPI(1, baudrate=20000000, polarity=0, phase=0)
cs = Pin(15)
dc = Pin(0)
rst = Pin(2, Pin.OUT)
busy = Pin(4, Pin.OUT)

e = epaper1in54.EPD(spi, cs, dc, rst, busy)
e.init()

boot.py code.

import esp
esp.osdebug(None)

import gc
gc.collect()

main.py code

import test

However after powering up the device via USB it continuously print garbage characters on to the terminal. I cannot break (Ctrl+C) in to REPL while these prints are going on. It seems like the device is really busy.

Just want to understand what I am doing wrong here? Appreciate your help.

lasithf commented 1 year ago

More information on the garbage characters. I checked with baud 74880 upon resetting Wemode D1 mini and below messages now appear on the terminal continuously.

epc1=0x40100002, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):

This appears only when the test.py is called. Otherwise the Wemos is running without any issues.

lasithf commented 1 year ago

This was able to resolve by pull down D8 (SS/CS) with a 3.3K and pull up D4 (RST) with a 1K.