-
Notifications
You must be signed in to change notification settings - Fork 140
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
3.7in Display Problems #68
Comments
Copied from #26
Not yet.
#35 is is a red/black/white display so it is slightly different. Since your 3in7 b/w display seems to have some gray tones you need to define a new color type in color.rs similar to what is defined in their wiki: https://www.waveshare.com/wiki/3.7inch_e-Paper_HAT So while finishing this I saw you already added a new comment :-D
If you click on ressources you can find the specifications. (e.g. Command table starting from page 14 onwards https://www.waveshare.com/w/upload/7/71/3.7inch_e-Paper_Specification.pdf) And just feel free to make a WIP-PR and asks questions if you are stuck anywhere. |
To me it looks like you might use the wrong color type/wrong amount of bits per pixel. Have you uploaded your changes on github somewhere? If yes I could take a look and maybe help you. Waveshare has two different init functions for when using the grayscale or just b/w-color: Maybe applying this already resolves the issue? |
I've followed waveshare examples when implementing initialization/display sequences. There's something I've missed indeed, since waveshare samples work just fine with 3.7. |
Here's how I'm testing that PR on a NRF52 #![no_main]
#![no_std]
use nrf52_air_quality as _;
use embedded_hal::blocking::delay::DelayMs;
use defmt::info;
use nrf52840_hal::{
self as hal,
gpio::{p0::Parts as P0Parts, p1::Parts as P1Parts, Level},
prelude::*,
spim::{self, Spim},
Timer,
};
use epd_waveshare::{
epd3in7::*,
graphics::{Display},
prelude::*,
};
#[cortex_m_rt::entry]
fn main() -> ! {
// take() returns all peripherals, so we can access them
let board = hal::pac::Peripherals::take().unwrap();
// first peripheral: initialize timer
let mut timer = Timer::new(board.TIMER0);
let pins = P0Parts::new(board.P0);
let pins_1 = P1Parts::new(board.P1);
// instanciate SPI
// configure SPI
let din = pins_1.p1_01.into_push_pull_output(Level::Low).degrade();
let clk = pins_1.p1_02.into_push_pull_output(Level::Low).degrade();
let cs = pins_1.p1_03.into_push_pull_output(Level::Low);
let dc = pins_1.p1_04.into_push_pull_output(Level::Low);
let rst = pins_1.p1_05.into_push_pull_output(Level::Low);
let busy = pins_1.p1_06.into_floating_input();
let spi_pins = spim::Pins {
sck: clk,
miso: None,
mosi: Some(din),
};
let mut spi = Spim::new(board.SPIM3, spi_pins, spim::Frequency::K250, spim::MODE_0, 0);
let mut delay = Timer::new(board.TIMER1);
info!("Initializing EPD3in7");
let mut epd3in7 = EPD3in7::new(&mut spi, cs, busy, dc, rst, &mut delay).unwrap();
info!("EPD3in7 initialized - {:?}x{:?}", epd3in7.width(), epd3in7.height());
delay.delay_ms(4000u32);
info!("Clearing frame");
epd3in7.clear_frame(&mut spi).unwrap();
epd3in7.display_frame(&mut spi).unwrap();
nrf52_air_quality::exit()
} |
Ok. So I was using wrong LUT. For some reason RPi vs STM samples use different LUT for clearing the screen. |
Its great to hear that it is finally running! 🎉 I think we only had display until now who support only one of these modes at all. So we don't have an defined option on this already. Are two seperate inits (one additional one with only b/w) + two seperate graphics impls enough for it work? |
I've tested off of what's in main with displaying a line and text on the Raspberry Pi Pico WH and the B/W epd with the embassy HAL and it seems to be working without a hitch after figuring out the pin configuration. |
Some more testing as of semi-recently on the RP2040 W with the same setup, again just with Black/White display output. I'm noticing some problems with sleep and wake_up on release builds in my project. If you're interested in taking a look I have the code available here, not quite sure exactly where the problem lies https://github.com/avlec/homestead-client |
Should be resolved by #129 |
Hey @caemor @jamesmunns ,
Thanks for pointers. I'm still figuring it out. I have some weird issues when I try to test the 3.7 display using a NRF52 board. Things I've checked so far - initialization and display sequence match C/Python examples, tried different LUT provided in those examples, width/height match as well, rotation only affects that tiny area where "circle" is shown.
Have you encountered this kind of effect?
an attempt to draw a circle
I got my hands on RPi and tested waveshare Python snippet with the same display, everything worked as expected. Digging into my implementation.
Originally posted by @Alexx-G in #26 (comment)
The text was updated successfully, but these errors were encountered: