Raspberry Pi Pico

Two comments. First, I also hate Arduino for all but the simplest projects. I use PlatformIO https://platformio.org with VSCode. It supports the Arduino framework but with more advanced features such as library management, multiple source files, configuration per project, hardware debugging, etc. PlatformIO also supports the mbed framework with Teensy which provides a free RTOS, many library functions similar to Arduino, and drivers for common sensors and other hardware. If you don’t like platformio you can use mbed directly as a web-based graphical IDE or as a full command line toolset.

Second, while the Pico does not have dedicated I2S hardware, it does offer 4 programmable logic blocks called PIOs. Each PIO can be configured for fast IO operations such as I2S, driving neopixel LEDs, VGA or DVI display output, etc. The data is provided via DMA and the PIOs operate independently of the MCU and thus do not slow it down. many PIO blocks are available now unfortunately I2S is not one of them. But Pimorini has the PIM544 I2S DAC audio board available for pre-order so there will be an I2S PIO module available soon. The other available PIO modules can be viewed at https://github.com/raspberrypi/pico-examples#pio


Thanks for this tip and I got VSCode with PlatformIO working on Linux Mint and uploaded the Blink programt using Teensy Loader (for Linux).

However, the PlatformIO for Teensy3.0 is also Arduino based and I really want a blank C development environment where I have full control. I know it's a little crazy but I just dislike the feel of something being "beneath" my code.

For Teensy 2 (AVR) I merely used Notepad++ plus a Make file to do development.

I don't mind a library of some sort but I want to be in control of everything that runs on the microcontroller.
 
Last edited:
Also purchased a couple Raspberry Pi Pico's, but haven't tried them yet. Still need to solder some of the pinheaders.

But from the documentation it looks like programming in straight C, which I prefer. Best thing would be for them to throw in a couple of easy-to-use libraries for IO and the peripherals.
 
"...PlatformIO also supports the mbed framework with Teensy which provides a free RTOS, many library functions similar to Arduino,..."

Now THAT is interesting! I used MVSC for Marlin for 3D printers but I had no idea about a "free RTOS" and the "many library functions." Know where I can get more direct info? Is there a particular search phrase I could use in a search engine?
Note: I have forgotten now to use MVSC since the stroke. I mean, I can start it up and all but I can't remember how to start a new project or anything.
 
You have to ask yourself: "Do I really NEED a Real-Time OS?"

It adds a lot more complexity and overhead. Maybe you can fix it using interrupt based tasking?

I've seen a lot of RTOS'es lately, some of them even run on AVR (most only on ARM).
 
You cant beat an RTOS for interprocess communications, They're also handy for software interrupts (when available.) And when you have multiple cores, RTOS is usually a godsend.
 
Also purchased a couple Raspberry Pi Pico's, but haven't tried them yet. Still need to solder some of the pinheaders.

But from the documentation it looks like programming in straight C, which I prefer. Best thing would be for them to throw in a couple of easy-to-use libraries for IO and the peripherals.
And that is what they did :) See the C/C++ SDK link here: https://www.raspberrypi.org/documentation/rp2040/getting-started/
The Pi Foundation provides a C/C++ compiler, as well as a SDK that provides C/C++ libraries to access the hardware. Also a PIO block assembler.
 
"...PlatformIO also supports the mbed framework with Teensy which provides a free RTOS, many library functions similar to Arduino,..."

Now THAT is interesting! I used MVSC for Marlin for 3D printers but I had no idea about a "free RTOS" and the "many library functions." Know where I can get more direct info? Is there a particular search phrase I could use in a search engine?
Note: I have forgotten now to use MVSC since the stroke. I mean, I can start it up and all but I can't remember how to start a new project or anything.
You can get information about Teensy mbed support at https://os.mbed.com/platforms/Teensy-3-1/
As far as I know they currently only support the Teensy 3.X. Mbed also supports a wide range of other processors and boards
 
Is Micropython really future and next thing after the Arduino development environment? The Pi Pico is yet another cool little SoC but I don't see a game changing software development like like Arduino or RPi Linux. Maybe something built on OpenAMP or RPMsg over USB?

Teensy could be a serious security device with a SeL4 kernel.
https://sel4.systems/

--Mitch
 
