Preparing slides about microcontrollers in making. Is there anything that would have made it easier for you to get started? Is there anything nobody told you, but it was super important?
@bleeptrack things that come to mind:
- what is a bootloader
- not all pins have pwm
- 5v vs. 3v issues
- single thread (on a higher level, in arduino delay() just stops everything else)
@bleeptrack also a clear example about pull up and pull down resistors (also the niceness of having them integrated on the IC oftenly) would have made a lot of things clear to me when I was starting off. It's something I always have to look up ...
certainly links to basic tutorials about hardware/analogue electronics are needed, I encounter many younger people who are skilled with PCs/Macs/Linux and /want/ to get into working with microcontrollers but find the electronics side overwhelming, as unlike the
1980s when I grew up they didn't experiment much with analogue electronics (even building a loud hi fi or DJ setup is often discouraged these days due to increased controls against noisemaking)
when I started with Arduino about 10 years ago I also bought some book written by the Italian prof who was part of the group who invented them which had some of this info - but I agree it would also be good to show *why* that LED changes and teach things like how the port registers work (like how we learned in the 1980s with the user ports of the 8 bit microcomputers).
I do think we need both the intermediate/advanced info (slightly more than the initial Arduino or other microcontroller code examples) *and* basic tutorials about electronics, at least for the benefit of the English (who do seem to have slipped back skills-wise compared to the rest of Northern Europe). As even simple experiments (i.e how/why a transistor switch works to allow a relay to be used) can be used to encourage people to get into the habit of reading datasheets etc..
@bleeptrack It is almost always better to understand the hardware of specific peripheral first (which modes are supported, which registers are involved, what is done in hardware, what has to be done in software), before trying to use a library for the peripheral.
Because it almost never works at first try and debugging without having understood the hardware is hours of guesswork.
@bleeptrack Also a short primer about how to look up stuff in datasheets. Having to go through hundreds of pages of tables and drawings is intimidating for beginners, but ultimately it's the best source of information about a given microcontroller.
@bleeptrack Many times Arduino is good enough, but something with a real debugger will save you many sleepless nights wondering why the damn thing doesn't work. And TI LaunchPad's are really cheap with cool low power microcontrollers, but the learning curve is quite steep.
@bleeptrack How to use a debugger. I was amazed when I discovered that you could look inside a microcontroller while it's running.
I have also seen quite some people having problems at the beginning if they don't realise how a debug-print might mess with the timing of their hardware peripherals.
@bleeptrack I wish someone had told me that dupont cables are incredibly unreliable before I spent a few hours each week chasing intermittent issues that were probably all caused by dupont cables, until I finally noticed this after a few months.
@bleeptrack Also good to know: ESD can cause really strange problems in some µCs (I noticed this with STM32F103), like single pins that always read HIGH, but still work fine as an output, or something like that. In the past, I always assumed that ESD damaged devices would be easy to spot because they would be "dead". I think I never had issues like that with ATMEGAs (pure speculation), so it might depend a lot on the manufacturer or model.
@bleeptrack it's an advanced topic but in terms of power saving for battery operation I found it very helpful to learn not only about sleep states but also about the Atmega system clock scalers to modify clock speed at runtime.
@lastfuture oh! thanks!!
I'm an old fart, so I don't remember any specific golden tool, but if I may...
As early as possible, teach yourself how to read datasheets, schematics, basic electronics.
Get a minimum amount of debugging tools (JTAG/SWD & 8ch logic-analyzers can be bought as chinese clones for ~€10).
This will help you overcome the frustrating "change random crap in the code found in a forum or the circuit, until it finally works even you don't know why" phase everyone seems to go through.
chaos.social – a Fediverse instance for & by the Chaos community