I recently started programming my Arduino (ATmega328p) using AVR and gained sufficient knowledge on using avr lib,instead of arduino IDE.I started with a blink led example.
Then i tried the same eg but this time however i didnot include io.h or any other lib, and instead used pointer to PORTs Like DDRB or PORTB etc.
According to atmega328p datasheet, DDRB is at 0x04 and PORTB at 0x05.
However setting them high for my blinking led eg didnot work. Instead i had to add an offset of 0x20 to both addresses, after it worked perfectly. i.e.,DDRB=0x24 and PORTB=0x25 Where is this offset(0x20) comming from ?