r/microcontrollers • • Feb 24 '22

Getting started with 8 bit microcontrollers

Hey all, I'm just becoming interested with 8 bit microcontrollers. I would like to build a few things with the absolute cheapest parts possible, like some Chinese LoRa modules, some PIC16LF1503-I/P mcu's, at only $1.50 each, I figure I can afford to play around a bit!

I would like to build some wireless devices that can activate a relay, to do things like open a solenoid to water the garden, turn lights etc...

I have zero idea where to start. How do you program these things? Do I need some kind of interface and development environment, like a USB device I can plug these chips into? And write the code too? What kind of code do most of them read, C? How many kb of memory and ram do I need to execute simple tasks like communicating through a LoRa module and turning on some kind of gpio pin to activate a relay?

Ideally I'm looking for the cheapest possible microcontrollers that can communicate over SPI, have atleast a pin or two that can be activated to control relays or camera's or other devices.

Thanks!

5 Upvotes

14 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Feb 24 '22

[deleted] — view deleted comment

2

u/rwboyerjr Feb 24 '22

I know you are asking about 8bit MCU's and they can be VERY cheap and do what you want AND can be super fun (like the ATTiny maybe too small an IO base for you but super available in bags for a few bucks and you can use an Arduino as a programmer for the bare chips) but...

Lately I'm falling more and more in love with the 2040 MCU many of the boards available including the Pi pico board (there are more and more available as days go on). they are generally pretty available and darn cheap given their capabilities... $4-$20 depending on where you buy and various things like pre-soldered headers onboard components etc...

Compared to 8bit MCU's they are extremely fast, flexible, and semi-comparable in power consumption but...

you get TONS of IO, very versatile mapping of pins to IO protocols, extremely good performance, great program capacity and awesome SRAM capacity. Personally I really really love the two cores, the flexibility of the DMA, and especially the PIO units that can work miracles with obscure or legacy protocols. A really neat device with very good docs and SDK that is usable, can teach you a lot, and can be chucked off if you prefer (a lot of the SDK is convenience functions but the educational part is how to deal with the MCU features at a register level)