lainchan / Ω
microcontrollers
Nobody special · 2021-01-31 14:29
The Pi Pico just came out, and I learned that there are microcontrollers that can be programmed with python. My arduino has been shelved for a bit since I don't enjoy writing C in my free time.
What do you think, Lain? I've had a lot of fun blinking LEDs with my new $5 board but I'm looking for something new to do with it. Any ideas?
↑ · 2021-01-31 18:43
If you wish to discuss project ideas, that'd probably be a better fit for /Δ/ than /λ/. I'm going to kick off the thread with some /λ/ content for people like you and me who'd rather use something other than C for their embedded projects.
Aside from MicroPython and CircuitPython, which come preinstalled and officially supported on plenty of boards these days, here are some amateur projects that I've found that port some higher-level language to a MCU:
AVR-Ada, for 8-bit Atmel AVR:
https://sourceforge.net/projects/avr-ada/
Ada For Microcontrollers, for beefier stuff like the STM32:
https://github.com/rowsail/AdaForMicrocontrollers/tree/master/RTS/STM
AtomVM, Erlang for the ESP32 and STM32:
https://github.com/bettio/AtomVM
Bitlash, a very high-level command-line interpreter with built-in concurrency for AVRs:
https://bitlash.net/
Let me say that again: you can run tasks in the background and continue to have a live command line, on a 328.
Microscheme, for AVRs:
https://github.com/ryansuchocki/microscheme
Nim for Arduino:
https://github.com/zevv/nim-arduino
TinyGo, for many MCUs from the ATmega328 to the ESP32 ARM Cortex:
https://tinygo.org/microcontrollers/
uLisp, a new Lisp dialect for MCUs from the ATmega328 to the ESP32 and ARM Cortex:
http://www.ulisp.com/show?3M
...As well as a number of Forth implementations. Most of these are very experimental, and a few are to some degree vaporware. The most mature seem to be Bitlash, uLisp and TinyGo.
Agent Smith · 2021-01-31 19:04
What happened to the last micro-controller thread?
>>56810
What can those things do in terms of use cases?
I understand ESP8266 and Pi Zeros and other SBCs can be used as fully fledged computers, but aren't micro-controllers like Arduinos just glorified electronic switches sans senor or relay?
>>56811
>Bitlash: built-in concurrency for AVRs:
Now that's just showing off! :]
I'm surprised there's not more use of assembly at that level to be honest.
Liet Kynes · 2021-01-31 22:09
>>56812
As far as I know, assembly is used mostly for VERY limited microcontrollers, like PICs, which tend to have extremely limited ROM size
Drifter · 2021-02-01 19:17
>>56811
Thank you for all the resources, friend. I've been enjoying learning python the past couple months, and MicroPython seems to be ever so slightly different. Have you encountered any roadblocks? For me the only change has been using the utime library instead of time.
setq · 2021-02-02 12:11
>>56810
So, is this an AVR for people who can into Python but can't into Arduino C?
Naomi Nascimento · 2021-02-02 13:06
>>56812
>I understand ESP8266 and Pi Zeros and other SBCs can be used as fully fledged computers
ESP8266 and Pi Zero are not in the same class at all. Pi zero runs full blown OS like Linux, has 512MB RAM, phone CPU, ARM ESP8266 runs jenky RTOS from ROM, 80KB RAM, very embedded focused.
>but aren't micro-controllers like Arduinos just glorified electronic switches sans senor or relay?
lolno
>I'm surprised there's not more use of assembly at that level to be honest.
Why would you when you can write C? Assembly is like kicking dead whales down the beach.
I really don't get what market the pi pico is going for. I would say it's just cashing in on the pi name, but if it's really a custom chip they presumably dumped a lot of money into it. The market for hobbyist MCU boards is already so saturated and I don't see much special about this one.
pop · 2021-02-02 13:06
>>56815
No, it's ARM based.
byte · 2021-02-02 13:13
>>56817
so Arduino C in general
John Titor · 2021-02-02 13:17
>>56816
>I really don't get what market the pi pico is going for. I would say it's just cashing in on the pi name, but if it's really a custom chip they presumably dumped a lot of money into it. The market for hobbyist MCU boards is already so saturated and I don't see much special about this one.
Unless there is any technological novelty in it (other than "look mom, I can program it in Python") only reason they went for it is making a statement that they are able to.
H.R. Giger · 2021-02-02 13:24
>>56815
but there's already MCU boards that can be programmed in python: teensy, bluepill, esp, etc.
>>56819
>only reason they went for it is making a statement that they are able to
I could actually buy that. The brits are mighty salty about their darling ARM getting sold like a cheap whore to the Japs and then sold again to NVIDIA. Might be eager to prove they can still design stuff.
hash table · 2021-02-02 13:26
>>56816
>I really don't get what market the pi pico is going for.
This was my point in >>56812
Yes ESP8266 is a world apart from a Pi Zero, but both can run a web server or NAS for example, I'm not sure what the point of a Pico is?
Tomohisa "Tom" Kanezaki · 2021-02-02 14:26
They may make it matter by providing solid software stack that is optimized for their exact platform and cooperates well with their more powerful products both on software level and on electronics level (think voltages, resistance, frequencie and other stuff). Other than that it will remain a statement piece to me.
Lunch · 2021-02-02 18:15
>>56814
>I've been enjoying learning python the past couple months, and MicroPython seems to be ever so slightly different. Have you encountered any roadblocks?
As the lainon you were replying to, I haven't used any of the python MCUs and so can't answer, so I release your question back to the crowd.
Liet Kynes · 2021-02-02 23:12
>>56822
>by providing solid software stack that is optimized for their exact platform
If only they did that for their current products. Are they still using that janky GPU bootloader from Broadcom and building everything for the ancient least common denominator ARMv6?
>voltages, resistance, frequencie
It'll be 3.3v like any modern microcontroller, and the others depend on the protocol so it'll be nothing special.
x<->y · 2021-02-02 23:31
>>56824
>If only they did that for their current products. Are they still using that janky GPU bootloader from Broadcom and building everything for the ancient least common denominator ARMv6?
Something akin to that as far as I remember. They are still not clever enough to figure out how to write boot loader for own product and/or signed soykafty agreement to not do so with Broadcom.
Emmanuel · 2021-11-01 21:00
I wonder how much it would take to make a little monochrome keychain console or something with it. That could be fun.
stack · 2021-11-01 21:11
>>56826
it's cheaper to just buy one thats designed for it
Crystepsi · 2022-02-08 13:13
Turn it into a ducky
If you didnt know, it will execute keyboard commands onto whichever computer you plug it into. You can write your scripts in duckyscript.
https://github.com/dbisu/pico-ducky
https://www.youtube.com/watch?v=e_f9p-_JWZw
Bundles of fun to be had with this one. Just be aware that your script will run as soon as you click save, so make sure to pull out on time ;)
Iverson · 2022-02-08 13:41
I swear posters these days are becoming lazier and lazier, there is already microncotrolers thread at least on >>>/Ω/