Memory map file creation
- We need to define the register address to Register name mapping.
This can be done by the following command
#define PORTB *((volatile unsigned char *) 0x25)
- Once this is defined in the
memorymap.h
file, we can access thePORTB
value directly by reading or writing to it with the namePORTB
.
💡
It is important to remember that
PORTB
defined here is the de-referenced PORTB
address. To access the PORTB
address we need to add the reference &
operator in front.This process of defining the registers with their names will be done as the need arises.