Skip to content
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

SSD130x4WireSoftSpiTransport #551

Merged
merged 2 commits into from
Dec 13, 2022
Merged

Conversation

eh2k
Copy link
Contributor

@eh2k eh2k commented Dec 1, 2022

At the moment the hardware SPI2 on the Submodule does not seem to work properly. After some trial and error, using an OLED display via software spi is a viable alternative for me. The advantage is also that any gpio pins can be used. In contrast to spi_handle::BlockinTransmit no "ScopedIrqBlocker" is necessary.

@stephenhensley
Copy link
Collaborator

@eh2k thanks for the PR! This looks great.

Awesome that you included in an example as well!

The style-stuff can be fixed pretty easily with the fix style script if you have python and clang-format installed.
Otherwise, there's not a whole lot to fix by hand if you don't.
Let me know if you need any help with that.

What issues did you run into getting SPI2 to work on the Patch SM? Was a particular pin not functioning properly?

@GregBurns
Copy link
Contributor

GregBurns commented Dec 6, 2022 via email

@eh2k
Copy link
Contributor Author

eh2k commented Dec 6, 2022

@stephenhensley

My current issue/findings:

I have the SM rev 3, and with the current libDaisy and BOOT_SRAM the display stays black when I control it with the hardware SPI transport. I only got this to work with SpiHandle::Config::BaudPrescaler::PS_128 and if I used the ScopedIrqBlocker around the display.Update(). As far as I can remember, the ScopedIrqBlocker was only necessary when executing hw.StartAudio(). I also examined the whole thing with a LogicAnlyser and found that at the end the SPI sequence is somethig strange with the clock (at the end there is an unnecessary clock change).

image

I also noticed that the SPI ports D9, D8 are read by the ADC. I have removed these testwise from the ADC initialization (without success).
After some googling I found the stm32h7 errata, where it says that there are SPI problems at high clock rates. After further investigation I found out that the whole clock configuration in the System::Init() is skipped in the BOOT_SRAM case, or probably done in the bootloader (closed source).

Maybe there is still some other solution, but I thought that the SoftwareSPI implementation might be useful in general.

@GregBurns - Well - I recently started using the internal MidiUSBHandler - but i think it didn't work otherwise either.

@stephenhensley
Copy link
Collaborator

The soft transport looks good. So I'm going to merge it.

I've split out the notes about your issues with the hardware SPI to new issue #553

@stephenhensley stephenhensley merged commit 72f511a into electro-smith:master Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants