r/raspberrypipico • • 3h ago

Pushing TimePico NTP server to the limit. Chrony gives 5us RMS Offset!!

Thumbnail
gallery
1 Upvotes

Following on from last week's "Nudge Lock" scheme...

I got the 'fractional us' code running within TimePico on both the WIZNET and Pico-2W boards. I discovered that the Pico-2W doesn't like 256MHz CPU frequency, so it's limited to 6bit fractional-us @ 128MHz CPU.

This gave some awesome results, even if I don't fully understand how to interpret them:

https://github.com/riblettmj/TimePico/issues/10#issuecomment-7084662839

Setup:

  • 192.168.1.111 - Pico2 + WIZNET Hat, fed from GPS module. Ethernet to laptop via gigabit switch.
  • 192.168.1.112 - Pico2 + WIZNET Hat, fed from same GPS module. Ethernet to laptop via gigabit switch.
  • 192.168.2.102 - Pico2W (NoSelect), fed from same GPS module. Dedicated WiFi network to Laptop running Host-AP.
  • 192.168.100.1 - StarLink terminal (NoSelect), remote over Ethernet and Ethernet-over-Powerline

With Chrony doing a blend of the two WIZNET modules, it reports 5.1us RMS offset (post processed to remove outliers this drops to 1.04us RMS offset) and a mean offset of 33.3ns.

I'd really appreciate some 'expert eyes' looking at this data set, and confirming which parameter/metrics are actually quotable as 'the true accuracy'...

The 'statistics' for the two WIZNET modules shows their time(s) symmetrically bouncing either side of the 'tracking' value. I assume this is just how Chrony interprets the data.

I don't have a more stable reference source than this, and being physically remote (on jittery StarLink internet) don't think I can utilize the public internet for one. Looks like the best solution might be for a GPSDO. "Dear Santa..."

I do have a Mosaic-X5 dev board which has Ethernet and PTP functionality, but when I've tested with this I've seen X5's time wander around (with respect to my TimePicos and StarLink) by a couple of ms. Most likely due to poor GPS antenna (and location), possibly a configuration error.

My task for the next week is to clean up this branch/code and submit a pull request.


r/raspberrypipico • • 18h ago

help-request Raspberry Pi Pico H Project Advice

0 Upvotes

Hi everyone! I'm a first-year, first-semester student, and I need some advice in choosing a project for my final assignment.

It's an individual project using a Raspberry Pi Pico H with MicroPython. The requirements are:

- At least 3 physical inputs (including 1 analogue ADC input and 1 digital priority input).

- At least 3 physical outputs (including 1 digital output and 1 PWM output).

- 3 operating behaviours: normal operation, priority event, and recovery.

- Implement and compare 2 software techniques using a baseline and an improved program.

- Demonstrate everything through both Wokwi simulation and actual hardware.

I'm currently in Week 9 out of 14, so I still have more topics to learn, but I've done searching and here are some ideas I've been considering:

  1. Wind monitoring system: Measures wind speed using a DIY anemometer (i already search how to make it in youtube) and gives a warning when wind conditions are too weak for wind turbines.
  2. Water leakage detection: Detects unusual water flow or household leaks and alerts users.
  3. Drain and flood monitoring: Monitors water levels and rainfall to provide flood warnings.
  4. GPS navigation device: Uses GPS to display location and provide basic navigation or emergency alerts.
  5. Face recognition access control for classroom attendance: Uses OpenCV on a computer to recognise faces and communicates with the Pico to control access.

I'd love to hear your opinions and advice, since i'm still a beginner in this field :)

- Which idea would you recommend for a first-year student? (based on the difficulty, efficiency, sustainability, cost)

- Are there any technical problems I should consider?

- Do you have other interesting ideas that might fit the requirements better?

I'm open to suggestions and improvements. Please do ask me if u need any details from the ideas i have. I'll try to answer them, thanks!


r/raspberrypipico • • 1d ago

[Review Request] 4 layer RP2040 + USB-C board, 50 x 49 mm, KiCad 10

Thumbnail gallery
2 Upvotes