Teensy would need to go with Rust if it wants to be taken seriously as far as security is concerned. But Rust has a much higher learning curve than C (I'm also dabbling into Rust).

Maybe in combination with TockOS?
 
First unofficial Arduino IDE support for the Pico: YouTube and on Github.
From the video:

Capture.PNG

@3m31s: "And as last time, the Teensy 4.1 is in a different class" :cool:

Paul
 
I am not promoting in any way the raspberry pico on this forum but I had a week off to experiment and started to port the MCUME project on that MCU.

Initial release at:

https://github.com/Jean-MarcHarvengt/MCUME/blob/master/README.md

We indeed are far from the Teensy 4.1 performance.
Amiga and Atari ST emulator or any 68000 based system will not be emulated on this system.
Even the C64 emulation is struggling without sound.
So far Atari2600, Coleco, Odyssey, Atari800, Zx81 and Spectrum are running.

SDK is not as great as I expected. Lot of examples but problematic when you start using all feature at same time.
I enjoyed using their VGA library however I had some strange behavior. SD card support on that device was hopefully addressed by another guy. Many DMA IRQ conflict from the various drivers. For sound I reduced it to PWM interrupt based audio.

I saw that Arduino SDK was now available for the pico but VGA was not yet part of it . Anyhow, I don't have more plan on the device.
It is cheap indeed. Probably the cheapest MCU that can deliver VGA with such quality for 4 euros.
I have seen other interesting emulators on the device but the code has to be tweaked for performances.
So nice and cheap device but Teensy MCU are indeed another category!

I like the drag and drop feature for flashing new executable!
 
I am not promoting in any way the raspberry pico on this forum but I had a week off to experiment and started to port the MCUME project on that MCU.

Initial release at:

https://github.com/Jean-MarcHarvengt/MCUME/blob/master/README.md

We indeed are far from the Teensy 4.1 performance.
Amiga and Atari ST emulator or any 68000 based system will not be emulated on this system.
Even the C64 emulation is struggling without sound.
So far Atari2600, Coleco, Odyssey, Atari800, Zx81 and Spectrum are running.

SDK is not as great as I expected. Lot of examples but problematic when you start using all feature at same time.
I enjoyed using their VGA library however I had some strange behavior. SD card support on that device was hopefully addressed by another guy. Many DMA IRQ conflict from the various drivers. For sound I reduced it to PWM interrupt based audio.

I saw that Arduino SDK was now available for the pico but VGA was not yet part of it . Anyhow, I don't have more plan on the device.
It is cheap indeed. Probably the cheapest MCU that can deliver VGA with such quality for 4 euros.
I have seen other interesting emulators on the device but the code has to be tweaked for performances.
So nice and cheap device but Teensy MCU are indeed another category!

I like the drag and drop feature for flashing new executable!
Have you tried to use custom code with the other PIO to generate C64 sound? I don't know a lot about the c64 but it sounds like something that you could do without generating a lot of interrupts.
 
Have you tried to use custom code with the other PIO to generate C64 sound? I don't know a lot about the c64 but it sounds like something that you could do without generating a lot of interrupts.

I would say the Pico would be more than busy with the sound emulation alone. The sound chip is very complex, and was the best of its time. The code for the sound emulation is quite complex, too....
I remember, when I ported the code from an PC C64 Emu, a comment, that it needs a quite good PC :) Ok, this is many years ago..
 
Indeed, may be using what is left from the second core running the VGA buffer filling would be a better approach. But I have to admit that I did not look at the capability of the PIO code. It remind me the copper code on the Amiga ;-)
 
After testing a bit, its quite a nice chip, the Audio library feels overengineered and does a lot of unnecessary buffer copying. The Teensy Audio code is much more efficient. The pico can run the Teensy Audio with a pio i2s output, its not a DSP engine and even with the advertised "fast" floating point floats should be avoided.
 
Is it possible to make the Rpi Pico work with the Teensy audio adapter? (input and output)
I am thinking it probably is, using the PIO, but it is beyond my level of knowledge :)
If yes, does anybody have any code example?

Thanks
 
I've not heard of anyone has writing code for Pico to work with Teensy's audio shield. I did see a few people working on generic audio stuff (not specifically for SGTL5000 or this shield) but it looked like a pretty early stage of development.

But you might consider what "work with" really means? Pico is a Cortex-M0+ processor, the same as Teensy LC but higher clock speed. We currently only have a pretty small subset of audio features which can work on Teensy LC. The smaller instruction set and lack of DSP extensions and lack of dual buses and other subtle features on Cortex-M4 & M7 really limits how much digital audio processing you can really do (with high quality). Playing a WAV file or very simple synth is possible, but if you try to do much more, Cortex-M0+ just isn't a powerful processor for audio DSP.
 
I've not heard of anyone has writing code for Pico to work with Teensy's audio shield. I did see a few people working on generic audio stuff (not specifically for SGTL5000 or this shield) but it looked like a pretty early stage of development.

But you might consider what "work with" really means? Pico is a Cortex-M0+ processor, the same as Teensy LC but higher clock speed. We currently only have a pretty small subset of audio features which can work on Teensy LC. The smaller instruction set and lack of DSP extensions and lack of dual buses and other subtle features on Cortex-M4 & M7 really limits how much digital audio processing you can really do (with high quality). Playing a WAV file or very simple synth is possible, but if you try to do much more, Cortex-M0+ just isn't a powerful processor for audio DSP.

Thank you for the info, Paul.
I was thinking of using the Pico to build a very rudimentary walkie-talkie using the teensy audio board. Just transmitting voice from a microphone to another device and playing it to headphones. Would this be possible?
 
My knowledge may be outdated, but as far as I remember the Pico can do either audio-in or audio-out, but not both. You would also have to see if it can provide mclk for the SGTL.

In the meantime there is an unofficial Arduino for the Pico - so trying to use the shield might be interesting.
The Pico hjas way more RAM than the LC, a higher clock, and the second core is sure able to compensate the missing DSP features( If its Audio is running on the other core? Don't know). As I heard it can be overclocked, too...
Perhaps I take a look next weekend and try Arduino with the Pico. (DBG seems to work, too ??)
 
Thank you for the info, Paul.
I was thinking of using the Pico to build a very rudimentary walkie-talkie using the teensy audio board. Just transmitting voice from a microphone to another device and playing it to headphones. Would this be possible?
it's probably possible, that is, there is sufficient computing power available. But how much Library development are you willing to do, to avoid using the Teensy 4?

Why not just use a Teensy? The libraries are powerful and mature, there's a competent & friendly support community here, and you might find that you need to do more audio processing (ie DSP filtering) on that audio that will never be possible on the Pico.

If Pico is a hard requirement (power, for instance) there are other lower quality audio solutions available. Pimoroni released an audio board for the Pico that includes a C/C++ library. No micropython yet, and about US$20.
https://shop.pimoroni.com/products/pico-audio-pack
 
Back
Top