I am trying to understand how a microcontroller is working, basically. At least from a software developers point of view. I have some basic knowledge about "make-files" and the compiling and linking process as well as low-level programming. But what I want to learn is programming even closer to the hardware.
So I was starting to dissect the HardwareSerial code (HardwareSerial.c and HardwareSerial.h) for Arduino. And what I could not figure out is where UBRRH (or UBRR0H) are defined, which means that we have serial0 (the only one for Arduino-Uno). My guess is that the manufacturer of the board needs to provide this somehow. I thought that depending on the target board I use, different code is compiled. So that if I compile the code for an Arduino-Uno the compiled file will somehow include a definition of e.g. UBRRH. Then how does the Arduino IDE know what board I'm compiling?
My goal is to eventually be able to write my own serial protocol. And maybe even design my own board.. Even though the only "board" I have created is an H-bridge but hey, aim high...