Hi friends, I would like a review before I order this. It is a small RP2040 board with USB-C, 7 LEDs, BOOT and RESET buttons and a push switch.

Gallery order: 1 top composite, 2 to 4 3D views, 5 to 8 copper layers L1 to L4, 9 full schematic, 10 to 14 schematic zoomed in sections, 15 stackup and impedance table.

Board

  • 4 layers, FR4 Isola 370HR, about 62 mil, 1 oz copper on all layers
  • L1 parts and USB pairs, L2 solid GND, L3 3.3 V plane, L4 other signals
  • 50 x 49 mm L outline, four M4 plated holes tied to GND, all parts on the top side
  • USB pairs: 5.0 mil trace, 4.0 mil gap, 90 ohm differential, on L1 over L2
  • 6 mil min track and space elsewhere, 8 mil min drill, 8 mil drill to copper, 12 mil tented through vias, IPC Class 2, 1 A max
  • KiCad DRC and ERC are clean
  • Layout was scripted and most non critical nets were autorouted, so it is not hand tidied

Questions

  1. USB pairs at 5/4 mil on L1. The fab table says 89.7 ohm, my field solver says about 94.5 ohm. Is that a yield risk?
  2. The stackup table shows 0.5 oz inner copper, but I am using 1 oz inner. Does that change the impedance enough to worry about?
  3. Five tented 12 mil ground vias in the RP2040 centre pad. OK, or should I move or fill them?
  4. The USB-C footprint is custom from the datasheet (0.40 mm holes, 5.5 mil annular ring, 0.60 mm shell slots). Anything wrong?
  5. 8 mil power neck downs at the RP2040 pads (16 mil elsewhere) with a 1 A max. Fine?
  6. L4 routing: return paths, anything crossing plane gaps, anything a fab would flag.
  7. One sided assembly with a through hole push switch and USB-C. Any assembly problems?

KiCad 10.0.8. I can share Gerbers or the project if that helps. Thanks!


r/raspberrypipico • • 20h ago

RP2350 vs STM32, ESP32 & Arduino – Real Benchmarks | RP2350 #22

Thumbnail
youtube.com
0 Upvotes

r/raspberrypipico • • 2d ago

Assembly ARM32 Aula 3

Thumbnail
youtube.com
0 Upvotes

Assembly ARM - Atribuição em tempo de projeto (cliente: Lubuntu; servidor: Raspberry Pi OS)


r/raspberrypipico • • 5d ago

uPython Hub75 matrix

65 Upvotes

Yearly improvements to my hub75 driver. Running on a pico2w, I've finally figured out full dma chaining. It's got lots of mpy native helpers to speed things up like sending frames to the display, but it's micropython that you run on it. Here I have two so it's 128x64. This is a demo game, full 3d textured objects in it. Currently at 60 FPS.


r/raspberrypipico • • 4d ago

I'm making an app to reverse engineer AVC-LAN and RP2040!!

Thumbnail aend-tech.com
3 Upvotes

r/raspberrypipico • • 5d ago

uPython microPython - "Nudge Lock" and Sub-10ns Time-Stamping

Post image
16 Upvotes

I wanted to implement some precision time-stamping for a microPython project, whilst also keeping these timestamps aligned to the 1us counter (so script could use ticks_us() in tandem).

I wanted to do as much as possible in hardware, so that CPU timing was irrelevant (ie process is NOT affected by any CPU interrupts/blocking code).

Here is the scheme I invented...

  • Alignment - The "Nudge Lock" process aligns the 1us Tick and CLK_GPOUT0 clock, by reading the 'tick countdown' at the rising edge of CLK_GPOUT0 and 'nudging' CLK_GPOUT0 if they do not align. Once aligned, the Counter PIO can be started/sync'ed so it counts with 7.8125ns steps (1/128th of 1us).
  • Time-Stamping - After setup, the Detect and Relay PIOs are re-assigned to trigger from 1PPS (or other input), and the DMA then copies the 1us Counter (32bit) to the FIFO when triggered. Counter PIO simultaneously triggers and copies it's 7.8125ns count to FIFO.
  • Validation and Blend - the Counter PIO is exactly aligned with 1us Tick, the lower 7 bits contain a fractional 1us value and the 8th bit is 1us. Since the DMA might be slightly slow to access/copy the 1us counter, the 8th bit can be used to detect (and correct) this slow transfer.

