sensorium / Mozzi

sound synthesis library for Arduino

Home Page:https://sensorium.github.io/Mozzi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Port for PY32f002 - PY32F003 -PY32F030?

NoNamedCat opened this issue · comments

Dear MOZZI Team,

I hope this message finds all of you well. Firstly, I want to extend my appreciation for the fantastic work you've done with MOZZI – it's truly a remarkable library that has greatly enriched the world of microcontroller-based audio synthesis.

I'm reaching out to inquire about the possibility of porting MOZZI to a specific microcontroller, the pi32f003. As we aim to leverage MOZZI's capabilities for our project on this platform, having compatibility with the PY32f002 - PY32F003 -PY32F030 ($0.1 M0+ microcontroller) would be immensely beneficial.

Understanding the complexities involved in such endeavors, I want to express my willingness to contribute in any capacity possible – whether it be through testing, documentation, or even code contributions.

I had never heard of this MCU so far. Taking a quick glance, it looks pretty interesting, but it does not really seem to have made its way to Europe, so far, much less in the form of a tinker friend board (with USB). Also, the documentation I could find seems to be mostly in Chinese.

I would guess it should be possible to port, but that makes it kind of hard to start. Anyway, if you want to take a look, the main requisites will be:

  • An arduino core must exist (seems to be the case)
  • Some way to run a timer at or above audio rate (should certainly be possible, but figuring out how exactly this is done is often one of the hardest steps in porting)
  • Some PWM capable pins, or alternatively some buffered hardware device (and I2S or Serial port) to write PDM coded data to.

By now there are quite a few examples to look at for porting to a new platform. If you want to take a look, I strongly suggest to use the devel/Mozzi2 branch. The first file to look at will be internal/MozziGuts_impl_template.hpp, which documents the basic steps involved. We'll be happy to give you a hand if/when questions arise.

Indeed, the pi32f003 is a relatively lesser-known MCU, especially in certain regions. However, it's gaining traction due to its intriguing features and capabilities.

Here are some resources that might be helpful:

Documentation: py32f003 MCU Documentation
Arduino Port: Arduino-PY32 GitHub Repository
Usage of Timers and PWM: Examples for TIM on PY32F0xx MCU

Additionally, your suggestion to use the devel/Mozzi2 branch and the guidance on where to start within the codebase are invaluable. I certainly refer to the provided resources and documentation as we delve into this project.

Your offer of assistance is greatly appreciated, and I may indeed reach out with questions as I progress in this task.