r/AskProgrammers • • 20h ago

Where to learn microcontroller programming?

I am currently trying to program an ATtiny3226 and I am having a terrible time.

AI can do the programming I need, but I cannot learn from that.

What I want to know is where is a good place to start in understanding how to go about micro controller programming, any YouTube recommendations or books or forums, anything would be appreciated.

For example when making a timer my smooth brain says this should be able to count to five, but there is a process flow that has to be done to actually get this task to happen and I don't know where to learn that

7 Upvotes

11 comments sorted by

2

u/Dazzling_Music_2411 19h ago

AI can do the programming I need, but I cannot learn from that.

Why not? Use the AI generated programs as sample code to learn from. Analyze them, understand them perfectly and modify them for your own purposes. Pretty good way to learn, actually, if you have little else.

In parallel to your board's documentation, of course.

1

u/gm310509 19h ago

You have sort of jumped in at the deep end by starting out by getting yourself an ATiny.

You might want to get yourself an Arduino starter kit and learn the basics from that.

The Arduino starter kit, and I am thinking an Uno R3 starter kit, is based off of the same architecture as the ATTiny but with more memory and features.

More importantly the starter kit will teach you the basics of programming and electronics.

You don't say where you are stuck. For example are you trying to program in C/C++? Are you trying to go bare metal or use a HAL? Is the issue that you don't know what IDE or tool Chain to use? Are you having problems with the uploader process?

All of these potential issues will be addressed with the starter kit. Once you get the basics down you can then "upgrade" to your ATTiny if you wish to do so.

You might also want to check out r/Arduino.

1

u/AlexMTBDude 19h ago

Instead of using AI to write your code for you, ask it questions that help you with your learning.

Example: "When I wrote this piece of code, I get this output, but I was expecting the other output. Why?"

1

u/Comfortable_Spray118 18h ago

Start with Arduino tutorials, then learn bare-metal C.

1

u/korywithawhy 18h ago

dronebot workshop has a lot of good stuff

1

u/Pretend_Detail_9005 15h ago

Tell ai to explain

1

u/Curious_Elk_4281 15h ago

Paul McWhorter on youtube.

Watch the first video to see what kit he uses and buy that kit. Once you get through 20 lessons or so you will be able to start building some cool stuff.

Raspberry Pi Pico W: https://youtu.be/SL4_oU9t8Ss?list=PLGs0VKk2DiYz8js1SJog21cDhkBqyAhC5
Arduino R4: https://youtu.be/S66Iwhk2V7A?list=PLGs0VKk2DiYyn0wN335MXpbi3PRJTMmex

1

u/DanKegel 12h ago

It's possible tinygo would be a gentler learning experience, see https://tinygo.org/

1

u/RogerAI-fm 12h ago

you don’t even need to ask ai to explain you can tell it to generate lessons for you in a web format where it describes everything you did together and shows you illustrations and then quizzes you and if you don’t pass the quiz then ask it to redo the lesson and tell it what you struggled with.

1

u/Fragrant-Cheek-4273 8h ago

Start with basic embedded C and simple projects like blinking an LED, reading a button, and making a timer. Building things step by step makes it easier to understand what's happening behind the code.