3 ms·
> In the end, you write code for a compiler so from your perspective, nothing changes. Isn't this only true if you're only using the CPU and not any of the oth
by josephcsible 4y ago
> In the end, you write code for a compiler so from your perspective, nothing changes.
Isn't this only true if you're only using the CPU and not any of the other onboard hardware? For example, consider this small Arduino program I wrote: https://arduino.stackexchange.com/a/56595/33351 https://arduino.stackexchange.com/a/56595/33351
It would need to be entirely discarded and rewritten from scratch to work on any non-AVR microcontroller.
- mihaigalos 4y agoYes, you are correct. But in most cases, you would use a driver and abstract away what individual registers get read/written. The HAL can be taken from anywhere, really. Doesn't need to be avrgcc/Arduino. The registers in the link are C macros resolving to uint8_t*, pointing to memory locations where you read/write to.