Limitations:

  • CPU is overclocked to 256MHz, so that Counter PIO precisely matches with 1us.
  • For setup (initial sync) Counter(s) must be in same PIO block as 1st Detect as it uses inter-PIO IRQ. Other Detects may be in other PIO blocks

Notes:

  • For an 'electronics guy' it's handy to have the 1us tick rendered (on GPIO21) so that it can scoped.
  • Relay PIO are not strictly required, but I like the 'comfort' of knowing I have 4x buffer of samples and not a memory location will might be over-written by new sample if I am slow to process old sample.
  • With Relay PIO - RP2040 can be configured to 2x timestamped inputs, RP2350 can be configured to 4x timestamped inputs.
  • Without Relay PIO - RP2040 can be configured to 4x timestamped inputs, RP2350 can be configured to 6x timestamped inputs.
  • DMA can transfer 64bit us Counter, as 4x 32bit which are post-processed. This also removes my 'comfort' buffer.

If anyone found this interesting, or wants to try it out, I placed the code here:

https://github.com/orgs/micropython/discussions/19927#discussioncomment-19570374


r/raspberrypipico • • 4d ago

Engineering a budget-friendly, 6-DOF CAD mouse (NaviGo). Dropping the DIY files soon! 🛠️

Thumbnail
reddit.com
1 Upvotes

r/raspberrypipico • • 5d ago

Raspberry Pi Pico showing up as unrecognized afther completing a lightgun build

Thumbnail reddit.com
2 Upvotes

r/raspberrypipico • • 5d ago

Best parts to power raspberry pi pico?

Thumbnail reddit.com
2 Upvotes

r/raspberrypipico • • 6d ago

hardware FramePico2 Expansion Cards based on RP2354 MCU arrived at home from the factory

Thumbnail
gallery
80 Upvotes

r/raspberrypipico • • 5d ago

hardware I've made 2 of these retro hardware teardowns now - they're swappable inside my Pico 2 W powered frame. Build Montage Included.

4 Upvotes

Fast forward to the end to see both in "Passive" mode - less drama - more visible.

Videos for the LCD are generated in a web app from JS based games and a montage maker.

Pico2 had to be OCd to 308mhz for optimum performance @ 24fps. LEDs all work off a timeline based system along with beat detection for audio reaction which i originally wrote in python 4 years ago before converting to C. Things like the ABXY button lights and Gameboy screen flashes come dynamically from the audio base, treble or mids etc - they also react in realtime when playing the built in games so the fire button from a phone will flash whatever buttons the LEDs are configured to.

The built in games are a WIP - they run at about 28fps but with dips to 22 atm - not perfect but playable.

Heap has been a big battle through all of this with fragmentation.

Turns out the biggest issue with all of this is Dust VS Acrylic - its an utter nightmare. Tried a Zerostat anti static gun for the last build and the acrylic just laughs in its face! Hoping to sell them in the future - cant whilst this issue is unsolved. Deionised water next test.

Yes i originally coded the whole LED engine using timeline objects, colour wheels, lerp fades and pixel groupings in Python.

Yes AI has been used through the project as its proceeded to convert and refine into C for speed and more features. No AI was used for the PCB, Fusion side etc.

The Grid Storm game actually comes from a game i did in JS 13 years ago lol. It'll all go into a diary log at some point if anyone cares.

Project in its current form has been ongoing for about 8 months at this stage and started with a similar idea 4 years ago.

Next up is a NES pad and cart i have knocking about. Retro devices are all damaged, cracked or not working before anyone asks.


r/raspberrypipico • • 5d ago

Student Pi Pico Project - Arduino IDE

Thumbnail reddit.com
3 Upvotes

r/raspberrypipico • • 7d ago

c/c++ Sunset-toned animation on a monochrome STN LCD with a Pico

84 Upvotes

I made a sunset-toned animation on a TG12864B monochrome STN LCD driven by a Raspberry Pi Pico (RP2040).

