Close

Taming UART, Flags, and 7 new instructions!

A project log for Raspberry Pi Pico Emulator

Live-coding an Open-Source Pico Emulator from Scratch

uri-shakedUri Shaked 02/07/2021 at 23:450 Comments

In the second episode of the RP2040 Emulator coding live-stream we had an ambitious goal: implement UART so we can see debug prints from the simulated program.

We loaded the hello_uart example program, looked at the disassembly, and started implementing the instructions in a TDD (test-driven development) manner, similar to the first live-stream:

We also took care of implementing CPU Read Hooks, which allow peripherals to intercept memory reads from their mapped regions. This allowed us to mimic the behavior of the UARTFR, indicating to the simulated code that the UART hardware is ready to receive the next character.

You can watch the complete episode here:

And check out the project's code on GitHub: https://github.com/wokwi/rp2040js

If you don't want to miss out the next episode, make sure to sign up and get a reminder when it goes live!

Discussions