Hello, everyone!
I've been toying with some electronics lately, trying to reach more physical areas with my programming. I ruined a good few pieces of perfboard and some hapless parts in the process- it's funny how in hardware each of your learning experiences come with a size and weight attached- 4x6cm and 50 grams of charred green.
I think I've reached the point where you start using a microcontroller if you don't wan't to be "boutique", and after some research it would appear the attiny85 is perfect- seems to be the go-to small device for quite a few professionals, pretty cheap, you can "text files and command line" it (I was never comfortable with IDEs). And- lo and behold- @PMunch seems to have already run Nim on it. Wowzy! Of course as long as I'm doing this, it has to be done in Nim.
Now I'm looking for a kind of Blinkenlights "Hello World" setup. The project for now is to control six LEDs in response to a single push button switch.
So as I see it my next steps would be to order the Sparkfun PGM-11801 AVR Tiny Programmer device (always confused by a device called "Programmer", isn't that supposed to be me?) and try to get Nim to produce some code I can compile with avr-gcc and flash with avrdude, but if you are reading this and have some instructions to shorten the process, I would really appreciate it.
Hello!
It's true that I've programmed the Attiny85 in Nim, but better yet I've written a library which helps with the process. Ratel runs on the Attiny85 (in the shape of a Digispark, but if you home-brew it the solution would be pretty much exactly the same). Simply follow the instructions but set board to be digispark and you should be good to go. The library currently doesn't have a software serial interface though, so you won't be able to print anything with it. But it can run code, and interface with peripherals just fine.
I think a good thing to look at is power. Raspberry pi pico seems to draw 25mA if idle and 390uA dormant, compared to the attiny85's 2mA and 1µa dormant. So if you don't need the pi's features, you can run an attiny85 a lot longer on a coin cell.
I made a similar comparison once when I was looking into Zigbee chips- there, the CC2530 used the least power even though there are alternatives that can do more. I did hear that if you are doing bluetooth or wifi, the ESP is hard to beat.
Do you know which chip exactly did you get a recommendation for from NordicSemi?
NordicSemi name comes up when battery operation is a requirement and it's used widely in commercial products but I don't know much about it.
As you pointed out Pi Pico and especially Espressif SoC power consumption is not great. I love Pi Pico for ease of use with it's build in USB (MSC mode!) and Espressif for it's speed and low price (and USB on ESP32-S3). Recently announced ESP32-P4 seems to have more comprehensive power savings features. P4 in itself is overkill for many applications however I bet there will be smaller variants.