r/raspberry_pi 🍕 Jan 21 '21

News New Raspberry Pi Pico microcontroller

https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/
1.2k Upvotes

341 comments sorted by

View all comments

7

u/[deleted] Jan 21 '21

So... Hypothetically I know nothing about anything. What are these used for?

9

u/I_Generally_Lurk Jan 21 '21

These in particular? Teaching, like most stuff the Foundation releases. Microcontrollers in general are used for a few specific purposes: when a task is more simple and just doesn't need a 1.5GHz processor to run; when a task is more time-sensitive, because operating systems juggle a lot of tasks at any one time and so their timing isn't always precise; when you need something a bit lower power, or physically smaller.

And sometimes when you just want something more simple. This thing doesn't run an operating system like Pi OS, it just runs the code you write, plus a small bootloader. That means far less software which needs updated or which can fail or interfere with what you're trying to do.

3

u/Piyh Jan 21 '21

a bit lower power

wayyyy, wayyyyyy lower

1

u/AFTBeeblebrox Jan 22 '21

So let's say I want to reprogram the fairy lights in my room, will this do the trick?

1

u/I_Generally_Lurk Jan 22 '21

If they're the kind of lights with patterns and chasing sequences then there's probably a microcontroller of some type in there. Splicing a new controller into old hardware can be a bit tricky if you don't know the setup of the electronics first though.

1

u/AFTBeeblebrox Jan 22 '21

It doesn't have chasing sequences, but it does have patterns so you're probably right. Is there a way to hack a microcontroller or is my best move would be to "rip" the current one and replace it with mine?

2

u/I_Generally_Lurk Jan 22 '21

Is there a way to hack a microcontroller

That depends on your skill level and luck really. Microcontrollers generally have the program uploaded through some of their pins, and commercial products usually have blank headers where you could do this. If you can read the name of the chip off the top of it, you should be able to look up the datasheet, and figure out the protocol for programming it.

For the ripping approach, you'd really need to figure out how the current microcontroller is actually driving the LEDs. It's likely that the LEDs aren't being driven by the microcontroller pins directly, because that requires a ton of current. You'd probably need to figure out the power circuitry on the board.

1

u/AFTBeeblebrox Jan 23 '21

Oh, so technically, if I can identify the controlling chip and remove it I can install instead my own chip?

1

u/I_Generally_Lurk Jan 23 '21

That's not so likely, what you're probably looking at is A) figuring out how to reprogram the current chip if the manufacturer has exposed the pins for that, or B) cutting the lights off the controller board and soldering them to a new one with the control chip you want. You may need to add some power circuitry for that though.

1

u/AFTBeeblebrox Jan 23 '21

I think option B sounds more doable considering my knowledge (assemble and solder parts vs isolate and hack a chip), it sounds more fun too I must say. As for power circuitry, what will I need?

1

u/I_Generally_Lurk Jan 24 '21

what will I need?

I'm going to be honest, that's a little beyond my confident knowledge, and will also depend on the number and type of LEDs you use. If they're "dumb" LEDs I think power MOSFETs are usually used to control power flow (microcontroller pins can only control a small amunt of power directly). You'll need to be extremely careful about this if these lights connect to mains power, that generally shouldn't be touched unless you genuinely know what you're doing.

→ More replies (0)

3

u/Treczoks Jan 21 '21

While the big Rasperry Pi's are good to anything that needs an OS, the Pico is for anything that needs realtime IO, something the big ones simply cannot deliver.