Showing intermediate tones by rapidly toggling pixels on and off (known as frame rate control, or temporal dithering) is nothing new. But on a blue-background STN LCD, pixels pass through purple and yellow hues while switching between dark and light. I use that to display images in a nostalgic color palette.

The Pico generates an individual PDM signal for each of the 128x64 pixels, which gives 256 levels per pixel.

At first the screen was covered in sand-like noise. While trying different refresh rates, I found that the noise almost disappears at one specific frame rate (102-103 FPS for this module). I'm not sure why, but it seems to sync with some periodic operation inside the LCD module.

The 3D scene is also rendered on the Pico.

GitHub repo: https://github.com/shapoco/pdmfrc


r/raspberrypipico • • 7d ago

Error when trying to save main.py file on raspberry pi pico w

3 Upvotes

Basically the title. But i have unplugged and plug back in. Pressed stop. Closed thonny and everything. I am on a mac using a Pico W.


r/raspberrypipico • • 8d ago

Updated: 10-segment LED bar on Raspberry Pi Pico 2 W with MicroPython (p80_pico library), Wi-Fi control & 3V3 current benchmarks

Post image
5 Upvotes

I revised my older Pico LED bar tutorial and tested it on a Raspberry Pi Pico 2 W with MicroPython v1.29.0.

Main changes in this version:

  • Moved from a monolithic script to a single-file p80_pico library (LedBar for local control, WebLedBar for local network HTTP commands)
  • Added active-low / active-high handling (common_anode=True/False) and direction checks
  • Measured actual 3V3 supply branch current with a multimeter (0.0 mA off, 2.1–4.9 mA per segment, 31.6 mA with all 10 segments on) and noted the measurement limits
  • Added troubleshooting steps and local-only security notes

Full guide and code examples:https://peppe8o.com/10-segment-led-bar-raspberry-pi-pico-2w-micropython-wifi/


r/raspberrypipico • • 8d ago

Open Source Programmer and Debugger - Hybridlink | RP2350 #21

Thumbnail
youtube.com
6 Upvotes

r/raspberrypipico • • 9d ago

I built my own PicoDesk using a Raspberry Pi Pico 2 W!

Thumbnail
gallery
52 Upvotes

Hey everyone!

I've been working on improving my little PicoDesk project, and this weekend I finally put together a new hardware setup using the Raspberry Pi Pico 2 W and a zero PCB.

The setup currently features:

  • Raspberry Pi Pico 2 W as the main controller.
  • Dual OLED displays for displaying different information.
  • A compact DIY hardware layout.

This is a small personal maker project, and I'm really enjoying experimenting with MicroPython and embedded hardware.

It's not a polished commercial product, but I'm happy with how it's coming together!

GitHub: https://github.com/kritishmohapatra/PicoDesk

Would love to hear your suggestions, feedback, or ideas for features I could add next!

Thanks!


r/raspberrypipico • • 9d ago

Looking for Resources to Learn Microcontrollers & Microprocessors

Thumbnail reddit.com
4 Upvotes

r/raspberrypipico • • 9d ago

pioasm Vibe coded a Raspberry Pi 4 Simulator online

Post image
0 Upvotes

r/raspberrypipico • • 10d ago

Dual platform MicroPython/full Python driver for the MAX31760 fan speed controller

Thumbnail reddit.com
3 Upvotes

r/raspberrypipico • • 11d ago

hardware Pico2W car with webcam - chasing cats

Thumbnail
gallery
5 Upvotes

Pretty happy with result, one Raspberry Pi Pico 2W, a webcam, 4 JGA25 370 motors, 2x 18650, 2 DRV8833 and i can chase my cats around the house and inspect crawlspace. I can share the code if anyone wants to do the same, suggestions on housing welcome


r/raspberrypipico • • 11d ago

help-request Streaming phone mic to pico 2 w?

3 Upvotes

As the title says, I'm trying to figure out how I can stream a phone's mic remotely to a speaker on the pico for a costume. I've seen suggestions on using apps like androidmic but no matter what I do, I get a "failed to connect" error on the app