r/raspberrypipico

My roguelike on pico

I saw many years ago something like this on hackaday and always wanted to build it by myself, so here it is

u/normalniepredator — 7 days ago

How far can a Pico go as a real computer? VGA + 3.2" touch LCD, USB keyboard and mouse through a second Pico, RTC - one RP2040, 264 KB SRAM

Hey! Last time I showed Recaster Pico as a screenshot - here's the real thing on my desk: one RP2040 running a small desktop OS in its 264 KB of SRAM, now with the parts that make it feel like a computer. Yeah, it is still multi-user and multi-tasking (preemptive). No Linux/Unix, no RISC OS.

What's on the board now

  • VGA, 640×480 at 60 Hz, 256 colors (RGB332), straight from PIO and DMA. Core 1 composes every scanline just in time.
  • A 3.2" SPI touch LCD as a second screen. It mirrors the VGA desktop (well, 1/4 of it ;-)) - core 1 hands the lines it has just composed to a DMA channel, no second compose - or a program takes it over and draws on it directly. Touch moves and clicks the mouse pointer, and the panel also works alone, without a monitor.
  • USB keyboard and mouse through a second RP2040 in the serial line: USB host on its micro-USB port, plus a USB-A socket on two GPIOs driven by Pico-PIO-USB. Events travel as CRC-protected packets mixed into the 1 Mbaud UART console, and the serial terminal still works through it. German layout with dead keys and umlauts.
  • RTC and EEPROM (DS1307 / AT24C32) on I2C, set up with a small text file - the EEPROM even shows up as a file under /dev.
  • GPIO, ADC, PWM, PIO and DMA from the shell language, with the same names as in the Pico SDK.
  • Runs from a power bank.

Lessons for your own projects

  1. pico_minimize_runtime() turns float off. Pico-PIO-USB computes its PIO clock dividers in float at init, so every float operation hits the SDK's panic stub and core 1 silently stops. Use pico_minimize_runtime(target INCLUDE FLOAT).
  2. The same function with pico_multicore: malloc's auto-init mutex never gets initialized, so the first malloc on core 1 hangs forever. PICO_USE_MALLOC_MUTEX=0 if you only malloc once at start.
  3. TinyUSB 0.18 drives one host controller per firmware, and Pico-PIO-USB 0.7 no longer enumerates devices on its own. A second USB port means writing a small host on its low-level API - about 300 lines for boot keyboards and mice.
  4. Flash erases switch core 0's interrupts off for ~45 ms per sector, while at 1 Mbaud the UART's 32-byte FIFO holds about 10 ms of mouse traffic. Put the UART interrupt on core 1 and run it from SRAM.

Next: sound (the speaker is already on the board), the SD card (already there), and touch-friendly UI controls - buttons, sliders, lists.

And yes: I will post a video of it showing it in motion, soon. And you will get your fingers at that ".uf2"-files to play with it.

u/realmcalec — 8 days ago

Same spi port has multiple rx and tx lines?

If i am looking at the pico pinout correctly, it seems like there are at least twop tx and rx lines on the the spi0 port and spi1 port. Does anyone know how to use these? My first intuition is that each spi port can only have one rx and one tx line so any clarification would help greatly!

reddit.com
u/FFISHwith2fs — 9 days ago

Orange pi zero 3 , ideas pls

Me e comprado un ORANGE PI ZERO 3 DE 1GB DE RAM y varios componentes electronicos como una pantalla TFT de 128x160 , sensores, luces, diodios, etc. Tengo algunos proyectos en mente como servidores locales, bloqueadores de anuncion para la casa, intentar un "apaga pcs" con concectarlo a un usb y mas pero me gustaria saber que mas podria hacer.

Me he comprado esto:

https://es.aliexpress.com/item/1005006139989470.html?invitationCode=R0NGTU4ySFVYa09wZU1PVHg4aStTYzRSMlk2R1Bna1hRZHhUaFlSaEM2NmVQemFTZUJrNWVWT0s1MU1hdTAyWg&srcSns=sns_WhatsApp&spreadType=socialShare&social_params=61634254943&bizType=ProductDetail&spreadCode=R0NGTU4ySFVYa09wZU1PVHg4aStTYzRSMlk2R1Bna1hRZHhUaFlSaEM2NmVQemFTZUJrNWVWT0s1MU1hdTAyWg&aff_fcid=7a753e4627684b1181e826a249a3af76-1791301567091-03638-_EyfE51c&tt=MG&aff_fsk=_EyfE51c&aff_platform=default&sk=_EyfE51c&aff_trace_key=7a753e4627684b1181e826a249a3af76-1791301567091-03638-_EyfE51c&shareId=61634254943&businessType=ProductDetail&platform=AE&terminal_id=f5cbccb6e3034f6d9d9ce5be321e216f&afSmartRedirect=y&gatewayAdapt=glo2esp

y esto

https://es.aliexpress.com/item/1005007594124386.html?invitationCode=R0NGTU4ySFVYa081VVIrTE1qL1paYzRSMlk2R1Bna1hRZHhUaFlSaEM2NmVQemFTZUJrNWVWT0s1MU1hdTAyWg&srcSns=sns_WhatsApp&spreadType=socialShare&social_params=61634254985&bizType=ProductDetail&spreadCode=R0NGTU4ySFVYa081VVIrTE1qL1paYzRSMlk2R1Bna1hRZHhUaFlSaEM2NmVQemFTZUJrNWVWT0s1MU1hdTAyWg&aff_fcid=5a39b2df82eb4e92803b6ae7f8323b4e-1791301605643-07482-_EIisN7s&tt=MG&aff_fsk=_EIisN7s&aff_platform=default&sk=_EIisN7s&aff_trace_key=5a39b2df82eb4e92803b6ae7f8323b4e-1791301605643-07482-_EIisN7s&shareId=61634254985&businessType=ProductDetail&platform=AE&terminal_id=f5cbccb6e3034f6d9d9ce5be321e216f&afSmartRedirect=y

PD: si es de aliexpress, el presupuesto es lo que hay xd

reddit.com
u/Embarrassed-Way-5290 — 9 days ago

Spotify Player/Flight Radar

Hi all,

Showing you a small project I made based on ideas from the internet.

I have this problem that drives me crazy: whenever I’m listening to Spotify while I have a YouTube tab open, pressing the play/pause button on my earphones doesn’t just pause Spotify, it starts playing the YouTube video instead.

To solve that, I created a Spotify Player manager, and it was a little bit boring, so I added Flight Radar using the free API at https://adsb.lol/ (and my football team's next game :D).

For the hardware, I used: Pimorini Pim580 Display 2.0" and Raspberry Pico 2.

I posted the 3D model in makerworld: https://makerworld.com/en/models/3399877-case-pimoroni-pim580-display-2-w-rasperry-pico

Check all the functions: https://www.youtube.com/shorts/jv8n3v8LW0w

u/viictorg1 — 9 days ago