adds more comments regarding ddrx and portx registers

adds resulting rebuild of the project
This commit is contained in:
ergz 2022-07-30 15:30:12 -07:00
parent 6656bab59e
commit 3d6a744aac
5 changed files with 33 additions and 20 deletions

Binary file not shown.

View File

@ -5,8 +5,8 @@
:100040000C943E000C943E000C943E000C943E0038 :100040000C943E000C943E000C943E000C943E0038
:100050000C943E000C943E000C943E000C943E0028 :100050000C943E000C943E000C943E000C943E0028
:100060000C943E000C943E0011241FBECFEFD4E050 :100060000C943E000C943E0011241FBECFEFD4E050
:10007000DEBFCDBF0E9440000C9451000C940000E4 :10007000DEBFCDBF0E9440000C9454000C940000E1
:10008000209A81E085B9E7EAF1E63197F1F700C0FF :10008000209A81E085B9E3EDF0E33197F1F700C004
:10009000000015B8E7EAF1E63197F1F700C000007B :10009000000015B8FFE32DE033E0F1502040304080
:0600A000F1CFF894FFCF40 :0C00A000E1F700C00000EECFF894FFCFA5
:00000001FF :00000001FF

View File

@ -222,7 +222,7 @@ END GROUP
.rela.plt .rela.plt
*(.rela.plt) *(.rela.plt)
.text 0x0000000000000000 0xa6 .text 0x0000000000000000 0xac
*(.vectors) *(.vectors)
.vectors 0x0000000000000000 0x68 c:/users/emanuel/apps/avr8-gnu-toolchain-3.7.0.1796-win32.any.x86_64/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/avr5/crtatmega168.o .vectors 0x0000000000000000 0x68 c:/users/emanuel/apps/avr8-gnu-toolchain-3.7.0.1796-win32.any.x86_64/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/avr5/crtatmega168.o
0x0000000000000000 __vector_default 0x0000000000000000 __vector_default
@ -306,13 +306,13 @@ END GROUP
0x0000000000000080 . = ALIGN (0x2) 0x0000000000000080 . = ALIGN (0x2)
*(.text.*) *(.text.*)
.text.startup.main .text.startup.main
0x0000000000000080 0x22 blinkled.o 0x0000000000000080 0x28 blinkled.o
0x0000000000000080 main 0x0000000000000080 main
0x00000000000000a2 . = ALIGN (0x2) 0x00000000000000a8 . = ALIGN (0x2)
*(.fini9) *(.fini9)
.fini9 0x00000000000000a2 0x0 c:/users/emanuel/apps/avr8-gnu-toolchain-3.7.0.1796-win32.any.x86_64/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/avr5\libgcc.a(_exit.o) .fini9 0x00000000000000a8 0x0 c:/users/emanuel/apps/avr8-gnu-toolchain-3.7.0.1796-win32.any.x86_64/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/avr5\libgcc.a(_exit.o)
0x00000000000000a2 _exit 0x00000000000000a8 _exit
0x00000000000000a2 exit 0x00000000000000a8 exit
*(.fini9) *(.fini9)
*(.fini8) *(.fini8)
*(.fini8) *(.fini8)
@ -331,11 +331,11 @@ END GROUP
*(.fini1) *(.fini1)
*(.fini1) *(.fini1)
*(.fini0) *(.fini0)
.fini0 0x00000000000000a2 0x4 c:/users/emanuel/apps/avr8-gnu-toolchain-3.7.0.1796-win32.any.x86_64/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/avr5\libgcc.a(_exit.o) .fini0 0x00000000000000a8 0x4 c:/users/emanuel/apps/avr8-gnu-toolchain-3.7.0.1796-win32.any.x86_64/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/avr5\libgcc.a(_exit.o)
*(.fini0) *(.fini0)
0x00000000000000a6 _etext = . 0x00000000000000ac _etext = .
.data 0x0000000000800100 0x0 load address 0x00000000000000a6 .data 0x0000000000800100 0x0 load address 0x00000000000000ac
[!provide] PROVIDE (__data_start, .) [!provide] PROVIDE (__data_start, .)
*(.data) *(.data)
*(.data*) *(.data*)
@ -353,8 +353,8 @@ END GROUP
*(.bss*) *(.bss*)
*(COMMON) *(COMMON)
[!provide] PROVIDE (__bss_end, .) [!provide] PROVIDE (__bss_end, .)
0x00000000000000a6 __data_load_start = LOADADDR (.data) 0x00000000000000ac __data_load_start = LOADADDR (.data)
0x00000000000000a6 __data_load_end = (__data_load_start + SIZEOF (.data)) 0x00000000000000ac __data_load_end = (__data_load_start + SIZEOF (.data))
.noinit 0x0000000000800100 0x0 .noinit 0x0000000000800100 0x0
[!provide] PROVIDE (__noinit_start, .) [!provide] PROVIDE (__noinit_start, .)
@ -458,9 +458,9 @@ END GROUP
.debug_str 0x0000000000000208 0x17c blinkled.o .debug_str 0x0000000000000208 0x17c blinkled.o
0x1b0 (size before relaxing) 0x1b0 (size before relaxing)
.debug_loc 0x0000000000000000 0x48 .debug_loc 0x0000000000000000 0x46
*(.debug_loc) *(.debug_loc)
.debug_loc 0x0000000000000000 0x48 blinkled.o .debug_loc 0x0000000000000000 0x46 blinkled.o
.debug_macinfo .debug_macinfo
*(.debug_macinfo) *(.debug_macinfo)

View File

@ -5,15 +5,28 @@
int main(void) int main(void)
{ {
// set the lowest order bit /*
the DDRX registers are used to indicated whether each pin
is being used for input or output (data direction)
to enable a pin as output you set its corresponding bit to 1,
the default state is 0 (input)
*/
DDRB |= 0b00000001; DDRB |= 0b00000001;
while (1) { while (1) {
/*
When DDRx is set to 1 (output):
PORTx controls whether that port register is set to high or low.
When DDRx is set to 0 (input) it is essentially disconnected
from the circuit
*/
PORTB = 0b00000001; // turn on the LED PORTB = 0b00000001; // turn on the LED
_delay_ms(100); _delay_ms(50);
PORTB = 0b00000000; PORTB = 0b00000000;
_delay_ms(100); _delay_ms(1000);
} }

Binary file not shown.