2

Are there any options to code and learn Raspberry Pi Pico without real hardware? I have used simulators online for Arduino UNO as well as ATTiny85 in the past.

Do they support Arduino style coding? I will be then able to program the real hardware as soon as I will be able to receive it!
Please forgive me if this is not the right forum to ask about Raspberry Pi Pico

6
  • 1
    In answer to one of those questions, pretty sure that there is a pi pico profile available for the arduino IDE.
    – goldilocks
    Commented May 13, 2021 at 16:21
  • A web search shows tomshardware.com/how-to/… I expect there are plenty of answers.
    – joan
    Commented May 13, 2021 at 16:23
  • Thanks! The link is not working. Is it working for you? I am also looking for no hardware solution, which I think might not be this
    – Nick
    Commented May 13, 2021 at 16:55
  • Sorry, I do not know when it stopped working. There should be plenty of others. Also see blog.arduino.cc/2021/04/27/arduino-mbed-core-for-rp2040-boards
    – joan
    Commented May 13, 2021 at 19:40
  • 1
    this is the right Q&A site to ask about the Raspberry Pi Pico .... your question is not about the Raspberry Pi Pico
    – jsotola
    Commented May 14, 2021 at 0:17

2 Answers 2

2

Welcome to the forum. your question is poorly researched as I can find on Google with a simple search a few options. Does a google search show many options on the first page? Did you try searching first?


https://www.reddit.com/r/microcontrollers/comments/lrwvka/do_you_know_any_good_simulators_for_raspberry_pi/

There doesn't seem to be an official option like with Arduino and TinkerCAD, so I'm just looking for whatever works. I know that u/SpaceMan_The has already created a model of the Pico on Flux.ai, but that system is still in beta and doesn't seem very easy to use. Plus the model I linked is all in separate pieces, and when I tried to fork it and assemble the pieces, I couldn't get it to work how I wanted...

Paul Falstad's Circuit Simulator Applet seems really easy to use, but I can't find a way to add PIO, and I need that for what I'm trying to test.


https://hackaday.io/project/177082-raspberry-pi-pico-emulator

There is minimal documentation and four examples only for the Pico simulator? is that what you would expect. I was able to run some examples but you should dive deeper and see which one suits you best.

https://github.com/GitJer/Some_RPI-Pico_stuff/tree/main/state_machine_emulator


https://github.com/GitJer/Some_RPI-Pico_stuff/tree/main/state_machine_emulator

Emulator of a Raspberry Pi Pico PIO state machine What does it do

This code takes a .pio.h file generated by pioasm as input and emulates how a PIO state machine would execute it. The intended purpose is to gain insight in how it works to find bugs.

Besides the .pio.h file, there are two more input files:

a file describing the c-statements such as putting data into the Tx FIFO (c_program)
a file describing the externally driven GPIO pins (pin_program)

The user can obtain insights into the workings of the pio code through a GUI which shows all (?) the relevant sm internal data such as registers.

For now this code only supports one state machine, of one PIO running one program. Workflow

When working on a project, I typically have an IDE (in my case vscode) with the project files, the pin_program and c_program files opened. Additionally, I have the emulator open with the .pio.h file of the project

When changing the .pio code, I use the IDE function 'build' to have pioasm generate a new .pio.h file. Then I press Reload in the emulator, and study the emulation output. When changing the c-code that uses the pio code, I have to decide if the c_program also needs to change. Often, this will not be the case because the c_program and pin_program act more like test cases than that they mimic the real c-code or real signals applied to the pins. Why?

The problem with the RPi Pico PIO state machines (sm) is that debuggers do not give the insight I need when writing code for a sm. I typically write some code, upload it to the pico and find that it doesn't do what I want it to do. Instead of guessing what I do wrong, I would like to see the values of e.g. the registers when the sm is executing.

1

Looks like Wokwi supports multiple types of microcontrollers, including the pico: https://wokwi.com/projects/new/pi-pico

They have the full details, including what the simulation does and doesn't support, here: https://docs.wokwi.com/parts/wokwi-pi-pico

Be aware that they warn that they currently do not have accurate analog simulation for the circuit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.