I was checking ATMEGA16 datasheet , and at pg17 I found that there is the IO registers that happen to have " IO addresses and SRAM addresses " ,
I don't know which we use and why there is two kinds of addressing for IOs ?
I need to know if it's part of the SRAM or not , Please enlight me ^^
Best Answer
Without accessibility from data space (not "via SRAM") there would be no way to perform indexed/indirect addressing of registers, adding complexity to a large number of algorithms and programming methods. On the other hand, having I/O space allows
IN
andOUT
to be single-word instructions, reducing the size and runtime of simple code.Register space is independent of SRAM space, and the SRAM is moved up the appropriate number of locations in data space to compensate.