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 That hardware *is* flaky. Measuring voltages is important, fuses matter. Bootloaders need to be enabled on a AVR with a fuse.
There are tons of bootloaders and some are really convenient (such as

NeoPixel LEDs draw a lot of power.

@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 ...

@dries @bleeptrack oh yes, pull up/down resistors were something I was definitely very confused about, especially when set to the pull-up mode direction and you wonder why your pin is high although you didn't do anything with it

@bleeptrack you should include how you learn things, like: how did you find the max rating or the pin mapping for a breakout board.

People need to know how to know, make them self sufficient from day one.

@tj @bleeptrack

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)

@vfrmedia @bleeptrack I don't mean basic tutorials, I mean things like: How do you know the status led can be changed by digitalWrite(13, HIGH)?

where did you learn the max current rating?

@tj @bleeptrack

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).

@tj @bleeptrack

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 also to read the freaking datasheet and understand wtf is going on instead of blindly using arduino. and that Arduino is easy, but almost never the best tool...

@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.

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.

Sign in to participate in the conversation – a Fediverse instance for & by the Chaos community