Arduino SAMD21-based Boards

Alignment and Packing

Here’s a topic relevant to both the new books I’m writing. Consider the following small program: char foo[] = {1, 2, 3, 4, 5, 6, 7, 8}; void setup() { Serial.begin(9600); while (!Serial); Serial.println(*(uint32_t *)&foo[0], HEX); Serial.println(*(uint32_t *)&foo[1], HEX); Serial.println(*(uint32_t *)&foo[2], HEX); Serial.println(*(uint32_t *)&foo[3], HEX); } void loop() { } If you run this on …

Meta Stuff → level conversions, tagging source code, firmware updates

Looking at 3.3v microcontrollers like the SAMD in the newer Arduino boards, it is frequently necessary to do level conversions between 3.3v and 5v logic. Sometimes you can get away with not using a level converter, but certainly far from always! I looked at a couple of inexpensive commercial adapter boards. These are bidirectional which …