1 Comment
author
Feb 1, 2023·edited Feb 4, 2023Author

For readers wondering if the information in this series applies to other SAM series MCUs from Microchip, the answer is generally "yes". Cortex-M4 chips (SAM E5x, D5x, G5x, and 4x) are particularly close and differ chiefly in performance, price, and the physical ordering of pins.

The applicability to Cortex-M chips from other manufacturers is a more complicated story. The cores are the same, so certain aspects of the tutorial - e.g., SysTick and NVIC - should translate directly. On the flip side, on-die peripherals, such as the GPIO controller or the clock subsystem, tend to be vendor-specific, and will use somewhat different keywords or semantics.

As a trivial example, on a SAM chip, this is how you output "1" on PA5:

PIOA->PIO_ODSR = (1 << 5);

The same on an STM32 chip may look like this:

GPIOA->ODR = (1 << 5);

The differences can go beyond labels. For example, the clock generation and distribution architecture is different on STM32. That said, the same general concepts apply: there are register-selectable clock sources, prescalers, and programmable PLLs. In other words, the knowledge transfers easily, but implementation details do not.

Expand full comment