I'm trying to figure out the flash memory map of ATmega328P:
Below is from the datasheet:
Program Memory Map for ATmega328P is given as 32KB: 32Kbytes = 32K * bytes
0x0000 means 16 bit wide (for each line of memory there is 2 bytes)
which is 16K * 16bit
What I understand from this, the flash memory is made up of 16K lines of 16 bit wide registers. So for an instruction on the flash memory the maximum address number is 16K.
Is this 16K 2^16 or 16000?
The last three X Y Z general purpose registers which are used for holding the addresses(pointers) are 16-bit which can store up to 2^16 = 65536 addresses. So I would guess 16K means 65536 here?
But if it is, in the above figure it shows the last memory line as 0x3FFF which corresponds to 16383.
What am I knowing wrong here?