-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Initial working m5stack cardputer setup #8816
Conversation
I'm going to put this into draft mode so we don't merge it too soon. Take it out of draft mode when you're ready -- thanks. |
I have updated the pins file per your request. I'm still trying some things out, so I think leaving this in draft for another week is probably a good idea, thanks! |
@jamesjnadeau Here are the lines for microphone support in pins.c |
add microphone pins, thanks @panguin6010
@dhalbert I'm moving this out of draft as it's confirmed working by others and we've sussed out the peripherals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two tweaks since the cardputer comes with a StampS3. Not a core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cardputer has two different SPI bus: one for the display and one for the SD card.
I think it's best to configure both busses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The I2C bus exposed in pins.c is not defined anyware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The display initializations can be sped up.
In addition it's possible to set the color word endianing in the display and avoid to swap the word in software
Co-authored-by: Scott Shawcroft <[email protected]>
Co-authored-by: CDarius <[email protected]>
Co-authored-by: CDarius <[email protected]>
Co-authored-by: CDarius <[email protected]>
Co-authored-by: CDarius <[email protected]>
Co-authored-by: CDarius <[email protected]>
Co-authored-by: CDarius <[email protected]>
thanks @CDarius Co-authored-by: CDarius <[email protected]>
Co-authored-by: CDarius <[email protected]>
…thon into m5stack_cardputer
Unfortunately, I pulled the trigger on purchasing my Cardputer from the manufacturer rather than a local distributor without thinking first so I won't have one to test for a month or two. I suspect that I2S Audio out will work without your PDMIn updates though. I assume you're trying to get the Mic to work using the PDMIn module? import synthio
import audiobusio
import board
import time
i2s = audiobusio.I2SOut(board.I2S_BIT_CLOCK, board.I2S_WORD_SELECT, board.I2S_DATA)
synth = synthio.Synthesizer(sample_rate=22050)
e = synthio.Envelope(attack_time=0,decay_time=0,release_time=0,attack_level=.3,sustain_level=.3)
note = synthio.Note(frequency=261.626,envelope=e)
i2s.play(synth)
synth.press(note)
time.sleep(1)
synth.release(note) |
Thanks for the updates! Getting close! |
correct @RetiredWizard, I got the mic/speaker crossed. Thanks for the reply and let me know if you give it a try. |
@jamesjnadeau I happen to try to connect a PDM mic to a Feather S3 today, only to discover PDMIn hadn't been implemented yet. As I started looking into doing so, I was directed to this PR and to your fork of CP. Is there anything I can do to help get PDM working? |
@jamesjnadeau may I ask how to get this flashed onto the device? I found your post here: https://www.reddit.com/r/CardPuter/comments/19f7num/how_to_start_writing_your_own_codefirmware/kjhv4dg/ that mentions loading the bootloader using the instructions from the UM Feather S3 page. I followed those instructions and I think that I loaded the combined.bin bootloader successfully. Once that is loaded the device connects as a serial port but I don't seem to ever get it connected as a BOOT drive for copying UF2 file. Perhaps I am misunderstanding and it's not that type of bootloader? In any case Once I've followed the instructions to load the bootloader, and successfully built circuitpython from this branch, what do I need to do next in order to flash the resulting build? |
I managed to get Circuitpython loaded. For anyone that might find this page in the future before there are steps published elsewhere these are the steps I took, I'm not entirely certain if they were all 100% necessary, but I got there in the end.
|
@foopod There is an unresolved question about the SPI buses: #8816 (comment) |
I made a new branch from this and pushed in that requested change to expose the second SPI bus, that branch is here: https://github.com/FoamyGuy/circuitpython/tree/m5stack_cardputer_multi_spi with the specific change being inside pins here: https://github.com/FoamyGuy/circuitpython/blob/m5stack_cardputer_multi_spi/ports/espressif/boards/m5stack_cardputer/pins.c#L69-L70 with that change both SPI busses are listed on the board object:
I did a very brief test of this using this code to mount the SDCard and print the contents of a test file:
The pre-existing display initialization inside of board init is using the TFT_SPI and that appears to still function normally as well so far as I can tell. If that is the only remaining change needed for this I could commit it here potentially, or make a new PR from my branch that has that commit on it. Let me know if there is anything else I can help to get this moved along, I'd love to see support for it added more officially than the PR. |
You can add https://github.com/jamesjnadeau/circuitpython as a remote in a clone of your own repo, pull it, and check out that remote's |
Thank you! I've added that commit now. |
Any comments from anyone before we merge this? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the requested changes are now in. Any further fixes could be PR'd.
No description provided.