daily_automated
This commit is contained in:
40
trunk/AVRProjects/00_ASM_Templates/ATTiny13a/tiny13a.avr
Normal file
40
trunk/AVRProjects/00_ASM_Templates/ATTiny13a/tiny13a.avr
Normal file
@@ -0,0 +1,40 @@
|
||||
;* ******************************************************** *
|
||||
; ATtiny 13/45/85 Pin map
|
||||
; +-\/-+
|
||||
; /Reset ADC0 PB5 1|o |8 Vcc
|
||||
; ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
; ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
; GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
; +----+
|
||||
;* ******************************************************** */
|
||||
|
||||
; Define processor type on top of the source code
|
||||
;
|
||||
.DEVICE ATtiny13A
|
||||
; 9.6MHz:
|
||||
; LFuse: 0x7A; HFuse: 0x1F;
|
||||
; AVRDude: -U lfuse:w:0x7a:m -U hfuse:w:0x1f:m
|
||||
;
|
||||
; ******************************************************************
|
||||
|
||||
; Int-Vector area
|
||||
.CSEG
|
||||
.ORG $0000
|
||||
rjmp Setup ;Reset
|
||||
reti ;INT0 - External Int0 Vector
|
||||
reti ;PCINT0 - Pin Change Interrupt handler
|
||||
reti ;TIM0_OVF - Timer0 Overflow handler
|
||||
reti ;EE_RDY - EEPROM Ready Handler
|
||||
reti ;ANA_COMP - Analog Comparator Handler
|
||||
reti ;TIM0_COMPA - Timer0 Compare match A Handler
|
||||
reti ;TIM0_COMPB - Timer0 Compare match B Handler
|
||||
reti ;WDT - Watchdog Overflow Handler
|
||||
reti ;ADC - ADC Conversion Handler
|
||||
|
||||
.ORG $000A
|
||||
Setup:
|
||||
cli ; Disable Interrupts
|
||||
ldi r16, low(RAMEND)
|
||||
out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
Main:
|
||||
rjmp Main ; infinite loop
|
||||
4
trunk/AVRProjects/00_ASM_Templates/ATTiny13a/tiny13a.hex
Normal file
4
trunk/AVRProjects/00_ASM_Templates/ATTiny13a/tiny13a.hex
Normal file
@@ -0,0 +1,4 @@
|
||||
:020000020000FC
|
||||
:1000000009C018951895189518951895189518956C
|
||||
:0C00100018951895F8940FE90DBFFFCF6C
|
||||
:00000001FF
|
||||
50
trunk/AVRProjects/00_ASM_Templates/ATTiny13a/tiny13a.lst
Normal file
50
trunk/AVRProjects/00_ASM_Templates/ATTiny13a/tiny13a.lst
Normal file
@@ -0,0 +1,50 @@
|
||||
gavrasm Gerd's AVR assembler version 3.5 (C)2015 by DG4FAC
|
||||
----------------------------------------------------------
|
||||
Source file: tiny13a.avr
|
||||
Hex file: tiny13a.hex
|
||||
Eeprom file: tiny13a.eep
|
||||
Compiled: 23.07.2021, 10:20:30
|
||||
Pass: 2
|
||||
1: ;* ******************************************************** *
|
||||
2: ; ATtiny 13/45/85 Pin map
|
||||
3: ; +-\/-+
|
||||
4: ; /Reset ADC0 PB5 1|o |8 Vcc
|
||||
5: ; ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
6: ; ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
7: ; GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
8: ; +----+
|
||||
9: ;* ******************************************************** */
|
||||
10:
|
||||
11: ; Define processor type on top of the source code
|
||||
12: ;
|
||||
13: .DEVICE ATtiny13A
|
||||
14:
|
||||
15: ; Int-Vector area
|
||||
16: .CSEG
|
||||
17: .ORG $0000
|
||||
18: 000000 C009 rjmp Setup ;Reset
|
||||
19: 000001 9518 reti ;INT0 - External Int0 Vector
|
||||
20: 000002 9518 reti ;PCINT0 - Pin Change Interrupt handler
|
||||
21: 000003 9518 reti ;TIM0_OVF - Timer0 Overflow handler
|
||||
22: 000004 9518 reti ;EE_RDY - EEPROM Ready Handler
|
||||
23: 000005 9518 reti ;ANA_COMP - Analog Comparator Handler
|
||||
24: 000006 9518 reti ;TIM0_COMPA - Timer0 Compare match A Handler
|
||||
25: 000007 9518 reti ;TIM0_COMPB - Timer0 Compare match B Handler
|
||||
26: 000008 9518 reti ;WDT - Watchdog Overflow Handler
|
||||
27: 000009 9518 reti ;ADC - ADC Conversion Handler
|
||||
28:
|
||||
29: .ORG $000A
|
||||
30: Setup:
|
||||
31: 00000A 94F8 cli ; Disable Interrupts
|
||||
32: 00000B E90F ldi r16, low(RAMEND)
|
||||
33: 00000C BF0D out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
34: Main:
|
||||
35: 00000D CFFF rjmp Main ; infinite loop
|
||||
|
||||
Program : 14 words.
|
||||
Constants : 0 words.
|
||||
Total program memory: 14 words.
|
||||
Eeprom space : 0 bytes.
|
||||
Data segment : 0 bytes.
|
||||
Compilation completed, no errors.
|
||||
Compilation endet 23.07.2021, 10:20:30
|
||||
49
trunk/AVRProjects/00_ASM_Templates/ATTiny2313/tiny2313a.avr
Normal file
49
trunk/AVRProjects/00_ASM_Templates/ATTiny2313/tiny2313a.avr
Normal file
@@ -0,0 +1,49 @@
|
||||
;* ******************************************************** *
|
||||
; ATtiny 2313/4313 Pin map
|
||||
; +-\/-+
|
||||
; /Reset PA2 1|o |20 Vcc
|
||||
; RXD PD0 2| |19 PB7 SCK
|
||||
; TXD PD1 3| |18 PB6 MISO
|
||||
; PA1 4| |17 PB5 MOSI
|
||||
; PA0 5| |16 PB4 OC1B
|
||||
; PD2 6| |15 PB3 OC1A
|
||||
; PD3 7| |14 PB2 OC0A
|
||||
; PD4 8| |13 PB1 AIN1
|
||||
; OC0B PD5 9| |12 PB0 AIN0
|
||||
; GND 10| |11 PD6
|
||||
; +----+
|
||||
;* ******************************************************** */
|
||||
|
||||
; Define processor type on top of the source code
|
||||
;
|
||||
.DEVICE ATtiny2313A
|
||||
|
||||
; Int-Vector area
|
||||
.CSEG
|
||||
.ORG $0000
|
||||
rjmp Setup ; for all types
|
||||
reti ; External Int0 Vector, not used
|
||||
reti ; External Int1 Vector, not used
|
||||
reti ; Timer Tim1_Capt, not used
|
||||
reti ; Timer Tim1_CompA, not used
|
||||
reti ; Timer Tim1_Ovf, not used
|
||||
reti ; Timer Tim0_Ovf, used
|
||||
reti ; Usart_RXC, not used
|
||||
reti ; Usart_dre, not used
|
||||
reti ; Usart_TXC, not used
|
||||
reti ; ANA_COMP ; Analog Comparator Handler
|
||||
reti ; PCINT ; Pin Change Interrupt
|
||||
reti ; TIMER1_COMPB ; Timer1 Compare B Handler
|
||||
reti ; TIMER0_COMPA ; Timer0 Compare A Handler
|
||||
reti ; TIMER0_COMPB ; Timer0 Compare B Handler
|
||||
reti ; USI_START ; USI Start Handler
|
||||
reti ; USI_OVERFLOW ; USI Overflow Handler
|
||||
reti ; EE_READY ; EEPROM Ready Handler
|
||||
reti ; WDT_OVERFLOW ; Watchdog Overflow Handler
|
||||
|
||||
Setup:
|
||||
cli ; Disable Interrupts
|
||||
ldi r16, low(RAMEND)
|
||||
out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
Main:
|
||||
rjmp Main ; infinite loop
|
||||
@@ -0,0 +1,5 @@
|
||||
:020000020000FC
|
||||
:1000000012C0189518951895189518951895189563
|
||||
:100010001895189518951895189518951895189578
|
||||
:0E002000189518951895F8940FED0DBFFFCFA9
|
||||
:00000001FF
|
||||
64
trunk/AVRProjects/00_ASM_Templates/ATTiny2313/tiny2313a.lst
Normal file
64
trunk/AVRProjects/00_ASM_Templates/ATTiny2313/tiny2313a.lst
Normal file
@@ -0,0 +1,64 @@
|
||||
gavrasm Gerd's AVR assembler version 3.5 (C)2015 by DG4FAC
|
||||
----------------------------------------------------------
|
||||
Source file: tiny2313a_primo.avr
|
||||
Hex file: tiny2313a_primo.hex
|
||||
Eeprom file: tiny2313a_primo.eep
|
||||
Compiled: 26.07.2016, 11:35:04
|
||||
Pass: 2
|
||||
1: ;* ******************************************************** *
|
||||
2: ; ATtiny 2313/4313 Pin map
|
||||
3: ; +-\/-+
|
||||
4: ; /Reset PA2 1|o |20 Vcc
|
||||
5: ; RXD PD0 2| |19 PB7 SCK
|
||||
6: ; TXD PD1 3| |18 PB6 MISO
|
||||
7: ; PA1 4| |17 PB5 MOSI
|
||||
8: ; PA0 5| |16 PB4 OC1B
|
||||
9: ; PD2 6| |15 PB3 OC1A
|
||||
10: ; PD3 7| |14 PB2 OC0A
|
||||
11: ; PD4 8| |13 PB1 AIN1
|
||||
12: ; OC0B PD5 9| |12 PB0 AIN0
|
||||
13: ; GND 10| |11 PD6
|
||||
14: ; +----+
|
||||
15: ;* ******************************************************** */
|
||||
16:
|
||||
17: ; Define processor type on top of the source code
|
||||
18: ;
|
||||
19: .DEVICE ATtiny2313A
|
||||
20:
|
||||
21: ; Int-Vector area
|
||||
22: .CSEG
|
||||
23: .ORG $0000
|
||||
24: 000000 C012 rjmp Setup ; for all types
|
||||
25: 000001 9518 reti ; External Int0 Vector, not used
|
||||
26: 000002 9518 reti ; External Int1 Vector, not used
|
||||
27: 000003 9518 reti ; Timer Tim1_Capt, not used
|
||||
28: 000004 9518 reti ; Timer Tim1_CompA, not used
|
||||
29: 000005 9518 reti ; Timer Tim1_Ovf, not used
|
||||
30: 000006 9518 reti ; Timer Tim0_Ovf, used
|
||||
31: 000007 9518 reti ; Usart_RXC, not used
|
||||
32: 000008 9518 reti ; Usart_dre, not used
|
||||
33: 000009 9518 reti ; Usart_TXC, not used
|
||||
34: 00000A 9518 reti ; ANA_COMP ; Analog Comparator Handler
|
||||
35: 00000B 9518 reti ; PCINT ; Pin Change Interrupt
|
||||
36: 00000C 9518 reti ; TIMER1_COMPB ; Timer1 Compare B Handler
|
||||
37: 00000D 9518 reti ; TIMER0_COMPA ; Timer0 Compare A Handler
|
||||
38: 00000E 9518 reti ; TIMER0_COMPB ; Timer0 Compare B Handler
|
||||
39: 00000F 9518 reti ; USI_START ; USI Start Handler
|
||||
40: 000010 9518 reti ; USI_OVERFLOW ; USI Overflow Handler
|
||||
41: 000011 9518 reti ; EE_READY ; EEPROM Ready Handler
|
||||
42: 000012 9518 reti ; WDT_OVERFLOW ; Watchdog Overflow Handler
|
||||
43:
|
||||
44: Setup:
|
||||
45: 000013 94F8 cli ; Disable Interrupts
|
||||
46: 000014 ED0F ldi r16, low(RAMEND)
|
||||
47: 000015 BF0D out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
48: Main:
|
||||
49: 000016 CFFF rjmp Main ; infinite loop
|
||||
|
||||
Program : 23 words.
|
||||
Constants : 0 words.
|
||||
Total program memory: 23 words.
|
||||
Eeprom space : 0 bytes.
|
||||
Data segment : 0 bytes.
|
||||
Compilation completed, no errors.
|
||||
Compilation endet 26.07.2016, 11:35:04
|
||||
40
trunk/AVRProjects/00_ASM_Templates/ATTiny45/tiny45.avr
Normal file
40
trunk/AVRProjects/00_ASM_Templates/ATTiny45/tiny45.avr
Normal file
@@ -0,0 +1,40 @@
|
||||
;* ******************************************************** *
|
||||
; ATtiny 13/45/85 Pin map
|
||||
; +-\/-+
|
||||
; /Reset ADC0 PB5 1|o |8 Vcc
|
||||
; ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
; ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
; GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
; +----+
|
||||
;* ******************************************************** */
|
||||
|
||||
; Define processor type on top of the source code
|
||||
;
|
||||
.DEVICE ATtiny45
|
||||
|
||||
; Int-Vector area
|
||||
.CSEG
|
||||
.ORG $0000
|
||||
rjmp Setup ;Reset
|
||||
reti ;INT0 - External Int0 Vector
|
||||
reti ;PCINT0 - Pin Change Interrupt handler
|
||||
reti ;TIM1_COMPA - Timer1 Compare match A Handler
|
||||
reti ;TIM1_OVF - Timer1 Overflow handler
|
||||
reti ;TIM0_OVF - Timer0 Overflow handler
|
||||
reti ;EE_RDY - EEPROM Ready Handler
|
||||
reti ;ANA_COMP - Analog Comparator Handler
|
||||
reti ;ADC - ADC Conversion Handler
|
||||
reti ;TIM1_COMPB - Timer1 Compare match B Handler
|
||||
reti ;TIM0_COMPA - Timer0 Compare match A Handler
|
||||
reti ;TIM0_COMPB - Timer0 Compare match B Handler
|
||||
reti ;WDT - Watchdog Overflow Handler
|
||||
reti ;USI_START - USI Start
|
||||
reti ;USI_OVF - USI Overflow
|
||||
|
||||
.ORG $000F
|
||||
Setup:
|
||||
cli ; Disable Interrupts
|
||||
ldi r16, low(RAMEND)
|
||||
out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
Main:
|
||||
rjmp Main ; infinite loop
|
||||
5
trunk/AVRProjects/00_ASM_Templates/ATTiny45/tiny45.hex
Normal file
5
trunk/AVRProjects/00_ASM_Templates/ATTiny45/tiny45.hex
Normal file
@@ -0,0 +1,5 @@
|
||||
:020000020000FC
|
||||
:100000000EC0189518951895189518951895189567
|
||||
:100010001895189518951895189518951895F89499
|
||||
:060020000FE50DBFFFCF4C
|
||||
:00000001FF
|
||||
55
trunk/AVRProjects/00_ASM_Templates/ATTiny45/tiny45.lst
Normal file
55
trunk/AVRProjects/00_ASM_Templates/ATTiny45/tiny45.lst
Normal file
@@ -0,0 +1,55 @@
|
||||
gavrasm Gerd's AVR assembler version 3.5 (C)2015 by DG4FAC
|
||||
----------------------------------------------------------
|
||||
Source file: tiny45_primo.avr
|
||||
Hex file: tiny45_primo.hex
|
||||
Eeprom file: tiny45_primo.eep
|
||||
Compiled: 26.07.2016, 11:33:17
|
||||
Pass: 2
|
||||
1: ;* ******************************************************** *
|
||||
2: ; ATtiny 13/45/85 Pin map
|
||||
3: ; +-\/-+
|
||||
4: ; /Reset ADC0 PB5 1|o |8 Vcc
|
||||
5: ; ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
6: ; ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
7: ; GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
8: ; +----+
|
||||
9: ;* ******************************************************** */
|
||||
10:
|
||||
11: ; Define processor type on top of the source code
|
||||
12: ;
|
||||
13: .DEVICE ATtiny45
|
||||
14:
|
||||
15: ; Int-Vector area
|
||||
16: .CSEG
|
||||
17: .ORG $0000
|
||||
18: 000000 C00E rjmp Setup ;Reset
|
||||
19: 000001 9518 reti ;INT0 - External Int0 Vector
|
||||
20: 000002 9518 reti ;PCINT0 - Pin Change Interrupt handler
|
||||
21: 000003 9518 reti ;TIM1_COMPA - Timer1 Compare match A Handler
|
||||
22: 000004 9518 reti ;TIM1_OVF - Timer1 Overflow handler
|
||||
23: 000005 9518 reti ;TIM0_OVF - Timer0 Overflow handler
|
||||
24: 000006 9518 reti ;EE_RDY - EEPROM Ready Handler
|
||||
25: 000007 9518 reti ;ANA_COMP - Analog Comparator Handler
|
||||
26: 000008 9518 reti ;ADC - ADC Conversion Handler
|
||||
27: 000009 9518 reti ;TIM1_COMPB - Timer1 Compare match B Handler
|
||||
28: 00000A 9518 reti ;TIM0_COMPA - Timer0 Compare match A Handler
|
||||
29: 00000B 9518 reti ;TIM0_COMPB - Timer0 Compare match B Handler
|
||||
30: 00000C 9518 reti ;WDT - Watchdog Overflow Handler
|
||||
31: 00000D 9518 reti ;USI_START - USI Start
|
||||
32: 00000E 9518 reti ;USI_OVF - USI Overflow
|
||||
33:
|
||||
34: .ORG $000F
|
||||
35: Setup:
|
||||
36: 00000F 94F8 cli ; Disable Interrupts
|
||||
37: 000010 E50F ldi r16, low(RAMEND)
|
||||
38: 000011 BF0D out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
39: Main:
|
||||
40: 000012 CFFF rjmp Main ; infinite loop
|
||||
|
||||
Program : 19 words.
|
||||
Constants : 0 words.
|
||||
Total program memory: 19 words.
|
||||
Eeprom space : 0 bytes.
|
||||
Data segment : 0 bytes.
|
||||
Compilation completed, no errors.
|
||||
Compilation endet 26.07.2016, 11:33:17
|
||||
40
trunk/AVRProjects/00_ASM_Templates/ATTiny85/tiny85.avr
Normal file
40
trunk/AVRProjects/00_ASM_Templates/ATTiny85/tiny85.avr
Normal file
@@ -0,0 +1,40 @@
|
||||
;* ******************************************************** *
|
||||
; ATtiny 13/45/85 Pin map
|
||||
; +-\/-+
|
||||
; /Reset ADC0 PB5 1|o |8 Vcc
|
||||
; ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
; ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
; GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
; +----+
|
||||
;* ******************************************************** */
|
||||
|
||||
; Define processor type on top of the source code
|
||||
;
|
||||
.DEVICE ATtiny85
|
||||
|
||||
; Int-Vector area
|
||||
.CSEG
|
||||
.ORG $0000
|
||||
rjmp Setup ;Reset
|
||||
reti ;INT0 - External Int0 Vector
|
||||
reti ;PCINT0 - Pin Change Interrupt handler
|
||||
reti ;TIM1_COMPA - Timer1 Compare match A Handler
|
||||
reti ;TIM1_OVF - Timer1 Overflow handler
|
||||
reti ;TIM0_OVF - Timer0 Overflow handler
|
||||
reti ;EE_RDY - EEPROM Ready Handler
|
||||
reti ;ANA_COMP - Analog Comparator Handler
|
||||
reti ;ADC - ADC Conversion Handler
|
||||
reti ;TIM1_COMPB - Timer1 Compare match B Handler
|
||||
reti ;TIM0_COMPA - Timer0 Compare match A Handler
|
||||
reti ;TIM0_COMPB - Timer0 Compare match B Handler
|
||||
reti ;WDT - Watchdog Overflow Handler
|
||||
reti ;USI_START - USI Start
|
||||
reti ;USI_OVF - USI Overflow
|
||||
|
||||
.ORG $000F
|
||||
Setup:
|
||||
cli ; Disable Interrupts
|
||||
ldi r16, low(RAMEND)
|
||||
out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
Main:
|
||||
rjmp Main ; infinite loop
|
||||
5
trunk/AVRProjects/00_ASM_Templates/ATTiny85/tiny85.hex
Normal file
5
trunk/AVRProjects/00_ASM_Templates/ATTiny85/tiny85.hex
Normal file
@@ -0,0 +1,5 @@
|
||||
:020000020000FC
|
||||
:100000000EC0189518951895189518951895189567
|
||||
:100010001895189518951895189518951895F89499
|
||||
:060020000FE50DBFFFCF4C
|
||||
:00000001FF
|
||||
55
trunk/AVRProjects/00_ASM_Templates/ATTiny85/tiny85.lst
Normal file
55
trunk/AVRProjects/00_ASM_Templates/ATTiny85/tiny85.lst
Normal file
@@ -0,0 +1,55 @@
|
||||
gavrasm Gerd's AVR assembler version 3.5 (C)2015 by DG4FAC
|
||||
----------------------------------------------------------
|
||||
Source file: tiny85_primo.avr
|
||||
Hex file: tiny85_primo.hex
|
||||
Eeprom file: tiny85_primo.eep
|
||||
Compiled: 26.07.2016, 11:33:50
|
||||
Pass: 2
|
||||
1: ;* ******************************************************** *
|
||||
2: ; ATtiny 13/45/85 Pin map
|
||||
3: ; +-\/-+
|
||||
4: ; /Reset ADC0 PB5 1|o |8 Vcc
|
||||
5: ; ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
6: ; ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
7: ; GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
8: ; +----+
|
||||
9: ;* ******************************************************** */
|
||||
10:
|
||||
11: ; Define processor type on top of the source code
|
||||
12: ;
|
||||
13: .DEVICE ATtiny85
|
||||
14:
|
||||
15: ; Int-Vector area
|
||||
16: .CSEG
|
||||
17: .ORG $0000
|
||||
18: 000000 C00E rjmp Setup ;Reset
|
||||
19: 000001 9518 reti ;INT0 - External Int0 Vector
|
||||
20: 000002 9518 reti ;PCINT0 - Pin Change Interrupt handler
|
||||
21: 000003 9518 reti ;TIM1_COMPA - Timer1 Compare match A Handler
|
||||
22: 000004 9518 reti ;TIM1_OVF - Timer1 Overflow handler
|
||||
23: 000005 9518 reti ;TIM0_OVF - Timer0 Overflow handler
|
||||
24: 000006 9518 reti ;EE_RDY - EEPROM Ready Handler
|
||||
25: 000007 9518 reti ;ANA_COMP - Analog Comparator Handler
|
||||
26: 000008 9518 reti ;ADC - ADC Conversion Handler
|
||||
27: 000009 9518 reti ;TIM1_COMPB - Timer1 Compare match B Handler
|
||||
28: 00000A 9518 reti ;TIM0_COMPA - Timer0 Compare match A Handler
|
||||
29: 00000B 9518 reti ;TIM0_COMPB - Timer0 Compare match B Handler
|
||||
30: 00000C 9518 reti ;WDT - Watchdog Overflow Handler
|
||||
31: 00000D 9518 reti ;USI_START - USI Start
|
||||
32: 00000E 9518 reti ;USI_OVF - USI Overflow
|
||||
33:
|
||||
34: .ORG $000F
|
||||
35: Setup:
|
||||
36: 00000F 94F8 cli ; Disable Interrupts
|
||||
37: 000010 E50F ldi r16, low(RAMEND)
|
||||
38: 000011 BF0D out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
39: Main:
|
||||
40: 000012 CFFF rjmp Main ; infinite loop
|
||||
|
||||
Program : 19 words.
|
||||
Constants : 0 words.
|
||||
Total program memory: 19 words.
|
||||
Eeprom space : 0 bytes.
|
||||
Data segment : 0 bytes.
|
||||
Compilation completed, no errors.
|
||||
Compilation endet 26.07.2016, 11:33:50
|
||||
44
trunk/AVRProjects/00_C_Templates/ATMega1284/main.c
Normal file
44
trunk/AVRProjects/00_C_Templates/ATMega1284/main.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATmega 1284 Pin map
|
||||
+-\/-+
|
||||
PB0 1|o |40 PA0 ADC0
|
||||
PB1 2| |39 PA1 ADC1
|
||||
AIN0 PB2 3| |38 PA2 ADC2
|
||||
AIN1 OC0A PB3 4| |37 PA3 ADC3
|
||||
OC0B PB4 5| |36 PA4 ADC4
|
||||
MOSI PB5 6| |35 PA5 ADC5
|
||||
MISO PB6 7| |34 PA6 ADC6
|
||||
SCK PB7 8| |33 PA7 ADC7
|
||||
/Reset 9| |32 AREF
|
||||
VCC 10| |31 GND
|
||||
GND 11| |30 AVCC
|
||||
XTAL1 12| |29 PC7
|
||||
XTAL2 13| |28 PC6
|
||||
RXD0 PD0 14| |27 PC5
|
||||
TXD0 PD1 15| |26 PC4
|
||||
RXD1 PD2 16| |25 PC3
|
||||
TXD1 PD3 17| |24 PC2
|
||||
OC1B PD4 18| |23 PC1 SDA
|
||||
OC1A PD5 19| |22 PC0 SCL
|
||||
OC2B PD6 20| |21 PD7 OC2A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
18
trunk/AVRProjects/00_C_Templates/ATMega1284/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATMega1284/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 1000000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
442
trunk/AVRProjects/00_C_Templates/ATMega1284/makefile
Normal file
442
trunk/AVRProjects/00_C_Templates/ATMega1284/makefile
Normal file
@@ -0,0 +1,442 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega1284p
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 4190000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
38
trunk/AVRProjects/00_C_Templates/ATMega168/main.c
Normal file
38
trunk/AVRProjects/00_C_Templates/ATMega168/main.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 88 / Mega 168 / Mega 328 Pin map
|
||||
+-\/-+
|
||||
/Reset PC6 1|o |28 PC5 ADC5
|
||||
RXD PD0 2| |27 PC4 ADC4
|
||||
TXD PD1 3| |26 PC3 ADC3
|
||||
PD2 4| |25 PC2 ADC2
|
||||
OC2B PD3 5| |24 PC1 ADC1
|
||||
PD4 6| |23 PC0 ADC0
|
||||
VCC 7| |22 GND
|
||||
GND 8| |21 AREF
|
||||
OSC1 PB6 9| |20 VCC
|
||||
OSC2 PB7 10| |19 PB5 SCK
|
||||
OC0B PD5 11| |18 PB4 MISO
|
||||
AIN0 OC0A PD6 12| |17 PB3 OC2A MOSI
|
||||
AIN1 PD7 13| |16 PB2 OC1B
|
||||
PB0 14| |15 PB1 OC1A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
18
trunk/AVRProjects/00_C_Templates/ATMega168/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATMega168/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 1000000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATMega168/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATMega168/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega168p
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 8000000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
38
trunk/AVRProjects/00_C_Templates/ATMega328/main.c
Normal file
38
trunk/AVRProjects/00_C_Templates/ATMega328/main.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 88 / Mega 168 / Mega 328 Pin map
|
||||
+-\/-+
|
||||
/Reset PC6 1|o |28 PC5 ADC5
|
||||
RXD PD0 2| |27 PC4 ADC4
|
||||
TXD PD1 3| |26 PC3 ADC3
|
||||
PD2 4| |25 PC2 ADC2
|
||||
OC2B PD3 5| |24 PC1 ADC1
|
||||
PD4 6| |23 PC0 ADC0
|
||||
VCC 7| |22 GND
|
||||
GND 8| |21 AREF
|
||||
OSC1 PB6 9| |20 VCC
|
||||
OSC2 PB7 10| |19 PB5 SCK
|
||||
OC0B PD5 11| |18 PB4 MISO
|
||||
AIN0 OC0A PD6 12| |17 PB3 OC2A MOSI
|
||||
AIN1 PD7 13| |16 PB2 OC1B
|
||||
PB0 14| |15 PB1 OC1A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
18
trunk/AVRProjects/00_C_Templates/ATMega328/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATMega328/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 1000000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATMega328/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATMega328/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega328
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 4190000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
38
trunk/AVRProjects/00_C_Templates/ATMega48/main.c
Normal file
38
trunk/AVRProjects/00_C_Templates/ATMega48/main.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 88 / Mega 168 / Mega 328 Pin map
|
||||
+-\/-+
|
||||
/Reset PC6 1|o |28 PC5 ADC5
|
||||
RXD PD0 2| |27 PC4 ADC4
|
||||
TXD PD1 3| |26 PC3 ADC3
|
||||
PD2 4| |25 PC2 ADC2
|
||||
OC2B PD3 5| |24 PC1 ADC1
|
||||
PD4 6| |23 PC0 ADC0
|
||||
VCC 7| |22 GND
|
||||
GND 8| |21 AREF
|
||||
OSC1 PB6 9| |20 VCC
|
||||
OSC2 PB7 10| |19 PB5 SCK
|
||||
OC0B PD5 11| |18 PB4 MISO
|
||||
AIN0 OC0A PD6 12| |17 PB3 OC2A MOSI
|
||||
AIN1 PD7 13| |16 PB2 OC1B
|
||||
PB0 14| |15 PB1 OC1A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
18
trunk/AVRProjects/00_C_Templates/ATMega48/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATMega48/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 1000000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATMega48/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATMega48/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega48v
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 8000000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
26
trunk/AVRProjects/00_C_Templates/ATTiny13/main.c
Normal file
26
trunk/AVRProjects/00_C_Templates/ATTiny13/main.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 13/45/85 Pin map
|
||||
+-\/-+
|
||||
/Reset ADC0 PB5 1|o |8 Vcc
|
||||
ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
}
|
||||
18
trunk/AVRProjects/00_C_Templates/ATTiny13/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATTiny13/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 9600000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATTiny13/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATTiny13/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = attiny13
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
#F_OSC = 9600000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
34
trunk/AVRProjects/00_C_Templates/ATTiny2313/main.c
Normal file
34
trunk/AVRProjects/00_C_Templates/ATTiny2313/main.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 2313/4313 Pin map
|
||||
+-\/-+
|
||||
/Reset PA2 1|o |20 Vcc
|
||||
RXD PD0 2| |19 PB7 SCK
|
||||
TXD PD1 3| |18 PB6 MISO
|
||||
PA1 4| |17 PB5 MOSI
|
||||
PA0 5| |16 PB4 OC1B
|
||||
PD2 6| |15 PB3 OC1A
|
||||
PD3 7| |14 PB2 OC0A
|
||||
PD4 8| |13 PB1 AIN1
|
||||
OC0B PD5 9| |12 PB0 AIN0
|
||||
GND 10| |11 PD6
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
18
trunk/AVRProjects/00_C_Templates/ATTiny2313/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATTiny2313/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 1000000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATTiny2313/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATTiny2313/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = attiny2313
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 1000000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
26
trunk/AVRProjects/00_C_Templates/ATTiny45/main.c
Normal file
26
trunk/AVRProjects/00_C_Templates/ATTiny45/main.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 13/45/85 Pin map
|
||||
+-\/-+
|
||||
/Reset ADC0 PB5 1|o |8 Vcc
|
||||
ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
}
|
||||
18
trunk/AVRProjects/00_C_Templates/ATTiny45/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATTiny45/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 9600000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATTiny45/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATTiny45/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = attiny45
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
#F_OSC = 9600000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
31
trunk/AVRProjects/00_C_Templates/ATTiny84/main.c
Normal file
31
trunk/AVRProjects/00_C_Templates/ATTiny84/main.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 84 Pin map
|
||||
+-\/-+
|
||||
GND 1|o |14 GND
|
||||
PB0 2| |13 PA0 ADC0
|
||||
PB1 3| |12 PA1 ADC1
|
||||
/Reset PB3 4| |11 PA2 ADC2
|
||||
PB2 5| |10 PA3 ADC3
|
||||
ADC7 PA7 6| |9 PA4 ADC4 SCK
|
||||
MOSI ADC6 PA6 7| |8 PA5 ADC5 MISO
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
18
trunk/AVRProjects/00_C_Templates/ATTiny84/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATTiny84/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 1000000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATTiny84/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATTiny84/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = attiny84
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
#F_OSC = 9600000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
26
trunk/AVRProjects/00_C_Templates/ATTiny85/main.c
Normal file
26
trunk/AVRProjects/00_C_Templates/ATTiny85/main.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 13/45/85 Pin map
|
||||
+-\/-+
|
||||
/Reset ADC0 PB5 1|o |8 Vcc
|
||||
ADC3 PB3 2| |7 PB2 ADC1 SCK
|
||||
ADC2 PB4 3| |6 PB1 OC0B MISO AIN1
|
||||
GND 4| |5 PB0 OC0A MOSI AIN0
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
}
|
||||
18
trunk/AVRProjects/00_C_Templates/ATTiny85/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATTiny85/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 9600000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATTiny85/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATTiny85/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = attiny85
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
#F_OSC = 9600000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
38
trunk/AVRProjects/00_C_Templates/ATTiny88/main.c
Normal file
38
trunk/AVRProjects/00_C_Templates/ATTiny88/main.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 88 / Mega 168 / Mega 328 Pin map
|
||||
+-\/-+
|
||||
/Reset PC6 1|o |28 PC5 ADC5
|
||||
RXD PD0 2| |27 PC4 ADC4
|
||||
TXD PD1 3| |26 PC3 ADC3
|
||||
PD2 4| |25 PC2 ADC2
|
||||
OC2B PD3 5| |24 PC1 ADC1
|
||||
PD4 6| |23 PC0 ADC0
|
||||
VCC 7| |22 GND
|
||||
GND 8| |21 AREF
|
||||
OSC1 PB6 9| |20 VCC
|
||||
OSC2 PB7 10| |19 PB5 SCK
|
||||
OC0B PD5 11| |18 PB4 MISO
|
||||
AIN0 OC0A PD6 12| |17 PB3 OC2A MOSI
|
||||
AIN1 PD7 13| |16 PB2 OC1B
|
||||
PB0 14| |15 PB1 OC1A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
// Enter your code here
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
18
trunk/AVRProjects/00_C_Templates/ATTiny88/main.h
Normal file
18
trunk/AVRProjects/00_C_Templates/ATTiny88/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 9600000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
441
trunk/AVRProjects/00_C_Templates/ATTiny88/makefile
Normal file
441
trunk/AVRProjects/00_C_Templates/ATTiny88/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = attiny88
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 4190000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
43
trunk/AVRProjects/ATMega1284/.dep/main.o.d
Normal file
43
trunk/AVRProjects/ATMega1284/.dep/main.o.d
Normal file
@@ -0,0 +1,43 @@
|
||||
main.o: main.c \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\io.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\sfr_defs.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\inttypes.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\stdint.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom1284p.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\portpins.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\common.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\version.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\fuse.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\lock.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay_basic.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\math.h
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\io.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\sfr_defs.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\inttypes.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\stdint.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom1284p.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\portpins.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\common.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\version.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\fuse.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\lock.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay_basic.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\math.h:
|
||||
50
trunk/AVRProjects/ATMega1284/main.c
Normal file
50
trunk/AVRProjects/ATMega1284/main.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATmega 1284 Pin map
|
||||
+-\/-+
|
||||
PB0 1|o |40 PA0 ADC0
|
||||
PB1 2| |39 PA1 ADC1
|
||||
AIN0 PB2 3| |38 PA2 ADC2
|
||||
AIN1 OC0A PB3 4| |37 PA3 ADC3
|
||||
OC0B PB4 5| |36 PA4 ADC4
|
||||
MOSI PB5 6| |35 PA5 ADC5
|
||||
MISO PB6 7| |34 PA6 ADC6
|
||||
SCK PB7 8| |33 PA7 ADC7
|
||||
/Reset 9| |32 AREF
|
||||
VCC 10| |31 GND
|
||||
GND 11| |30 AVCC
|
||||
XTAL1 12| |29 PC7
|
||||
XTAL2 13| |28 PC6
|
||||
RXD0 PD0 14| |27 PC5
|
||||
TXD0 PD1 15| |26 PC4
|
||||
RXD1 PD2 16| |25 PC3
|
||||
TXD1 PD3 17| |24 PC2
|
||||
OC1B PD4 18| |23 PC1 SDA
|
||||
OC1A PD5 19| |22 PC0 SCL
|
||||
OC2B PD6 20| |21 PD7 OC2A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000001;
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
PORTB = zwischenspeicher;
|
||||
_delay_ms(500);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
1
trunk/AVRProjects/ATMega1284/main.eep
Normal file
1
trunk/AVRProjects/ATMega1284/main.eep
Normal file
@@ -0,0 +1 @@
|
||||
:00000001FF
|
||||
BIN
trunk/AVRProjects/ATMega1284/main.elf
Normal file
BIN
trunk/AVRProjects/ATMega1284/main.elf
Normal file
Binary file not shown.
14
trunk/AVRProjects/ATMega1284/main.hex
Normal file
14
trunk/AVRProjects/ATMega1284/main.hex
Normal file
@@ -0,0 +1,14 @@
|
||||
:100000000C9446000C9450000C9450000C9450003A
|
||||
:100010000C9450000C9450000C9450000C94500020
|
||||
:100020000C9450000C9450000C9450000C94500010
|
||||
:100030000C9450000C9450000C9450000C94500000
|
||||
:100040000C9450000C9450000C9450000C945000F0
|
||||
:100050000C9450000C9450000C9450000C945000E0
|
||||
:100060000C9450000C9450000C9450000C945000D0
|
||||
:100070000C9450000C9450000C9450000C945000C0
|
||||
:100080000C9450000C9450000C94500011241FBE8E
|
||||
:10009000CFEFD0E4DEBFCDBF0E9452000C946200CF
|
||||
:1000A0000C94000081E084B991E085B1892785B97D
|
||||
:1000B0002FE936E881E0215030408040E1F700C070
|
||||
:0800C0000000F3CFF894FFCF1C
|
||||
:00000001FF
|
||||
127
trunk/AVRProjects/ATMega1284/main.lss
Normal file
127
trunk/AVRProjects/ATMega1284/main.lss
Normal file
@@ -0,0 +1,127 @@
|
||||
|
||||
main.elf: file format elf32-avr
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .data 00000000 00800100 000000c8 0000013c 2**0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
1 .text 000000c8 00000000 00000000 00000074 2**1
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
2 .comment 00000011 00000000 00000000 0000013c 2**0
|
||||
CONTENTS, READONLY
|
||||
3 .debug_aranges 00000020 00000000 00000000 0000014d 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
4 .debug_info 00000119 00000000 00000000 0000016d 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
5 .debug_abbrev 000000d1 00000000 00000000 00000286 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
6 .debug_line 000000d7 00000000 00000000 00000357 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
7 .debug_frame 00000024 00000000 00000000 00000430 2**2
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
8 .debug_str 00000137 00000000 00000000 00000454 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
9 .debug_loc 0000001f 00000000 00000000 0000058b 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
10 .debug_ranges 00000010 00000000 00000000 000005aa 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <__vectors>:
|
||||
0: 0c 94 46 00 jmp 0x8c ; 0x8c <__ctors_end>
|
||||
4: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
8: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
10: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
14: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
18: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
1c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
20: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
24: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
28: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
2c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
30: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
34: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
38: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
3c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
40: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
44: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
48: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
4c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
50: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
54: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
58: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
5c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
60: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
64: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
68: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
6c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
70: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
74: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
78: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
7c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
80: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
84: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
88: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__bad_interrupt>
|
||||
|
||||
0000008c <__ctors_end>:
|
||||
8c: 11 24 eor r1, r1
|
||||
8e: 1f be out 0x3f, r1 ; 63
|
||||
90: cf ef ldi r28, 0xFF ; 255
|
||||
92: d0 e4 ldi r29, 0x40 ; 64
|
||||
94: de bf out 0x3e, r29 ; 62
|
||||
96: cd bf out 0x3d, r28 ; 61
|
||||
98: 0e 94 52 00 call 0xa4 ; 0xa4 <main>
|
||||
9c: 0c 94 62 00 jmp 0xc4 ; 0xc4 <_exit>
|
||||
|
||||
000000a0 <__bad_interrupt>:
|
||||
a0: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
|
||||
|
||||
000000a4 <main>:
|
||||
#include <util/delay.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000001;
|
||||
a4: 81 e0 ldi r24, 0x01 ; 1
|
||||
a6: 84 b9 out 0x04, r24 ; 4
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
a8: 91 e0 ldi r25, 0x01 ; 1
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000001;
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
aa: 85 b1 in r24, 0x05 ; 5
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
ac: 89 27 eor r24, r25
|
||||
PORTB = zwischenspeicher;
|
||||
ae: 85 b9 out 0x05, r24 ; 5
|
||||
#else
|
||||
//round up by default
|
||||
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
#endif
|
||||
|
||||
__builtin_avr_delay_cycles(__ticks_dc);
|
||||
b0: 2f e9 ldi r18, 0x9F ; 159
|
||||
b2: 36 e8 ldi r19, 0x86 ; 134
|
||||
b4: 81 e0 ldi r24, 0x01 ; 1
|
||||
b6: 21 50 subi r18, 0x01 ; 1
|
||||
b8: 30 40 sbci r19, 0x00 ; 0
|
||||
ba: 80 40 sbci r24, 0x00 ; 0
|
||||
bc: e1 f7 brne .-8 ; 0xb6 <main+0x12>
|
||||
be: 00 c0 rjmp .+0 ; 0xc0 <main+0x1c>
|
||||
c0: 00 00 nop
|
||||
c2: f3 cf rjmp .-26 ; 0xaa <main+0x6>
|
||||
|
||||
000000c4 <_exit>:
|
||||
c4: f8 94 cli
|
||||
|
||||
000000c6 <__stop_program>:
|
||||
c6: ff cf rjmp .-2 ; 0xc6 <__stop_program>
|
||||
245
trunk/AVRProjects/ATMega1284/main.lst
Normal file
245
trunk/AVRProjects/ATMega1284/main.lst
Normal file
@@ -0,0 +1,245 @@
|
||||
1 .file "main.c"
|
||||
2 __SP_H__ = 0x3e
|
||||
3 __SP_L__ = 0x3d
|
||||
4 __SREG__ = 0x3f
|
||||
5 __RAMPZ__ = 0x3b
|
||||
6 __tmp_reg__ = 0
|
||||
7 __zero_reg__ = 1
|
||||
8 .text
|
||||
9 .Ltext0:
|
||||
10 .cfi_sections .debug_frame
|
||||
11 .section .text.startup,"ax",@progbits
|
||||
12 .global main
|
||||
14 main:
|
||||
15 .LFB6:
|
||||
16 .file 1 "main.c"
|
||||
1:main.c **** #include <avr/io.h>
|
||||
2:main.c **** #include <util/delay.h>
|
||||
3:main.c ****
|
||||
4:main.c **** int main (void)
|
||||
5:main.c **** {
|
||||
17 .loc 1 5 0
|
||||
18 .cfi_startproc
|
||||
19 /* prologue: function */
|
||||
20 /* frame size = 0 */
|
||||
21 /* stack size = 0 */
|
||||
22 .L__stack_usage = 0
|
||||
6:main.c **** unsigned char zwischenspeicher;
|
||||
7:main.c **** DDRB = 0b00000001;
|
||||
23 .loc 1 7 0
|
||||
24 0000 81E0 ldi r24,lo8(1)
|
||||
25 0002 84B9 out 0x4,r24
|
||||
8:main.c **** while(1)
|
||||
9:main.c **** {
|
||||
10:main.c **** zwischenspeicher = PORTB;
|
||||
11:main.c **** zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
26 .loc 1 11 0
|
||||
27 0004 91E0 ldi r25,lo8(1)
|
||||
28 .L2:
|
||||
10:main.c **** zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
29 .loc 1 10 0 discriminator 1
|
||||
30 0006 85B1 in r24,0x5
|
||||
31 .LVL0:
|
||||
32 .loc 1 11 0 discriminator 1
|
||||
33 0008 8927 eor r24,r25
|
||||
34 .LVL1:
|
||||
12:main.c **** PORTB = zwischenspeicher;
|
||||
35 .loc 1 12 0 discriminator 1
|
||||
36 000a 85B9 out 0x5,r24
|
||||
37 .LVL2:
|
||||
38 .LBB4:
|
||||
39 .LBB5:
|
||||
40 .file 2 "e:\\progs\\arduino-1.7.4\\hardware\\tools\\avr\\avr\\include\\util\\delay.h"
|
||||
1:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* Copyright (c) 2002, Marek Michalkiewicz
|
||||
2:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Copyright (c) 2004,2005,2007 Joerg Wunsch
|
||||
3:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Copyright (c) 2007 Florin-Viorel Petrov
|
||||
4:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** All rights reserved.
|
||||
5:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
6:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Redistribution and use in source and binary forms, with or without
|
||||
7:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** modification, are permitted provided that the following conditions are met:
|
||||
8:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
9:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Redistributions of source code must retain the above copyright
|
||||
10:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** notice, this list of conditions and the following disclaimer.
|
||||
11:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
12:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Redistributions in binary form must reproduce the above copyright
|
||||
13:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** notice, this list of conditions and the following disclaimer in
|
||||
14:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** the documentation and/or other materials provided with the
|
||||
15:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** distribution.
|
||||
16:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
17:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Neither the name of the copyright holders nor the names of
|
||||
18:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** contributors may be used to endorse or promote products derived
|
||||
19:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** from this software without specific prior written permission.
|
||||
20:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
21:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
22:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
23:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
24:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
25:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
26:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
27:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
28:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
29:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
30:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
31:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** POSSIBILITY OF SUCH DAMAGE. */
|
||||
32:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
33:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* $Id$ */
|
||||
34:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
35:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef _UTIL_DELAY_H_
|
||||
36:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define _UTIL_DELAY_H_ 1
|
||||
37:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
38:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef __HAS_DELAY_CYCLES
|
||||
39:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define __HAS_DELAY_CYCLES 1
|
||||
40:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
41:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
42:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <inttypes.h>
|
||||
43:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <util/delay_basic.h>
|
||||
44:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <math.h>
|
||||
45:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
46:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /** \file */
|
||||
47:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /** \defgroup util_delay <util/delay.h>: Convenience functions for busy-wait delay loops
|
||||
48:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \code
|
||||
49:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define F_CPU 1000000UL // 1 MHz
|
||||
50:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** //#define F_CPU 14.7456E6
|
||||
51:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <util/delay.h>
|
||||
52:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \endcode
|
||||
53:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
54:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \note As an alternative method, it is possible to pass the
|
||||
55:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** F_CPU macro down to the compiler from the Makefile.
|
||||
56:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Obviously, in that case, no \c \#define statement should be
|
||||
57:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** used.
|
||||
58:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
59:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The functions in this header file are wrappers around the basic
|
||||
60:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** busy-wait functions from <util/delay_basic.h>. They are meant as
|
||||
61:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** convenience functions where actual time values can be specified
|
||||
62:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** rather than a number of cycles to wait for. The idea behind is
|
||||
63:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** that compile-time constant expressions will be eliminated by
|
||||
64:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** compiler optimization so floating-point expressions can be used
|
||||
65:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** to calculate the number of delay cycles needed based on the CPU
|
||||
66:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** frequency passed by the macro F_CPU.
|
||||
67:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
68:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \note In order for these functions to work as intended, compiler
|
||||
69:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** optimizations <em>must</em> be enabled, and the delay time
|
||||
70:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** <em>must</em> be an expression that is a known constant at
|
||||
71:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** compile-time. If these requirements are not met, the resulting
|
||||
72:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** delay will be much longer (and basically unpredictable), and
|
||||
73:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** applications that otherwise do not use floating-point calculations
|
||||
74:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** will experience severe code bloat by the floating-point library
|
||||
75:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** routines linked into the application.
|
||||
76:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
77:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The functions available allow the specification of microsecond, and
|
||||
78:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** millisecond delays directly, using the application-supplied macro
|
||||
79:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** F_CPU as the CPU clock frequency (in Hertz).
|
||||
80:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
81:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** */
|
||||
82:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
83:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if !defined(__DOXYGEN__)
|
||||
84:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** static inline void _delay_us(double __us) __attribute__((always_inline));
|
||||
85:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** static inline void _delay_ms(double __ms) __attribute__((always_inline));
|
||||
86:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
87:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
88:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef F_CPU
|
||||
89:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* prevent compiler error by supplying a default */
|
||||
90:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # warning "F_CPU not defined for <util/delay.h>"
|
||||
91:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # define F_CPU 1000000UL
|
||||
92:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
93:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
94:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef __OPTIMIZE__
|
||||
95:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
|
||||
96:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
97:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
98:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
||||
99:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
||||
100:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __STDC_HOSTED__
|
||||
101:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # include <math.h>
|
||||
102:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
103:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
104:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /**
|
||||
105:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \ingroup util_delay
|
||||
106:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
107:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Perform a delay of \c __ms milliseconds, using _delay_loop_2().
|
||||
108:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
109:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The macro F_CPU is supposed to be defined to a
|
||||
110:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** constant defining the CPU clock frequency (in Hertz).
|
||||
111:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
112:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The maximal possible delay is 262.14 ms / F_CPU in MHz.
|
||||
113:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
114:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** When the user request delay which exceed the maximum possible one,
|
||||
115:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** _delay_ms() provides a decreased resolution functionality. In this
|
||||
116:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** mode _delay_ms() will work with a resolution of 1/10 ms, providing
|
||||
117:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** delays up to 6.5535 seconds (independent from CPU frequency). The
|
||||
118:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** user will not be informed about decreased resolution.
|
||||
119:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
120:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long)
|
||||
121:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** support, maximal possible delay is 4294967.295 ms/ F_CPU in MHz. For
|
||||
122:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** values greater than the maximal possible delay, overflows results in
|
||||
123:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** no delay i.e., 0ms.
|
||||
124:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
125:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Conversion of __us into clock cycles may not always result in integer.
|
||||
126:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** By default, the clock cycles rounded up to next integer. This ensures that
|
||||
127:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** the user gets atleast __us microseconds of delay.
|
||||
128:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
129:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Alternatively, user can define __DELAY_ROUND_DOWN__ and __DELAY_ROUND_CLOSEST__
|
||||
130:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** to round down and round to closest integer.
|
||||
131:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
132:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Note: The new implementation of _delay_ms(double __ms) with
|
||||
133:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __builtin_avr_delay_cycles(unsigned long) support is not backward compatible.
|
||||
134:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay.
|
||||
135:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Also, the backward compatible
|
||||
136:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** algorithm will be chosen if the code is compiled in a <em>freestanding
|
||||
137:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** environment</em> (GCC option \c -ffreestanding), as the math functions
|
||||
138:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** required for rounding are not available to the compiler then.
|
||||
139:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
140:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** */
|
||||
141:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** void
|
||||
142:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** _delay_ms(double __ms)
|
||||
143:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** {
|
||||
144:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** double __tmp ;
|
||||
145:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
||||
146:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
||||
147:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __STDC_HOSTED__
|
||||
148:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** uint32_t __ticks_dc;
|
||||
149:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** extern void __builtin_avr_delay_cycles(unsigned long);
|
||||
150:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __tmp = ((F_CPU) / 1e3) * __ms;
|
||||
151:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
152:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if defined(__DELAY_ROUND_DOWN__)
|
||||
153:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)fabs(__tmp);
|
||||
154:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
155:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #elif defined(__DELAY_ROUND_CLOSEST__)
|
||||
156:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)(fabs(__tmp)+0.5);
|
||||
157:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
158:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #else
|
||||
159:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** //round up by default
|
||||
160:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
161:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
162:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
163:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __builtin_avr_delay_cycles(__ticks_dc);
|
||||
41 .loc 2 163 0 discriminator 1
|
||||
42 000c 2FE9 ldi r18,lo8(99999)
|
||||
43 000e 36E8 ldi r19,hi8(99999)
|
||||
44 0010 81E0 ldi r24,hlo8(99999)
|
||||
45 0012 2150 1: subi r18,1
|
||||
46 0014 3040 sbci r19,0
|
||||
47 0016 8040 sbci r24,0
|
||||
48 0018 01F4 brne 1b
|
||||
49 .LVL3:
|
||||
50 001a 00C0 rjmp .
|
||||
51 001c 0000 nop
|
||||
52 001e 00C0 rjmp .L2
|
||||
53 .LBE5:
|
||||
54 .LBE4:
|
||||
55 .cfi_endproc
|
||||
56 .LFE6:
|
||||
58 .text
|
||||
59 .Letext0:
|
||||
60 .file 3 "e:\\progs\\arduino-1.7.4\\hardware\\tools\\avr\\avr\\include\\stdint.h"
|
||||
DEFINED SYMBOLS
|
||||
*ABS*:00000000 main.c
|
||||
C:\Users\q242695\AppData\Local\Temp\ccaDJnRY.s:2 *ABS*:0000003e __SP_H__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccaDJnRY.s:3 *ABS*:0000003d __SP_L__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccaDJnRY.s:4 *ABS*:0000003f __SREG__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccaDJnRY.s:5 *ABS*:0000003b __RAMPZ__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccaDJnRY.s:6 *ABS*:00000000 __tmp_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccaDJnRY.s:7 *ABS*:00000001 __zero_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccaDJnRY.s:14 .text.startup:00000000 main
|
||||
|
||||
NO UNDEFINED SYMBOLS
|
||||
447
trunk/AVRProjects/ATMega1284/main.map
Normal file
447
trunk/AVRProjects/ATMega1284/main.map
Normal file
@@ -0,0 +1,447 @@
|
||||
Archive member included because of file (symbol)
|
||||
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o (exit)
|
||||
|
||||
Memory Configuration
|
||||
|
||||
Name Origin Length Attributes
|
||||
text 0x00000000 0x00020000 xr
|
||||
data 0x00800100 0x0000ff00 rw !x
|
||||
eeprom 0x00810000 0x00010000 rw !x
|
||||
fuse 0x00820000 0x00000400 rw !x
|
||||
lock 0x00830000 0x00000400 rw !x
|
||||
signature 0x00840000 0x00000400 rw !x
|
||||
*default* 0x00000000 0xffffffff
|
||||
|
||||
Linker script and memory map
|
||||
|
||||
Address of section .data set to 0x800100
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
LOAD main.o
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51\libm.a
|
||||
START GROUP
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51\libm.a
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51\libc.a
|
||||
END GROUP
|
||||
|
||||
.hash
|
||||
*(.hash)
|
||||
|
||||
.dynsym
|
||||
*(.dynsym)
|
||||
|
||||
.dynstr
|
||||
*(.dynstr)
|
||||
|
||||
.gnu.version
|
||||
*(.gnu.version)
|
||||
|
||||
.gnu.version_d
|
||||
*(.gnu.version_d)
|
||||
|
||||
.gnu.version_r
|
||||
*(.gnu.version_r)
|
||||
|
||||
.rel.init
|
||||
*(.rel.init)
|
||||
|
||||
.rela.init
|
||||
*(.rela.init)
|
||||
|
||||
.rel.text
|
||||
*(.rel.text)
|
||||
*(.rel.text.*)
|
||||
*(.rel.gnu.linkonce.t*)
|
||||
|
||||
.rela.text
|
||||
*(.rela.text)
|
||||
*(.rela.text.*)
|
||||
*(.rela.gnu.linkonce.t*)
|
||||
|
||||
.rel.fini
|
||||
*(.rel.fini)
|
||||
|
||||
.rela.fini
|
||||
*(.rela.fini)
|
||||
|
||||
.rel.rodata
|
||||
*(.rel.rodata)
|
||||
*(.rel.rodata.*)
|
||||
*(.rel.gnu.linkonce.r*)
|
||||
|
||||
.rela.rodata
|
||||
*(.rela.rodata)
|
||||
*(.rela.rodata.*)
|
||||
*(.rela.gnu.linkonce.r*)
|
||||
|
||||
.rel.data
|
||||
*(.rel.data)
|
||||
*(.rel.data.*)
|
||||
*(.rel.gnu.linkonce.d*)
|
||||
|
||||
.rela.data
|
||||
*(.rela.data)
|
||||
*(.rela.data.*)
|
||||
*(.rela.gnu.linkonce.d*)
|
||||
|
||||
.rel.ctors
|
||||
*(.rel.ctors)
|
||||
|
||||
.rela.ctors
|
||||
*(.rela.ctors)
|
||||
|
||||
.rel.dtors
|
||||
*(.rel.dtors)
|
||||
|
||||
.rela.dtors
|
||||
*(.rela.dtors)
|
||||
|
||||
.rel.got
|
||||
*(.rel.got)
|
||||
|
||||
.rela.got
|
||||
*(.rela.got)
|
||||
|
||||
.rel.bss
|
||||
*(.rel.bss)
|
||||
|
||||
.rela.bss
|
||||
*(.rela.bss)
|
||||
|
||||
.rel.plt
|
||||
*(.rel.plt)
|
||||
|
||||
.rela.plt
|
||||
*(.rela.plt)
|
||||
|
||||
.text 0x00000000 0xc8
|
||||
*(.vectors)
|
||||
.vectors 0x00000000 0x8c e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
0x00000000 __vectors
|
||||
0x00000000 __vector_default
|
||||
*(.vectors)
|
||||
*(.progmem.gcc*)
|
||||
0x0000008c . = ALIGN (0x2)
|
||||
0x0000008c __trampolines_start = .
|
||||
*(.trampolines)
|
||||
.trampolines 0x0000008c 0x0 linker stubs
|
||||
*(.trampolines*)
|
||||
0x0000008c __trampolines_end = .
|
||||
*(.progmem*)
|
||||
0x0000008c . = ALIGN (0x2)
|
||||
*(.jumptables)
|
||||
*(.jumptables*)
|
||||
*(.lowtext)
|
||||
*(.lowtext*)
|
||||
0x0000008c __ctors_start = .
|
||||
*(.ctors)
|
||||
0x0000008c __ctors_end = .
|
||||
0x0000008c __dtors_start = .
|
||||
*(.dtors)
|
||||
0x0000008c __dtors_end = .
|
||||
SORT(*)(.ctors)
|
||||
SORT(*)(.dtors)
|
||||
*(.init0)
|
||||
.init0 0x0000008c 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
0x0000008c __init
|
||||
*(.init0)
|
||||
*(.init1)
|
||||
*(.init1)
|
||||
*(.init2)
|
||||
.init2 0x0000008c 0xc e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
*(.init2)
|
||||
*(.init3)
|
||||
*(.init3)
|
||||
*(.init4)
|
||||
*(.init4)
|
||||
*(.init5)
|
||||
*(.init5)
|
||||
*(.init6)
|
||||
*(.init6)
|
||||
*(.init7)
|
||||
*(.init7)
|
||||
*(.init8)
|
||||
*(.init8)
|
||||
*(.init9)
|
||||
.init9 0x00000098 0x8 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
*(.init9)
|
||||
*(.text)
|
||||
.text 0x000000a0 0x4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
0x000000a0 __vector_22
|
||||
0x000000a0 __vector_28
|
||||
0x000000a0 __vector_1
|
||||
0x000000a0 __vector_32
|
||||
0x000000a0 __vector_34
|
||||
0x000000a0 __vector_24
|
||||
0x000000a0 __vector_12
|
||||
0x000000a0 __bad_interrupt
|
||||
0x000000a0 __vector_6
|
||||
0x000000a0 __vector_31
|
||||
0x000000a0 __vector_3
|
||||
0x000000a0 __vector_23
|
||||
0x000000a0 __vector_30
|
||||
0x000000a0 __vector_25
|
||||
0x000000a0 __vector_11
|
||||
0x000000a0 __vector_13
|
||||
0x000000a0 __vector_17
|
||||
0x000000a0 __vector_19
|
||||
0x000000a0 __vector_7
|
||||
0x000000a0 __vector_27
|
||||
0x000000a0 __vector_5
|
||||
0x000000a0 __vector_33
|
||||
0x000000a0 __vector_4
|
||||
0x000000a0 __vector_9
|
||||
0x000000a0 __vector_2
|
||||
0x000000a0 __vector_21
|
||||
0x000000a0 __vector_15
|
||||
0x000000a0 __vector_29
|
||||
0x000000a0 __vector_8
|
||||
0x000000a0 __vector_26
|
||||
0x000000a0 __vector_14
|
||||
0x000000a0 __vector_10
|
||||
0x000000a0 __vector_16
|
||||
0x000000a0 __vector_18
|
||||
0x000000a0 __vector_20
|
||||
.text 0x000000a4 0x0 main.o
|
||||
.text 0x000000a4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
0x000000a4 . = ALIGN (0x2)
|
||||
*(.text.*)
|
||||
.text.startup 0x000000a4 0x20 main.o
|
||||
0x000000a4 main
|
||||
.text.libgcc.mul
|
||||
0x000000c4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
.text.libgcc.div
|
||||
0x000000c4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
.text.libgcc 0x000000c4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
.text.libgcc.prologue
|
||||
0x000000c4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
.text.libgcc.builtins
|
||||
0x000000c4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
.text.libgcc.fmul
|
||||
0x000000c4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
.text.libgcc.fixed
|
||||
0x000000c4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
0x000000c4 . = ALIGN (0x2)
|
||||
*(.fini9)
|
||||
.fini9 0x000000c4 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
0x000000c4 exit
|
||||
0x000000c4 _exit
|
||||
*(.fini9)
|
||||
*(.fini8)
|
||||
*(.fini8)
|
||||
*(.fini7)
|
||||
*(.fini7)
|
||||
*(.fini6)
|
||||
*(.fini6)
|
||||
*(.fini5)
|
||||
*(.fini5)
|
||||
*(.fini4)
|
||||
*(.fini4)
|
||||
*(.fini3)
|
||||
*(.fini3)
|
||||
*(.fini2)
|
||||
*(.fini2)
|
||||
*(.fini1)
|
||||
*(.fini1)
|
||||
*(.fini0)
|
||||
.fini0 0x000000c4 0x4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
*(.fini0)
|
||||
0x000000c8 _etext = .
|
||||
|
||||
.data 0x00800100 0x0 load address 0x000000c8
|
||||
0x00800100 PROVIDE (__data_start, .)
|
||||
*(.data)
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
.data 0x00800100 0x0 main.o
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
*(.data*)
|
||||
*(.rodata)
|
||||
*(.rodata*)
|
||||
*(.gnu.linkonce.d*)
|
||||
0x00800100 . = ALIGN (0x2)
|
||||
0x00800100 _edata = .
|
||||
0x00800100 PROVIDE (__data_end, .)
|
||||
|
||||
.bss 0x00800100 0x0
|
||||
0x00800100 PROVIDE (__bss_start, .)
|
||||
*(.bss)
|
||||
.bss 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
.bss 0x00800100 0x0 main.o
|
||||
.bss 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
0x00800100 PROVIDE (__bss_end, .)
|
||||
0x000000c8 __data_load_start = LOADADDR (.data)
|
||||
0x000000c8 __data_load_end = (__data_load_start + SIZEOF (.data))
|
||||
|
||||
.noinit 0x00800100 0x0
|
||||
0x00800100 PROVIDE (__noinit_start, .)
|
||||
*(.noinit*)
|
||||
0x00800100 PROVIDE (__noinit_end, .)
|
||||
0x00800100 _end = .
|
||||
0x00800100 PROVIDE (__heap_start, .)
|
||||
|
||||
.eeprom 0x00810000 0x0
|
||||
*(.eeprom*)
|
||||
0x00810000 __eeprom_end = .
|
||||
|
||||
.fuse
|
||||
*(.fuse)
|
||||
*(.lfuse)
|
||||
*(.hfuse)
|
||||
*(.efuse)
|
||||
|
||||
.lock
|
||||
*(.lock*)
|
||||
|
||||
.signature
|
||||
*(.signature*)
|
||||
|
||||
.stab
|
||||
*(.stab)
|
||||
|
||||
.stabstr
|
||||
*(.stabstr)
|
||||
|
||||
.stab.excl
|
||||
*(.stab.excl)
|
||||
|
||||
.stab.exclstr
|
||||
*(.stab.exclstr)
|
||||
|
||||
.stab.index
|
||||
*(.stab.index)
|
||||
|
||||
.stab.indexstr
|
||||
*(.stab.indexstr)
|
||||
|
||||
.comment 0x00000000 0x11
|
||||
*(.comment)
|
||||
.comment 0x00000000 0x11 main.o
|
||||
0x12 (size before relaxing)
|
||||
|
||||
.note.gnu.build-id
|
||||
*(.note.gnu.build-id)
|
||||
|
||||
.debug
|
||||
*(.debug)
|
||||
|
||||
.line
|
||||
*(.line)
|
||||
|
||||
.debug_srcinfo
|
||||
*(.debug_srcinfo)
|
||||
|
||||
.debug_sfnames
|
||||
*(.debug_sfnames)
|
||||
|
||||
.debug_aranges 0x00000000 0x20
|
||||
*(.debug_aranges)
|
||||
.debug_aranges
|
||||
0x00000000 0x20 main.o
|
||||
|
||||
.debug_pubnames
|
||||
*(.debug_pubnames)
|
||||
|
||||
.debug_info 0x00000000 0x119
|
||||
*(.debug_info .gnu.linkonce.wi.*)
|
||||
.debug_info 0x00000000 0x119 main.o
|
||||
|
||||
.debug_abbrev 0x00000000 0xd1
|
||||
*(.debug_abbrev)
|
||||
.debug_abbrev 0x00000000 0xd1 main.o
|
||||
|
||||
.debug_line 0x00000000 0xd7
|
||||
*(.debug_line .debug_line.* .debug_line_end)
|
||||
.debug_line 0x00000000 0xd7 main.o
|
||||
|
||||
.debug_frame 0x00000000 0x24
|
||||
*(.debug_frame)
|
||||
.debug_frame 0x00000000 0x24 main.o
|
||||
|
||||
.debug_str 0x00000000 0x137
|
||||
*(.debug_str)
|
||||
.debug_str 0x00000000 0x137 main.o
|
||||
0x16b (size before relaxing)
|
||||
|
||||
.debug_loc 0x00000000 0x1f
|
||||
*(.debug_loc)
|
||||
.debug_loc 0x00000000 0x1f main.o
|
||||
|
||||
.debug_macinfo
|
||||
*(.debug_macinfo)
|
||||
|
||||
.debug_weaknames
|
||||
*(.debug_weaknames)
|
||||
|
||||
.debug_funcnames
|
||||
*(.debug_funcnames)
|
||||
|
||||
.debug_typenames
|
||||
*(.debug_typenames)
|
||||
|
||||
.debug_varnames
|
||||
*(.debug_varnames)
|
||||
|
||||
.debug_pubtypes
|
||||
*(.debug_pubtypes)
|
||||
|
||||
.debug_ranges 0x00000000 0x10
|
||||
*(.debug_ranges)
|
||||
.debug_ranges 0x00000000 0x10 main.o
|
||||
|
||||
.debug_macro
|
||||
*(.debug_macro)
|
||||
OUTPUT(main.elf elf32-avr)
|
||||
LOAD linker stubs
|
||||
|
||||
Cross Reference Table
|
||||
|
||||
Symbol File
|
||||
__bad_interrupt e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__heap_end e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__init e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__stack e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_1 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_10 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_11 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_12 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_13 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_14 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_15 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_16 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_17 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_18 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_19 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_2 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_20 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_21 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_22 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_23 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_24 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_25 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_26 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_27 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_28 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_29 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_3 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_30 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_31 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_32 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_33 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_34 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_5 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_6 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_7 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_8 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_9 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vector_default e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
__vectors e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
_exit e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
exit e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr51\libgcc.a(_exit.o)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
main main.o
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr51/crtm1284p.o
|
||||
62
trunk/AVRProjects/ATMega1284/main.sym
Normal file
62
trunk/AVRProjects/ATMega1284/main.sym
Normal file
@@ -0,0 +1,62 @@
|
||||
00000000 W __heap_end
|
||||
00000000 a __tmp_reg__
|
||||
00000000 W __vector_default
|
||||
00000000 T __vectors
|
||||
00000001 a __zero_reg__
|
||||
0000003b a __RAMPZ__
|
||||
0000003d a __SP_L__
|
||||
0000003e a __SP_H__
|
||||
0000003f a __SREG__
|
||||
0000008c T __ctors_end
|
||||
0000008c T __ctors_start
|
||||
0000008c T __dtors_end
|
||||
0000008c T __dtors_start
|
||||
0000008c W __init
|
||||
0000008c T __trampolines_end
|
||||
0000008c T __trampolines_start
|
||||
000000a0 T __bad_interrupt
|
||||
000000a0 W __vector_1
|
||||
000000a0 W __vector_10
|
||||
000000a0 W __vector_11
|
||||
000000a0 W __vector_12
|
||||
000000a0 W __vector_13
|
||||
000000a0 W __vector_14
|
||||
000000a0 W __vector_15
|
||||
000000a0 W __vector_16
|
||||
000000a0 W __vector_17
|
||||
000000a0 W __vector_18
|
||||
000000a0 W __vector_19
|
||||
000000a0 W __vector_2
|
||||
000000a0 W __vector_20
|
||||
000000a0 W __vector_21
|
||||
000000a0 W __vector_22
|
||||
000000a0 W __vector_23
|
||||
000000a0 W __vector_24
|
||||
000000a0 W __vector_25
|
||||
000000a0 W __vector_26
|
||||
000000a0 W __vector_27
|
||||
000000a0 W __vector_28
|
||||
000000a0 W __vector_29
|
||||
000000a0 W __vector_3
|
||||
000000a0 W __vector_30
|
||||
000000a0 W __vector_31
|
||||
000000a0 W __vector_32
|
||||
000000a0 W __vector_33
|
||||
000000a0 W __vector_34
|
||||
000000a0 W __vector_4
|
||||
000000a0 W __vector_5
|
||||
000000a0 W __vector_6
|
||||
000000a0 W __vector_7
|
||||
000000a0 W __vector_8
|
||||
000000a0 W __vector_9
|
||||
000000a4 T main
|
||||
000000c4 T _exit
|
||||
000000c4 W exit
|
||||
000000c6 t __stop_program
|
||||
000000c8 A __data_load_end
|
||||
000000c8 A __data_load_start
|
||||
000000c8 T _etext
|
||||
000040ff W __stack
|
||||
00800100 D _edata
|
||||
00800100 N _end
|
||||
00810000 N __eeprom_end
|
||||
442
trunk/AVRProjects/ATMega1284/makefile
Normal file
442
trunk/AVRProjects/ATMega1284/makefile
Normal file
@@ -0,0 +1,442 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega1284p
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 4190000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
46
trunk/AVRProjects/ATMega168/.dep/main.o.d
Normal file
46
trunk/AVRProjects/ATMega168/.dep/main.o.d
Normal file
@@ -0,0 +1,46 @@
|
||||
main.o: main.c \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\io.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\sfr_defs.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\inttypes.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\stdint.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom168p.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\portpins.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\common.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\version.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\fuse.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\lock.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay_basic.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\math.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\setbaud.h
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\io.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\sfr_defs.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\inttypes.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\stdint.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom168p.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\portpins.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\common.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\version.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\fuse.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\lock.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay_basic.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\math.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\setbaud.h:
|
||||
509
trunk/AVRProjects/ATMega168/Example_Serial/Makefile
Normal file
509
trunk/AVRProjects/ATMega168/Example_Serial/Makefile
Normal file
@@ -0,0 +1,509 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#----------------------------------------------------------------------------
|
||||
# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
#
|
||||
# Released to the Public Domain
|
||||
#
|
||||
# Additional material for this makefile was written by:
|
||||
# Peter Fleury
|
||||
# Tim Henigan
|
||||
# Colin O'Flynn
|
||||
# Reiner Patommel
|
||||
# Markus Pfaff
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF.
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude.
|
||||
# Please customize the avrdude settings below first!
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
#
|
||||
# make filename.i = Create a preprocessed source file for use in submitting
|
||||
# bug reports to the GCC project.
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega168
|
||||
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
F_CPU = 8000000
|
||||
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = basic-in-atmega168
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
|
||||
# AVR Studio 4.10 requires dwarf-2.
|
||||
# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
|
||||
DEBUG = dwarf-2
|
||||
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
# Use forward slashes for directory separators.
|
||||
# For a directory that has spaces, enclose it in quotes.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 = "ANSI" C
|
||||
# gnu89 = c89 plus GCC extensions
|
||||
# c99 = ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 = c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS = -DF_CPU=$(F_CPU)UL
|
||||
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
|
||||
#---------------- Compiler Options ----------------
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
|
||||
|
||||
#---------------- Assembler Options ----------------
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
|
||||
|
||||
#---------------- Library Options ----------------
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
# If this is left blank, then it will use the Standard printf version.
|
||||
PRINTF_LIB =
|
||||
#PRINTF_LIB = $(PRINTF_LIB_MIN)
|
||||
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
|
||||
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
# If this is left blank, then it will use the Standard scanf version.
|
||||
SCANF_LIB =
|
||||
#SCANF_LIB = $(SCANF_LIB_MIN)
|
||||
#SCANF_LIB = $(SCANF_LIB_FLOAT)
|
||||
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
|
||||
|
||||
#---------------- External Memory Options ----------------
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
|
||||
|
||||
#---------------- Linker Options ----------------
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
#---------------- Programming Options (avrdude) ----------------
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
AVRDUDE_PROGRAMMER = stk200
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = lpt1
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
#---------------- Debugging Options ----------------
|
||||
|
||||
# For simulavr only - target MCU frequency.
|
||||
DEBUG_MFREQ = $(F_CPU)
|
||||
|
||||
# Set the DEBUG_UI to either gdb or insight.
|
||||
# DEBUG_UI = gdb
|
||||
DEBUG_UI = insight
|
||||
|
||||
# Set the debugging back-end to either avarice, simulavr.
|
||||
DEBUG_BACKEND = avarice
|
||||
#DEBUG_BACKEND = simulavr
|
||||
|
||||
# GDB Init Filename.
|
||||
GDBINIT_FILE = __avr_gdbinit
|
||||
|
||||
# When using avarice settings for the JTAG
|
||||
JTAG_DEV = /dev/com1
|
||||
|
||||
# Debugging port used to communicate between GDB / avarice / simulavr.
|
||||
DEBUG_PORT = 4242
|
||||
|
||||
# Debugging host used to communicate between GDB / avarice / simulavr, normally
|
||||
# just set to localhost unless doing some sort of crazy debugging when
|
||||
# avarice is running on a different computer.
|
||||
DEBUG_HOST = localhost
|
||||
|
||||
|
||||
|
||||
#============================================================================
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
WINSHELL = cmd
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(SRC:.c=.lst) $(ASRC:.S=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
all: begin gccversion sizebefore build sizeafter end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
AVRMEM = avr-mem.sh $(TARGET).elf $(MCU)
|
||||
|
||||
sizebefore:
|
||||
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
|
||||
$(AVRMEM) 2>/dev/null; echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
|
||||
$(AVRMEM) 2>/dev/null; echo; fi
|
||||
|
||||
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
# Generate avr-gdb config/init file which does the following:
|
||||
# define the reset signal, load the target file, connect to target, and set
|
||||
# a breakpoint at main().
|
||||
gdb-config:
|
||||
@$(REMOVE) $(GDBINIT_FILE)
|
||||
@echo define reset >> $(GDBINIT_FILE)
|
||||
@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
|
||||
@echo end >> $(GDBINIT_FILE)
|
||||
@echo file $(TARGET).elf >> $(GDBINIT_FILE)
|
||||
@echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
|
||||
ifeq ($(DEBUG_BACKEND),simulavr)
|
||||
@echo load >> $(GDBINIT_FILE)
|
||||
endif
|
||||
@echo break main >> $(GDBINIT_FILE)
|
||||
|
||||
debug: gdb-config $(TARGET).elf
|
||||
ifeq ($(DEBUG_BACKEND), avarice)
|
||||
@echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
|
||||
@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
|
||||
$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
|
||||
@$(WINSHELL) /c pause
|
||||
|
||||
else
|
||||
@$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
|
||||
$(DEBUG_MFREQ) --port $(DEBUG_PORT)
|
||||
endif
|
||||
@$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
# Create preprocessed source for use in sending a bug report.
|
||||
%.i : %.c
|
||||
$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program debug gdb-config
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
5-10-07
|
||||
Copyright Spark Fun Electronics© 2007
|
||||
Nathan Seidle
|
||||
nathan at sparkfun.com
|
||||
|
||||
Example basic printf input/output
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
#define FOSC 16000000
|
||||
#define BAUD 9600
|
||||
#define MYUBRR FOSC/16/BAUD-1
|
||||
|
||||
#define sbi(var, mask) ((var) |= (uint8_t)(1 << mask))
|
||||
#define cbi(var, mask) ((var) &= (uint8_t)~(1 << mask))
|
||||
|
||||
#define STATUS_LED 0
|
||||
|
||||
//Define functions
|
||||
//======================
|
||||
void ioinit(void); // initializes IO
|
||||
static int uart_putchar(char c, FILE *stream);
|
||||
uint8_t uart_getchar(void);
|
||||
|
||||
static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
|
||||
|
||||
void delay_ms(uint16_t x); // general purpose delay
|
||||
//======================
|
||||
|
||||
int main (void)
|
||||
{
|
||||
uint8_t key_press;
|
||||
|
||||
ioinit(); //Setup IO pins and defaults
|
||||
|
||||
printf("Waiting for input:\n");
|
||||
|
||||
while(1)
|
||||
{
|
||||
key_press = uart_getchar();
|
||||
|
||||
printf("I heard : %c\n", key_press);
|
||||
|
||||
if(key_press == 'g') printf(" GO!\n");
|
||||
if(key_press == 'X') printf(" EXIT\n");
|
||||
if(key_press == 13) printf(" RETURN\n");
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void ioinit (void)
|
||||
{
|
||||
//1 = output, 0 = input
|
||||
DDRB = 0b11101111; //PB4 = MISO
|
||||
DDRC = 0b11111111; //
|
||||
DDRD = 0b11111110; //PORTD (RX on PD0)
|
||||
|
||||
//USART Baud rate: 9600
|
||||
UBRR0H = MYUBRR >> 8;
|
||||
UBRR0L = MYUBRR;
|
||||
UCSR0B = (1<<RXEN0)|(1<<TXEN0);
|
||||
|
||||
stdout = &mystdout; //Required for printf init
|
||||
}
|
||||
|
||||
static int uart_putchar(char c, FILE *stream)
|
||||
{
|
||||
if (c == '\n') uart_putchar('\r', stream);
|
||||
|
||||
loop_until_bit_is_set(UCSR0A, UDRE0);
|
||||
UDR0 = c;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t uart_getchar(void)
|
||||
{
|
||||
while( !(UCSR0A & (1<<RXC0)) );
|
||||
return(UDR0);
|
||||
}
|
||||
|
||||
//General short delays
|
||||
void delay_ms(uint16_t x)
|
||||
{
|
||||
uint8_t y, z;
|
||||
for ( ; x > 0 ; x--){
|
||||
for ( y = 0 ; y < 80 ; y++){
|
||||
for ( z = 0 ; z < 40 ; z++){
|
||||
asm volatile ("nop");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
138
trunk/AVRProjects/ATMega168/main.c
Normal file
138
trunk/AVRProjects/ATMega168/main.c
Normal file
@@ -0,0 +1,138 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 88 / Mega 168 / Mega 328 Pin map
|
||||
+-\/-+
|
||||
/Reset PC6 1|o |28 PC5 ADC5
|
||||
RXD PD0 2| |27 PC4 ADC4
|
||||
TXD PD1 3| |26 PC3 ADC3
|
||||
PD2 4| |25 PC2 ADC2
|
||||
OC2B PD3 5| |24 PC1 ADC1
|
||||
PD4 6| |23 PC0 ADC0
|
||||
VCC 7| |22 GND
|
||||
GND 8| |21 AREF
|
||||
OSC1 PB6 9| |20 VCC
|
||||
OSC2 PB7 10| |19 PB5 SCK
|
||||
OC0B PD5 11| |18 PB4 MISO
|
||||
AIN0 OC0A PD6 12| |17 PB3 OC2A MOSI
|
||||
AIN1 PD7 13| |16 PB2 OC1B
|
||||
PB0 14| |15 PB1 OC1A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 8000000
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#define BAUD 9600
|
||||
#define m168p
|
||||
#include <util/setbaud.h>
|
||||
|
||||
/* Definizioni per il m168p */
|
||||
#ifdef m168p
|
||||
#define UCSRA UCSR0A
|
||||
#define UCSRB UCSR0B
|
||||
#define UCSRC UCSR0C
|
||||
#define UBRRH UBRR0H
|
||||
#define UBRRL UBRR0L
|
||||
#define U2X U2X0
|
||||
#define UDRE UDRE0
|
||||
#define UDR UDR0
|
||||
#endif
|
||||
/* fine definizioni per il m168p*/
|
||||
|
||||
/* Inizializza la porta seriale */
|
||||
void uart_init(void)
|
||||
{
|
||||
UBRRH = UBRRH_VALUE;
|
||||
UBRRL = UBRRL_VALUE;
|
||||
#if USE_2X0
|
||||
UCSRA |= (1 << U2X);
|
||||
#else
|
||||
UCSRA &= ~(1 << U2X);
|
||||
#endif
|
||||
|
||||
UCSRC= _BV(UCSZ01) | _BV(UCSZ00); // 8 N 1
|
||||
UCSRB= (1<<TXEN0);
|
||||
// UCSRB= (1<<RXEN0)|(1<<TXEN0);
|
||||
}
|
||||
|
||||
/* uart_putc(): scrive un carattere sulla porta seriale*/
|
||||
int uart_putc(unsigned char c)
|
||||
{
|
||||
while (!(UCSRA & (1<<UDRE))) { /* warten bis Senden moeglich */
|
||||
}
|
||||
UDR = c; /* sende Zeichen */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* uart_puts(): scrive una stringa sulla porta seriale*/
|
||||
void uart_puts (char *s)
|
||||
{
|
||||
while (*s) {
|
||||
uart_putc(*s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Funzioni oer il display Digole */
|
||||
|
||||
/* Main - Programma principale*/
|
||||
int main (void)
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRC = 0b00000001;
|
||||
|
||||
uart_init();
|
||||
_delay_ms(3000);
|
||||
uart_puts("CL");
|
||||
uart_puts("DSS");
|
||||
uart_putc(0);
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
uart_puts("TRT");
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
uart_puts("TRT");
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
uart_puts("TRT");
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
uart_puts("TRT");
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
uart_puts("TRT");
|
||||
|
||||
/*
|
||||
uart_puts("SF");
|
||||
uart_putc(6);
|
||||
uart_puts("TT12345678901234567890123456789012\n");
|
||||
|
||||
uart_puts("SF");
|
||||
uart_putc(10);
|
||||
uart_puts("TRT");
|
||||
uart_puts("TT123456789012345678901\n");
|
||||
|
||||
uart_puts("SF");
|
||||
uart_putc(0);
|
||||
uart_puts("TRT");
|
||||
uart_puts("TT1234567890123456\n");
|
||||
|
||||
uart_puts("SF");
|
||||
uart_putc(18);
|
||||
uart_puts("TRT");
|
||||
uart_puts("TT12345678901234\n");
|
||||
*/
|
||||
|
||||
while(1) {
|
||||
zwischenspeicher = PORTC;
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
PORTC = zwischenspeicher;
|
||||
_delay_ms(500);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
1
trunk/AVRProjects/ATMega168/main.eep
Normal file
1
trunk/AVRProjects/ATMega168/main.eep
Normal file
@@ -0,0 +1 @@
|
||||
:00000001FF
|
||||
BIN
trunk/AVRProjects/ATMega168/main.elf
Normal file
BIN
trunk/AVRProjects/ATMega168/main.elf
Normal file
Binary file not shown.
28
trunk/AVRProjects/ATMega168/main.hex
Normal file
28
trunk/AVRProjects/ATMega168/main.hex
Normal file
@@ -0,0 +1,28 @@
|
||||
:100000000C9434000C9449000C9449000C94490061
|
||||
:100010000C9449000C9449000C9449000C9449003C
|
||||
:100020000C9449000C9449000C9449000C9449002C
|
||||
:100030000C9449000C9449000C9449000C9449001C
|
||||
:100040000C9449000C9449000C9449000C9449000C
|
||||
:100050000C9449000C9449000C9449000C944900FC
|
||||
:100060000C9449000C94490011241FBECFEFD4E03A
|
||||
:10007000DEBFCDBF11E0A0E0B1E0E2E8F1E002C0F8
|
||||
:1000800005900D92A032B107D9F70E9471000C942F
|
||||
:10009000BF000C9400001092C50083E38093C4005D
|
||||
:1000A000E0ECF0E080818D7F808386E08093C20069
|
||||
:1000B00088E08093C10008959091C00095FFFCCF27
|
||||
:1000C0008093C60080E090E00895CF93DF93EC0129
|
||||
:1000D0008991882319F00E945C00FACFDF91CF91BB
|
||||
:1000E000089581E087B90E944B002FEF3DE389E43A
|
||||
:1000F000215030408040E1F700C0000080E091E0F6
|
||||
:100100000E94650083E091E00E94650080E00E940B
|
||||
:100110005C0087E091E00E9465008BE191E00E9425
|
||||
:10012000650087E091E00E9465008BE191E00E940C
|
||||
:10013000650087E091E00E9465008BE191E00E94FC
|
||||
:10014000650087E091E00E9465008BE191E00E94EC
|
||||
:10015000650087E091E00E9465008BE191E00E94DC
|
||||
:10016000650091E088B1892788B92FEF34E38CE0EE
|
||||
:10017000215030408040E1F700C00000F3CFF894F8
|
||||
:02018000FFCFAF
|
||||
:10018200434C004453530054542A204C6F7665204C
|
||||
:100192002053696C766961202A0A00545254000087
|
||||
:00000001FF
|
||||
268
trunk/AVRProjects/ATMega168/main.lss
Normal file
268
trunk/AVRProjects/ATMega168/main.lss
Normal file
@@ -0,0 +1,268 @@
|
||||
|
||||
main.elf: file format elf32-avr
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .data 00000020 00800100 00000182 000001f6 2**0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
1 .text 00000182 00000000 00000000 00000074 2**1
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
2 .comment 00000011 00000000 00000000 00000216 2**0
|
||||
CONTENTS, READONLY
|
||||
3 .debug_aranges 00000028 00000000 00000000 00000227 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
4 .debug_info 00000340 00000000 00000000 0000024f 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
5 .debug_abbrev 00000168 00000000 00000000 0000058f 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
6 .debug_line 00000117 00000000 00000000 000006f7 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
7 .debug_frame 00000060 00000000 00000000 00000810 2**2
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
8 .debug_str 00000153 00000000 00000000 00000870 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
9 .debug_loc 000000bf 00000000 00000000 000009c3 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
10 .debug_ranges 00000018 00000000 00000000 00000a82 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <__vectors>:
|
||||
0: 0c 94 34 00 jmp 0x68 ; 0x68 <__ctors_end>
|
||||
4: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
8: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
10: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
14: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
18: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
1c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
20: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
24: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
28: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
2c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
30: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
34: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
38: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
3c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
40: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
44: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
48: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
4c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
50: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
54: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
58: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
5c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
60: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
64: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||
|
||||
00000068 <__ctors_end>:
|
||||
68: 11 24 eor r1, r1
|
||||
6a: 1f be out 0x3f, r1 ; 63
|
||||
6c: cf ef ldi r28, 0xFF ; 255
|
||||
6e: d4 e0 ldi r29, 0x04 ; 4
|
||||
70: de bf out 0x3e, r29 ; 62
|
||||
72: cd bf out 0x3d, r28 ; 61
|
||||
|
||||
00000074 <__do_copy_data>:
|
||||
74: 11 e0 ldi r17, 0x01 ; 1
|
||||
76: a0 e0 ldi r26, 0x00 ; 0
|
||||
78: b1 e0 ldi r27, 0x01 ; 1
|
||||
7a: e2 e8 ldi r30, 0x82 ; 130
|
||||
7c: f1 e0 ldi r31, 0x01 ; 1
|
||||
7e: 02 c0 rjmp .+4 ; 0x84 <__do_copy_data+0x10>
|
||||
80: 05 90 lpm r0, Z+
|
||||
82: 0d 92 st X+, r0
|
||||
84: a0 32 cpi r26, 0x20 ; 32
|
||||
86: b1 07 cpc r27, r17
|
||||
88: d9 f7 brne .-10 ; 0x80 <__do_copy_data+0xc>
|
||||
8a: 0e 94 71 00 call 0xe2 ; 0xe2 <main>
|
||||
8e: 0c 94 bf 00 jmp 0x17e ; 0x17e <_exit>
|
||||
|
||||
00000092 <__bad_interrupt>:
|
||||
92: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
|
||||
|
||||
00000096 <uart_init>:
|
||||
/* fine definizioni per il m168p*/
|
||||
|
||||
/* Inizializza la porta seriale */
|
||||
void uart_init(void)
|
||||
{
|
||||
UBRRH = UBRRH_VALUE;
|
||||
96: 10 92 c5 00 sts 0x00C5, r1
|
||||
UBRRL = UBRRL_VALUE;
|
||||
9a: 83 e3 ldi r24, 0x33 ; 51
|
||||
9c: 80 93 c4 00 sts 0x00C4, r24
|
||||
#if USE_2X0
|
||||
UCSRA |= (1 << U2X);
|
||||
#else
|
||||
UCSRA &= ~(1 << U2X);
|
||||
a0: e0 ec ldi r30, 0xC0 ; 192
|
||||
a2: f0 e0 ldi r31, 0x00 ; 0
|
||||
a4: 80 81 ld r24, Z
|
||||
a6: 8d 7f andi r24, 0xFD ; 253
|
||||
a8: 80 83 st Z, r24
|
||||
#endif
|
||||
|
||||
UCSRC= _BV(UCSZ01) | _BV(UCSZ00); // 8 N 1
|
||||
aa: 86 e0 ldi r24, 0x06 ; 6
|
||||
ac: 80 93 c2 00 sts 0x00C2, r24
|
||||
UCSRB= (1<<TXEN0);
|
||||
b0: 88 e0 ldi r24, 0x08 ; 8
|
||||
b2: 80 93 c1 00 sts 0x00C1, r24
|
||||
b6: 08 95 ret
|
||||
|
||||
000000b8 <uart_putc>:
|
||||
}
|
||||
|
||||
/* uart_putc(): scrive un carattere sulla porta seriale*/
|
||||
int uart_putc(unsigned char c)
|
||||
{
|
||||
while (!(UCSRA & (1<<UDRE))) { /* warten bis Senden moeglich */
|
||||
b8: 90 91 c0 00 lds r25, 0x00C0
|
||||
bc: 95 ff sbrs r25, 5
|
||||
be: fc cf rjmp .-8 ; 0xb8 <uart_putc>
|
||||
}
|
||||
UDR = c; /* sende Zeichen */
|
||||
c0: 80 93 c6 00 sts 0x00C6, r24
|
||||
return 0;
|
||||
}
|
||||
c4: 80 e0 ldi r24, 0x00 ; 0
|
||||
c6: 90 e0 ldi r25, 0x00 ; 0
|
||||
c8: 08 95 ret
|
||||
|
||||
000000ca <uart_puts>:
|
||||
|
||||
/* uart_puts(): scrive una stringa sulla porta seriale*/
|
||||
void uart_puts (char *s)
|
||||
{
|
||||
ca: cf 93 push r28
|
||||
cc: df 93 push r29
|
||||
ce: ec 01 movw r28, r24
|
||||
while (*s) {
|
||||
d0: 89 91 ld r24, Y+
|
||||
d2: 88 23 and r24, r24
|
||||
d4: 19 f0 breq .+6 ; 0xdc <uart_puts+0x12>
|
||||
uart_putc(*s);
|
||||
d6: 0e 94 5c 00 call 0xb8 ; 0xb8 <uart_putc>
|
||||
da: fa cf rjmp .-12 ; 0xd0 <uart_puts+0x6>
|
||||
s++;
|
||||
}
|
||||
}
|
||||
dc: df 91 pop r29
|
||||
de: cf 91 pop r28
|
||||
e0: 08 95 ret
|
||||
|
||||
000000e2 <main>:
|
||||
|
||||
/* Main - Programma principale*/
|
||||
int main (void)
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRC = 0b00000001;
|
||||
e2: 81 e0 ldi r24, 0x01 ; 1
|
||||
e4: 87 b9 out 0x07, r24 ; 7
|
||||
|
||||
uart_init();
|
||||
e6: 0e 94 4b 00 call 0x96 ; 0x96 <uart_init>
|
||||
#else
|
||||
//round up by default
|
||||
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
#endif
|
||||
|
||||
__builtin_avr_delay_cycles(__ticks_dc);
|
||||
ea: 2f ef ldi r18, 0xFF ; 255
|
||||
ec: 3d e3 ldi r19, 0x3D ; 61
|
||||
ee: 89 e4 ldi r24, 0x49 ; 73
|
||||
f0: 21 50 subi r18, 0x01 ; 1
|
||||
f2: 30 40 sbci r19, 0x00 ; 0
|
||||
f4: 80 40 sbci r24, 0x00 ; 0
|
||||
f6: e1 f7 brne .-8 ; 0xf0 <main+0xe>
|
||||
f8: 00 c0 rjmp .+0 ; 0xfa <main+0x18>
|
||||
fa: 00 00 nop
|
||||
_delay_ms(3000);
|
||||
uart_puts("CL");
|
||||
fc: 80 e0 ldi r24, 0x00 ; 0
|
||||
fe: 91 e0 ldi r25, 0x01 ; 1
|
||||
100: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("DSS");
|
||||
104: 83 e0 ldi r24, 0x03 ; 3
|
||||
106: 91 e0 ldi r25, 0x01 ; 1
|
||||
108: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_putc(0);
|
||||
10c: 80 e0 ldi r24, 0x00 ; 0
|
||||
10e: 0e 94 5c 00 call 0xb8 ; 0xb8 <uart_putc>
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
112: 87 e0 ldi r24, 0x07 ; 7
|
||||
114: 91 e0 ldi r25, 0x01 ; 1
|
||||
116: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TRT");
|
||||
11a: 8b e1 ldi r24, 0x1B ; 27
|
||||
11c: 91 e0 ldi r25, 0x01 ; 1
|
||||
11e: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
122: 87 e0 ldi r24, 0x07 ; 7
|
||||
124: 91 e0 ldi r25, 0x01 ; 1
|
||||
126: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TRT");
|
||||
12a: 8b e1 ldi r24, 0x1B ; 27
|
||||
12c: 91 e0 ldi r25, 0x01 ; 1
|
||||
12e: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
132: 87 e0 ldi r24, 0x07 ; 7
|
||||
134: 91 e0 ldi r25, 0x01 ; 1
|
||||
136: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TRT");
|
||||
13a: 8b e1 ldi r24, 0x1B ; 27
|
||||
13c: 91 e0 ldi r25, 0x01 ; 1
|
||||
13e: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
142: 87 e0 ldi r24, 0x07 ; 7
|
||||
144: 91 e0 ldi r25, 0x01 ; 1
|
||||
146: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TRT");
|
||||
14a: 8b e1 ldi r24, 0x1B ; 27
|
||||
14c: 91 e0 ldi r25, 0x01 ; 1
|
||||
14e: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TT* Love Silvia *\n");
|
||||
152: 87 e0 ldi r24, 0x07 ; 7
|
||||
154: 91 e0 ldi r25, 0x01 ; 1
|
||||
156: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TRT");
|
||||
15a: 8b e1 ldi r24, 0x1B ; 27
|
||||
15c: 91 e0 ldi r25, 0x01 ; 1
|
||||
15e: 0e 94 65 00 call 0xca ; 0xca <uart_puts>
|
||||
uart_puts("TT12345678901234\n");
|
||||
*/
|
||||
|
||||
while(1) {
|
||||
zwischenspeicher = PORTC;
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
162: 91 e0 ldi r25, 0x01 ; 1
|
||||
uart_puts("TRT");
|
||||
uart_puts("TT12345678901234\n");
|
||||
*/
|
||||
|
||||
while(1) {
|
||||
zwischenspeicher = PORTC;
|
||||
164: 88 b1 in r24, 0x08 ; 8
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
166: 89 27 eor r24, r25
|
||||
PORTC = zwischenspeicher;
|
||||
168: 88 b9 out 0x08, r24 ; 8
|
||||
16a: 2f ef ldi r18, 0xFF ; 255
|
||||
16c: 34 e3 ldi r19, 0x34 ; 52
|
||||
16e: 8c e0 ldi r24, 0x0C ; 12
|
||||
170: 21 50 subi r18, 0x01 ; 1
|
||||
172: 30 40 sbci r19, 0x00 ; 0
|
||||
174: 80 40 sbci r24, 0x00 ; 0
|
||||
176: e1 f7 brne .-8 ; 0x170 <main+0x8e>
|
||||
178: 00 c0 rjmp .+0 ; 0x17a <main+0x98>
|
||||
17a: 00 00 nop
|
||||
17c: f3 cf rjmp .-26 ; 0x164 <main+0x82>
|
||||
|
||||
0000017e <_exit>:
|
||||
17e: f8 94 cli
|
||||
|
||||
00000180 <__stop_program>:
|
||||
180: ff cf rjmp .-2 ; 0x180 <__stop_program>
|
||||
528
trunk/AVRProjects/ATMega168/main.lst
Normal file
528
trunk/AVRProjects/ATMega168/main.lst
Normal file
@@ -0,0 +1,528 @@
|
||||
1 .file "main.c"
|
||||
2 __SP_H__ = 0x3e
|
||||
3 __SP_L__ = 0x3d
|
||||
4 __SREG__ = 0x3f
|
||||
5 __tmp_reg__ = 0
|
||||
6 __zero_reg__ = 1
|
||||
7 .text
|
||||
8 .Ltext0:
|
||||
9 .cfi_sections .debug_frame
|
||||
10 .global uart_init
|
||||
12 uart_init:
|
||||
13 .LFB6:
|
||||
14 .file 1 "main.c"
|
||||
1:main.c **** #ifndef F_CPU
|
||||
2:main.c **** #define F_CPU 8000000
|
||||
3:main.c **** #endif
|
||||
4:main.c ****
|
||||
5:main.c **** #include <avr/io.h>
|
||||
6:main.c **** #include <util/delay.h>
|
||||
7:main.c **** #define BAUD 9600
|
||||
8:main.c **** #define m168p
|
||||
9:main.c **** #include <util/setbaud.h>
|
||||
10:main.c ****
|
||||
11:main.c **** /* Definizioni per il m168p */
|
||||
12:main.c **** #ifdef m168p
|
||||
13:main.c **** #define UCSRA UCSR0A
|
||||
14:main.c **** #define UCSRB UCSR0B
|
||||
15:main.c **** #define UCSRC UCSR0C
|
||||
16:main.c **** #define UBRRH UBRR0H
|
||||
17:main.c **** #define UBRRL UBRR0L
|
||||
18:main.c **** #define U2X U2X0
|
||||
19:main.c **** #define UDRE UDRE0
|
||||
20:main.c **** #define UDR UDR0
|
||||
21:main.c **** #endif
|
||||
22:main.c **** /* fine definizioni per il m168p*/
|
||||
23:main.c ****
|
||||
24:main.c **** /* Inizializza la porta seriale */
|
||||
25:main.c **** void uart_init(void)
|
||||
26:main.c **** {
|
||||
15 .loc 1 26 0
|
||||
16 .cfi_startproc
|
||||
17 /* prologue: function */
|
||||
18 /* frame size = 0 */
|
||||
19 /* stack size = 0 */
|
||||
20 .L__stack_usage = 0
|
||||
27:main.c **** UBRRH = UBRRH_VALUE;
|
||||
21 .loc 1 27 0
|
||||
22 0000 1092 C500 sts 197,__zero_reg__
|
||||
28:main.c **** UBRRL = UBRRL_VALUE;
|
||||
23 .loc 1 28 0
|
||||
24 0004 83E3 ldi r24,lo8(51)
|
||||
25 0006 8093 C400 sts 196,r24
|
||||
29:main.c **** #if USE_2X0
|
||||
30:main.c **** UCSRA |= (1 << U2X);
|
||||
31:main.c **** #else
|
||||
32:main.c **** UCSRA &= ~(1 << U2X);
|
||||
26 .loc 1 32 0
|
||||
27 000a E0EC ldi r30,lo8(-64)
|
||||
28 000c F0E0 ldi r31,0
|
||||
29 000e 8081 ld r24,Z
|
||||
30 0010 8D7F andi r24,lo8(-3)
|
||||
31 0012 8083 st Z,r24
|
||||
33:main.c **** #endif
|
||||
34:main.c ****
|
||||
35:main.c **** UCSRC= _BV(UCSZ01) | _BV(UCSZ00); // 8 N 1
|
||||
32 .loc 1 35 0
|
||||
33 0014 86E0 ldi r24,lo8(6)
|
||||
34 0016 8093 C200 sts 194,r24
|
||||
36:main.c **** UCSRB= (1<<TXEN0);
|
||||
35 .loc 1 36 0
|
||||
36 001a 88E0 ldi r24,lo8(8)
|
||||
37 001c 8093 C100 sts 193,r24
|
||||
38 0020 0895 ret
|
||||
39 .cfi_endproc
|
||||
40 .LFE6:
|
||||
42 .global uart_putc
|
||||
44 uart_putc:
|
||||
45 .LFB7:
|
||||
37:main.c **** // UCSRB= (1<<RXEN0)|(1<<TXEN0);
|
||||
38:main.c **** }
|
||||
39:main.c ****
|
||||
40:main.c **** /* uart_putc(): scrive un carattere sulla porta seriale*/
|
||||
41:main.c **** int uart_putc(unsigned char c)
|
||||
42:main.c **** {
|
||||
46 .loc 1 42 0
|
||||
47 .cfi_startproc
|
||||
48 /* prologue: function */
|
||||
49 /* frame size = 0 */
|
||||
50 /* stack size = 0 */
|
||||
51 .L__stack_usage = 0
|
||||
52 .LVL0:
|
||||
53 .L4:
|
||||
43:main.c **** while (!(UCSRA & (1<<UDRE))) { /* warten bis Senden moeglich */
|
||||
54 .loc 1 43 0 discriminator 1
|
||||
55 0022 9091 C000 lds r25,192
|
||||
56 0026 95FF sbrs r25,5
|
||||
57 0028 00C0 rjmp .L4
|
||||
44:main.c **** }
|
||||
45:main.c **** UDR = c; /* sende Zeichen */
|
||||
58 .loc 1 45 0
|
||||
59 002a 8093 C600 sts 198,r24
|
||||
46:main.c **** return 0;
|
||||
47:main.c **** }
|
||||
60 .loc 1 47 0
|
||||
61 002e 80E0 ldi r24,0
|
||||
62 0030 90E0 ldi r25,0
|
||||
63 .LVL1:
|
||||
64 0032 0895 ret
|
||||
65 .cfi_endproc
|
||||
66 .LFE7:
|
||||
68 .global uart_puts
|
||||
70 uart_puts:
|
||||
71 .LFB8:
|
||||
48:main.c ****
|
||||
49:main.c **** /* uart_puts(): scrive una stringa sulla porta seriale*/
|
||||
50:main.c **** void uart_puts (char *s)
|
||||
51:main.c **** {
|
||||
72 .loc 1 51 0
|
||||
73 .cfi_startproc
|
||||
74 .LVL2:
|
||||
75 0034 CF93 push r28
|
||||
76 .LCFI0:
|
||||
77 .cfi_def_cfa_offset 3
|
||||
78 .cfi_offset 28, -2
|
||||
79 0036 DF93 push r29
|
||||
80 .LCFI1:
|
||||
81 .cfi_def_cfa_offset 4
|
||||
82 .cfi_offset 29, -3
|
||||
83 /* prologue: function */
|
||||
84 /* frame size = 0 */
|
||||
85 /* stack size = 2 */
|
||||
86 .L__stack_usage = 2
|
||||
87 0038 EC01 movw r28,r24
|
||||
88 .LVL3:
|
||||
89 .L7:
|
||||
52:main.c **** while (*s) {
|
||||
90 .loc 1 52 0 discriminator 1
|
||||
91 003a 8991 ld r24,Y+
|
||||
92 .LVL4:
|
||||
93 003c 8823 tst r24
|
||||
94 003e 01F0 breq .L9
|
||||
53:main.c **** uart_putc(*s);
|
||||
95 .loc 1 53 0
|
||||
96 0040 0E94 0000 call uart_putc
|
||||
97 .LVL5:
|
||||
98 0044 00C0 rjmp .L7
|
||||
99 .LVL6:
|
||||
100 .L9:
|
||||
101 /* epilogue start */
|
||||
54:main.c **** s++;
|
||||
55:main.c **** }
|
||||
56:main.c **** }
|
||||
102 .loc 1 56 0
|
||||
103 0046 DF91 pop r29
|
||||
104 0048 CF91 pop r28
|
||||
105 .LVL7:
|
||||
106 004a 0895 ret
|
||||
107 .cfi_endproc
|
||||
108 .LFE8:
|
||||
110 .section .rodata.str1.1,"aMS",@progbits,1
|
||||
111 .LC0:
|
||||
112 0000 434C 00 .string "CL"
|
||||
113 .LC1:
|
||||
114 0003 4453 5300 .string "DSS"
|
||||
115 .LC2:
|
||||
116 0007 5454 2A20 .string "TT* Love Silvia *\n"
|
||||
116 4C6F 7665
|
||||
116 2020 5369
|
||||
116 6C76 6961
|
||||
116 202A 0A00
|
||||
117 .LC3:
|
||||
118 001b 5452 5400 .string "TRT"
|
||||
119 .section .text.startup,"ax",@progbits
|
||||
120 .global main
|
||||
122 main:
|
||||
123 .LFB9:
|
||||
57:main.c ****
|
||||
58:main.c **** /* Funzioni oer il display Digole */
|
||||
59:main.c ****
|
||||
60:main.c **** /* Main - Programma principale*/
|
||||
61:main.c **** int main (void)
|
||||
62:main.c **** {
|
||||
124 .loc 1 62 0
|
||||
125 .cfi_startproc
|
||||
126 /* prologue: function */
|
||||
127 /* frame size = 0 */
|
||||
128 /* stack size = 0 */
|
||||
129 .L__stack_usage = 0
|
||||
63:main.c **** unsigned char zwischenspeicher;
|
||||
64:main.c **** DDRC = 0b00000001;
|
||||
130 .loc 1 64 0
|
||||
131 0000 81E0 ldi r24,lo8(1)
|
||||
132 0002 87B9 out 0x7,r24
|
||||
65:main.c ****
|
||||
66:main.c **** uart_init();
|
||||
133 .loc 1 66 0
|
||||
134 0004 0E94 0000 call uart_init
|
||||
135 .LVL8:
|
||||
136 .LBB6:
|
||||
137 .LBB7:
|
||||
138 .file 2 "e:\\progs\\arduino-1.7.4\\hardware\\tools\\avr\\avr\\include\\util\\delay.h"
|
||||
1:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* Copyright (c) 2002, Marek Michalkiewicz
|
||||
2:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Copyright (c) 2004,2005,2007 Joerg Wunsch
|
||||
3:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Copyright (c) 2007 Florin-Viorel Petrov
|
||||
4:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** All rights reserved.
|
||||
5:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
6:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Redistribution and use in source and binary forms, with or without
|
||||
7:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** modification, are permitted provided that the following conditions are met:
|
||||
8:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
9:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Redistributions of source code must retain the above copyright
|
||||
10:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** notice, this list of conditions and the following disclaimer.
|
||||
11:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
12:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Redistributions in binary form must reproduce the above copyright
|
||||
13:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** notice, this list of conditions and the following disclaimer in
|
||||
14:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** the documentation and/or other materials provided with the
|
||||
15:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** distribution.
|
||||
16:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
17:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Neither the name of the copyright holders nor the names of
|
||||
18:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** contributors may be used to endorse or promote products derived
|
||||
19:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** from this software without specific prior written permission.
|
||||
20:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
21:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
22:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
23:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
24:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
25:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
26:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
27:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
28:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
29:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
30:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
31:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** POSSIBILITY OF SUCH DAMAGE. */
|
||||
32:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
33:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* $Id$ */
|
||||
34:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
35:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef _UTIL_DELAY_H_
|
||||
36:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define _UTIL_DELAY_H_ 1
|
||||
37:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
38:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef __HAS_DELAY_CYCLES
|
||||
39:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define __HAS_DELAY_CYCLES 1
|
||||
40:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
41:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
42:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <inttypes.h>
|
||||
43:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <util/delay_basic.h>
|
||||
44:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <math.h>
|
||||
45:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
46:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /** \file */
|
||||
47:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /** \defgroup util_delay <util/delay.h>: Convenience functions for busy-wait delay loops
|
||||
48:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \code
|
||||
49:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define F_CPU 1000000UL // 1 MHz
|
||||
50:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** //#define F_CPU 14.7456E6
|
||||
51:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <util/delay.h>
|
||||
52:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \endcode
|
||||
53:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
54:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \note As an alternative method, it is possible to pass the
|
||||
55:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** F_CPU macro down to the compiler from the Makefile.
|
||||
56:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Obviously, in that case, no \c \#define statement should be
|
||||
57:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** used.
|
||||
58:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
59:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The functions in this header file are wrappers around the basic
|
||||
60:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** busy-wait functions from <util/delay_basic.h>. They are meant as
|
||||
61:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** convenience functions where actual time values can be specified
|
||||
62:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** rather than a number of cycles to wait for. The idea behind is
|
||||
63:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** that compile-time constant expressions will be eliminated by
|
||||
64:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** compiler optimization so floating-point expressions can be used
|
||||
65:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** to calculate the number of delay cycles needed based on the CPU
|
||||
66:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** frequency passed by the macro F_CPU.
|
||||
67:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
68:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \note In order for these functions to work as intended, compiler
|
||||
69:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** optimizations <em>must</em> be enabled, and the delay time
|
||||
70:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** <em>must</em> be an expression that is a known constant at
|
||||
71:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** compile-time. If these requirements are not met, the resulting
|
||||
72:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** delay will be much longer (and basically unpredictable), and
|
||||
73:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** applications that otherwise do not use floating-point calculations
|
||||
74:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** will experience severe code bloat by the floating-point library
|
||||
75:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** routines linked into the application.
|
||||
76:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
77:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The functions available allow the specification of microsecond, and
|
||||
78:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** millisecond delays directly, using the application-supplied macro
|
||||
79:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** F_CPU as the CPU clock frequency (in Hertz).
|
||||
80:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
81:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** */
|
||||
82:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
83:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if !defined(__DOXYGEN__)
|
||||
84:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** static inline void _delay_us(double __us) __attribute__((always_inline));
|
||||
85:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** static inline void _delay_ms(double __ms) __attribute__((always_inline));
|
||||
86:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
87:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
88:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef F_CPU
|
||||
89:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* prevent compiler error by supplying a default */
|
||||
90:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # warning "F_CPU not defined for <util/delay.h>"
|
||||
91:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # define F_CPU 1000000UL
|
||||
92:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
93:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
94:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef __OPTIMIZE__
|
||||
95:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
|
||||
96:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
97:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
98:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
||||
99:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
||||
100:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __STDC_HOSTED__
|
||||
101:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # include <math.h>
|
||||
102:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
103:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
104:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /**
|
||||
105:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \ingroup util_delay
|
||||
106:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
107:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Perform a delay of \c __ms milliseconds, using _delay_loop_2().
|
||||
108:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
109:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The macro F_CPU is supposed to be defined to a
|
||||
110:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** constant defining the CPU clock frequency (in Hertz).
|
||||
111:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
112:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The maximal possible delay is 262.14 ms / F_CPU in MHz.
|
||||
113:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
114:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** When the user request delay which exceed the maximum possible one,
|
||||
115:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** _delay_ms() provides a decreased resolution functionality. In this
|
||||
116:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** mode _delay_ms() will work with a resolution of 1/10 ms, providing
|
||||
117:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** delays up to 6.5535 seconds (independent from CPU frequency). The
|
||||
118:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** user will not be informed about decreased resolution.
|
||||
119:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
120:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long)
|
||||
121:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** support, maximal possible delay is 4294967.295 ms/ F_CPU in MHz. For
|
||||
122:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** values greater than the maximal possible delay, overflows results in
|
||||
123:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** no delay i.e., 0ms.
|
||||
124:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
125:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Conversion of __us into clock cycles may not always result in integer.
|
||||
126:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** By default, the clock cycles rounded up to next integer. This ensures that
|
||||
127:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** the user gets atleast __us microseconds of delay.
|
||||
128:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
129:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Alternatively, user can define __DELAY_ROUND_DOWN__ and __DELAY_ROUND_CLOSEST__
|
||||
130:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** to round down and round to closest integer.
|
||||
131:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
132:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Note: The new implementation of _delay_ms(double __ms) with
|
||||
133:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __builtin_avr_delay_cycles(unsigned long) support is not backward compatible.
|
||||
134:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay.
|
||||
135:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Also, the backward compatible
|
||||
136:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** algorithm will be chosen if the code is compiled in a <em>freestanding
|
||||
137:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** environment</em> (GCC option \c -ffreestanding), as the math functions
|
||||
138:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** required for rounding are not available to the compiler then.
|
||||
139:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
140:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** */
|
||||
141:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** void
|
||||
142:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** _delay_ms(double __ms)
|
||||
143:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** {
|
||||
144:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** double __tmp ;
|
||||
145:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
||||
146:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
||||
147:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __STDC_HOSTED__
|
||||
148:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** uint32_t __ticks_dc;
|
||||
149:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** extern void __builtin_avr_delay_cycles(unsigned long);
|
||||
150:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __tmp = ((F_CPU) / 1e3) * __ms;
|
||||
151:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
152:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if defined(__DELAY_ROUND_DOWN__)
|
||||
153:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)fabs(__tmp);
|
||||
154:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
155:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #elif defined(__DELAY_ROUND_CLOSEST__)
|
||||
156:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)(fabs(__tmp)+0.5);
|
||||
157:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
158:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #else
|
||||
159:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** //round up by default
|
||||
160:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
161:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
162:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
163:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __builtin_avr_delay_cycles(__ticks_dc);
|
||||
139 .loc 2 163 0
|
||||
140 0008 2FEF ldi r18,lo8(4799999)
|
||||
141 000a 3DE3 ldi r19,hi8(4799999)
|
||||
142 000c 89E4 ldi r24,hlo8(4799999)
|
||||
143 000e 2150 1: subi r18,1
|
||||
144 0010 3040 sbci r19,0
|
||||
145 0012 8040 sbci r24,0
|
||||
146 0014 01F4 brne 1b
|
||||
147 0016 00C0 rjmp .
|
||||
148 0018 0000 nop
|
||||
149 .LBE7:
|
||||
150 .LBE6:
|
||||
67:main.c **** _delay_ms(3000);
|
||||
68:main.c **** uart_puts("CL");
|
||||
151 .loc 1 68 0
|
||||
152 001a 80E0 ldi r24,lo8(.LC0)
|
||||
153 001c 90E0 ldi r25,hi8(.LC0)
|
||||
154 001e 0E94 0000 call uart_puts
|
||||
155 .LVL9:
|
||||
69:main.c **** uart_puts("DSS");
|
||||
156 .loc 1 69 0
|
||||
157 0022 80E0 ldi r24,lo8(.LC1)
|
||||
158 0024 90E0 ldi r25,hi8(.LC1)
|
||||
159 0026 0E94 0000 call uart_puts
|
||||
160 .LVL10:
|
||||
70:main.c **** uart_putc(0);
|
||||
161 .loc 1 70 0
|
||||
162 002a 80E0 ldi r24,0
|
||||
163 002c 0E94 0000 call uart_putc
|
||||
164 .LVL11:
|
||||
71:main.c **** uart_puts("TT* Love Silvia *\n");
|
||||
165 .loc 1 71 0
|
||||
166 0030 80E0 ldi r24,lo8(.LC2)
|
||||
167 0032 90E0 ldi r25,hi8(.LC2)
|
||||
168 0034 0E94 0000 call uart_puts
|
||||
169 .LVL12:
|
||||
72:main.c **** uart_puts("TRT");
|
||||
170 .loc 1 72 0
|
||||
171 0038 80E0 ldi r24,lo8(.LC3)
|
||||
172 003a 90E0 ldi r25,hi8(.LC3)
|
||||
173 003c 0E94 0000 call uart_puts
|
||||
174 .LVL13:
|
||||
73:main.c **** uart_puts("TT* Love Silvia *\n");
|
||||
175 .loc 1 73 0
|
||||
176 0040 80E0 ldi r24,lo8(.LC2)
|
||||
177 0042 90E0 ldi r25,hi8(.LC2)
|
||||
178 0044 0E94 0000 call uart_puts
|
||||
179 .LVL14:
|
||||
74:main.c **** uart_puts("TRT");
|
||||
180 .loc 1 74 0
|
||||
181 0048 80E0 ldi r24,lo8(.LC3)
|
||||
182 004a 90E0 ldi r25,hi8(.LC3)
|
||||
183 004c 0E94 0000 call uart_puts
|
||||
184 .LVL15:
|
||||
75:main.c **** uart_puts("TT* Love Silvia *\n");
|
||||
185 .loc 1 75 0
|
||||
186 0050 80E0 ldi r24,lo8(.LC2)
|
||||
187 0052 90E0 ldi r25,hi8(.LC2)
|
||||
188 0054 0E94 0000 call uart_puts
|
||||
189 .LVL16:
|
||||
76:main.c **** uart_puts("TRT");
|
||||
190 .loc 1 76 0
|
||||
191 0058 80E0 ldi r24,lo8(.LC3)
|
||||
192 005a 90E0 ldi r25,hi8(.LC3)
|
||||
193 005c 0E94 0000 call uart_puts
|
||||
194 .LVL17:
|
||||
77:main.c **** uart_puts("TT* Love Silvia *\n");
|
||||
195 .loc 1 77 0
|
||||
196 0060 80E0 ldi r24,lo8(.LC2)
|
||||
197 0062 90E0 ldi r25,hi8(.LC2)
|
||||
198 0064 0E94 0000 call uart_puts
|
||||
199 .LVL18:
|
||||
78:main.c **** uart_puts("TRT");
|
||||
200 .loc 1 78 0
|
||||
201 0068 80E0 ldi r24,lo8(.LC3)
|
||||
202 006a 90E0 ldi r25,hi8(.LC3)
|
||||
203 006c 0E94 0000 call uart_puts
|
||||
204 .LVL19:
|
||||
79:main.c **** uart_puts("TT* Love Silvia *\n");
|
||||
205 .loc 1 79 0
|
||||
206 0070 80E0 ldi r24,lo8(.LC2)
|
||||
207 0072 90E0 ldi r25,hi8(.LC2)
|
||||
208 0074 0E94 0000 call uart_puts
|
||||
209 .LVL20:
|
||||
80:main.c **** uart_puts("TRT");
|
||||
210 .loc 1 80 0
|
||||
211 0078 80E0 ldi r24,lo8(.LC3)
|
||||
212 007a 90E0 ldi r25,hi8(.LC3)
|
||||
213 007c 0E94 0000 call uart_puts
|
||||
214 .LVL21:
|
||||
81:main.c ****
|
||||
82:main.c **** /*
|
||||
83:main.c **** uart_puts("SF");
|
||||
84:main.c **** uart_putc(6);
|
||||
85:main.c **** uart_puts("TT12345678901234567890123456789012\n");
|
||||
86:main.c ****
|
||||
87:main.c **** uart_puts("SF");
|
||||
88:main.c **** uart_putc(10);
|
||||
89:main.c **** uart_puts("TRT");
|
||||
90:main.c **** uart_puts("TT123456789012345678901\n");
|
||||
91:main.c ****
|
||||
92:main.c **** uart_puts("SF");
|
||||
93:main.c **** uart_putc(0);
|
||||
94:main.c **** uart_puts("TRT");
|
||||
95:main.c **** uart_puts("TT1234567890123456\n");
|
||||
96:main.c ****
|
||||
97:main.c **** uart_puts("SF");
|
||||
98:main.c **** uart_putc(18);
|
||||
99:main.c **** uart_puts("TRT");
|
||||
100:main.c **** uart_puts("TT12345678901234\n");
|
||||
101:main.c **** */
|
||||
102:main.c ****
|
||||
103:main.c **** while(1) {
|
||||
104:main.c **** zwischenspeicher = PORTC;
|
||||
105:main.c **** zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
215 .loc 1 105 0
|
||||
216 0080 91E0 ldi r25,lo8(1)
|
||||
217 .L11:
|
||||
104:main.c **** zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
||||
218 .loc 1 104 0 discriminator 1
|
||||
219 0082 88B1 in r24,0x8
|
||||
220 .LVL22:
|
||||
221 .loc 1 105 0 discriminator 1
|
||||
222 0084 8927 eor r24,r25
|
||||
223 .LVL23:
|
||||
106:main.c **** PORTC = zwischenspeicher;
|
||||
224 .loc 1 106 0 discriminator 1
|
||||
225 0086 88B9 out 0x8,r24
|
||||
226 .LVL24:
|
||||
227 .LBB8:
|
||||
228 .LBB9:
|
||||
229 .loc 2 163 0 discriminator 1
|
||||
230 0088 2FEF ldi r18,lo8(799999)
|
||||
231 008a 34E3 ldi r19,hi8(799999)
|
||||
232 008c 8CE0 ldi r24,hlo8(799999)
|
||||
233 008e 2150 1: subi r18,1
|
||||
234 0090 3040 sbci r19,0
|
||||
235 0092 8040 sbci r24,0
|
||||
236 0094 01F4 brne 1b
|
||||
237 .LVL25:
|
||||
238 0096 00C0 rjmp .
|
||||
239 0098 0000 nop
|
||||
240 009a 00C0 rjmp .L11
|
||||
241 .LBE9:
|
||||
242 .LBE8:
|
||||
243 .cfi_endproc
|
||||
244 .LFE9:
|
||||
246 .text
|
||||
247 .Letext0:
|
||||
248 .file 3 "e:\\progs\\arduino-1.7.4\\hardware\\tools\\avr\\avr\\include\\stdint.h"
|
||||
DEFINED SYMBOLS
|
||||
*ABS*:00000000 main.c
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:2 *ABS*:0000003e __SP_H__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:3 *ABS*:0000003d __SP_L__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:4 *ABS*:0000003f __SREG__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:5 *ABS*:00000000 __tmp_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:6 *ABS*:00000001 __zero_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:12 .text:00000000 uart_init
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:44 .text:00000022 uart_putc
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:70 .text:00000034 uart_puts
|
||||
C:\Users\q242695\AppData\Local\Temp\cc4MGEr5.s:122 .text.startup:00000000 main
|
||||
|
||||
UNDEFINED SYMBOLS
|
||||
__do_copy_data
|
||||
463
trunk/AVRProjects/ATMega168/main.map
Normal file
463
trunk/AVRProjects/ATMega168/main.map
Normal file
@@ -0,0 +1,463 @@
|
||||
Archive member included to satisfy reference by file (symbol)
|
||||
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o (exit)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
main.o (__do_copy_data)
|
||||
|
||||
Memory Configuration
|
||||
|
||||
Name Origin Length Attributes
|
||||
text 0x00000000 0x00020000 xr
|
||||
data 0x00800060 0x0000ffa0 rw !x
|
||||
eeprom 0x00810000 0x00010000 rw !x
|
||||
fuse 0x00820000 0x00000400 rw !x
|
||||
lock 0x00830000 0x00000400 rw !x
|
||||
signature 0x00840000 0x00000400 rw !x
|
||||
*default* 0x00000000 0xffffffff
|
||||
|
||||
Linker script and memory map
|
||||
|
||||
Address of section .data set to 0x800100
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
LOAD main.o
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libm.a
|
||||
START GROUP
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libm.a
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libc.a
|
||||
END GROUP
|
||||
|
||||
.hash
|
||||
*(.hash)
|
||||
|
||||
.dynsym
|
||||
*(.dynsym)
|
||||
|
||||
.dynstr
|
||||
*(.dynstr)
|
||||
|
||||
.gnu.version
|
||||
*(.gnu.version)
|
||||
|
||||
.gnu.version_d
|
||||
*(.gnu.version_d)
|
||||
|
||||
.gnu.version_r
|
||||
*(.gnu.version_r)
|
||||
|
||||
.rel.init
|
||||
*(.rel.init)
|
||||
|
||||
.rela.init
|
||||
*(.rela.init)
|
||||
|
||||
.rel.text
|
||||
*(.rel.text)
|
||||
*(.rel.text.*)
|
||||
*(.rel.gnu.linkonce.t*)
|
||||
|
||||
.rela.text
|
||||
*(.rela.text)
|
||||
*(.rela.text.*)
|
||||
*(.rela.gnu.linkonce.t*)
|
||||
|
||||
.rel.fini
|
||||
*(.rel.fini)
|
||||
|
||||
.rela.fini
|
||||
*(.rela.fini)
|
||||
|
||||
.rel.rodata
|
||||
*(.rel.rodata)
|
||||
*(.rel.rodata.*)
|
||||
*(.rel.gnu.linkonce.r*)
|
||||
|
||||
.rela.rodata
|
||||
*(.rela.rodata)
|
||||
*(.rela.rodata.*)
|
||||
*(.rela.gnu.linkonce.r*)
|
||||
|
||||
.rel.data
|
||||
*(.rel.data)
|
||||
*(.rel.data.*)
|
||||
*(.rel.gnu.linkonce.d*)
|
||||
|
||||
.rela.data
|
||||
*(.rela.data)
|
||||
*(.rela.data.*)
|
||||
*(.rela.gnu.linkonce.d*)
|
||||
|
||||
.rel.ctors
|
||||
*(.rel.ctors)
|
||||
|
||||
.rela.ctors
|
||||
*(.rela.ctors)
|
||||
|
||||
.rel.dtors
|
||||
*(.rel.dtors)
|
||||
|
||||
.rela.dtors
|
||||
*(.rela.dtors)
|
||||
|
||||
.rel.got
|
||||
*(.rel.got)
|
||||
|
||||
.rela.got
|
||||
*(.rela.got)
|
||||
|
||||
.rel.bss
|
||||
*(.rel.bss)
|
||||
|
||||
.rela.bss
|
||||
*(.rela.bss)
|
||||
|
||||
.rel.plt
|
||||
*(.rel.plt)
|
||||
|
||||
.rela.plt
|
||||
*(.rela.plt)
|
||||
|
||||
.text 0x00000000 0x182
|
||||
*(.vectors)
|
||||
.vectors 0x00000000 0x68 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
0x00000000 __vector_default
|
||||
0x00000000 __vectors
|
||||
*(.vectors)
|
||||
*(.progmem.gcc*)
|
||||
0x00000068 . = ALIGN (0x2)
|
||||
0x00000068 __trampolines_start = .
|
||||
*(.trampolines)
|
||||
.trampolines 0x00000068 0x0 linker stubs
|
||||
*(.trampolines*)
|
||||
0x00000068 __trampolines_end = .
|
||||
*(.progmem*)
|
||||
0x00000068 . = ALIGN (0x2)
|
||||
*(.jumptables)
|
||||
*(.jumptables*)
|
||||
*(.lowtext)
|
||||
*(.lowtext*)
|
||||
0x00000068 __ctors_start = .
|
||||
*(.ctors)
|
||||
0x00000068 __ctors_end = .
|
||||
0x00000068 __dtors_start = .
|
||||
*(.dtors)
|
||||
0x00000068 __dtors_end = .
|
||||
SORT(*)(.ctors)
|
||||
SORT(*)(.dtors)
|
||||
*(.init0)
|
||||
.init0 0x00000068 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
0x00000068 __init
|
||||
*(.init0)
|
||||
*(.init1)
|
||||
*(.init1)
|
||||
*(.init2)
|
||||
.init2 0x00000068 0xc e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
*(.init2)
|
||||
*(.init3)
|
||||
*(.init3)
|
||||
*(.init4)
|
||||
.init4 0x00000074 0x16 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
0x00000074 __do_copy_data
|
||||
*(.init4)
|
||||
*(.init5)
|
||||
*(.init5)
|
||||
*(.init6)
|
||||
*(.init6)
|
||||
*(.init7)
|
||||
*(.init7)
|
||||
*(.init8)
|
||||
*(.init8)
|
||||
*(.init9)
|
||||
.init9 0x0000008a 0x8 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
*(.init9)
|
||||
*(.text)
|
||||
.text 0x00000092 0x4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
0x00000092 __vector_22
|
||||
0x00000092 __vector_1
|
||||
0x00000092 __vector_24
|
||||
0x00000092 __vector_12
|
||||
0x00000092 __bad_interrupt
|
||||
0x00000092 __vector_6
|
||||
0x00000092 __vector_3
|
||||
0x00000092 __vector_23
|
||||
0x00000092 __vector_25
|
||||
0x00000092 __vector_11
|
||||
0x00000092 __vector_13
|
||||
0x00000092 __vector_17
|
||||
0x00000092 __vector_19
|
||||
0x00000092 __vector_7
|
||||
0x00000092 __vector_5
|
||||
0x00000092 __vector_4
|
||||
0x00000092 __vector_9
|
||||
0x00000092 __vector_2
|
||||
0x00000092 __vector_21
|
||||
0x00000092 __vector_15
|
||||
0x00000092 __vector_8
|
||||
0x00000092 __vector_14
|
||||
0x00000092 __vector_10
|
||||
0x00000092 __vector_16
|
||||
0x00000092 __vector_18
|
||||
0x00000092 __vector_20
|
||||
.text 0x00000096 0x4c main.o
|
||||
0x00000096 uart_init
|
||||
0x000000b8 uart_putc
|
||||
0x000000ca uart_puts
|
||||
.text 0x000000e2 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text 0x000000e2 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
0x000000e2 . = ALIGN (0x2)
|
||||
*(.text.*)
|
||||
.text.startup 0x000000e2 0x9c main.o
|
||||
0x000000e2 main
|
||||
.text.libgcc.mul
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.div
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc 0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.prologue
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.builtins
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.fmul
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.fixed
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.mul
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
.text.libgcc.div
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
.text.libgcc 0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
.text.libgcc.prologue
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
.text.libgcc.builtins
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
.text.libgcc.fmul
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
.text.libgcc.fixed
|
||||
0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
0x0000017e . = ALIGN (0x2)
|
||||
*(.fini9)
|
||||
.fini9 0x0000017e 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
0x0000017e _exit
|
||||
0x0000017e exit
|
||||
*(.fini9)
|
||||
*(.fini8)
|
||||
*(.fini8)
|
||||
*(.fini7)
|
||||
*(.fini7)
|
||||
*(.fini6)
|
||||
*(.fini6)
|
||||
*(.fini5)
|
||||
*(.fini5)
|
||||
*(.fini4)
|
||||
*(.fini4)
|
||||
*(.fini3)
|
||||
*(.fini3)
|
||||
*(.fini2)
|
||||
*(.fini2)
|
||||
*(.fini1)
|
||||
*(.fini1)
|
||||
*(.fini0)
|
||||
.fini0 0x0000017e 0x4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
*(.fini0)
|
||||
0x00000182 _etext = .
|
||||
|
||||
.data 0x00800100 0x20 load address 0x00000182
|
||||
0x00800100 PROVIDE (__data_start, .)
|
||||
*(.data)
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
.data 0x00800100 0x0 main.o
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
*(.data*)
|
||||
*(.rodata)
|
||||
*(.rodata*)
|
||||
.rodata.str1.1
|
||||
0x00800100 0x1f main.o
|
||||
*(.gnu.linkonce.d*)
|
||||
0x00800120 . = ALIGN (0x2)
|
||||
*fill* 0x0080011f 0x1
|
||||
0x00800120 _edata = .
|
||||
0x00800120 PROVIDE (__data_end, .)
|
||||
|
||||
.bss 0x00800120 0x0
|
||||
0x00800120 PROVIDE (__bss_start, .)
|
||||
*(.bss)
|
||||
.bss 0x00800120 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
.bss 0x00800120 0x0 main.o
|
||||
.bss 0x00800120 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.bss 0x00800120 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
0x00800120 PROVIDE (__bss_end, .)
|
||||
0x00000182 __data_load_start = LOADADDR (.data)
|
||||
0x000001a2 __data_load_end = (__data_load_start + SIZEOF (.data))
|
||||
|
||||
.noinit 0x00800120 0x0
|
||||
0x00800120 PROVIDE (__noinit_start, .)
|
||||
*(.noinit*)
|
||||
0x00800120 PROVIDE (__noinit_end, .)
|
||||
0x00800120 _end = .
|
||||
0x00800120 PROVIDE (__heap_start, .)
|
||||
|
||||
.eeprom 0x00810000 0x0
|
||||
*(.eeprom*)
|
||||
0x00810000 __eeprom_end = .
|
||||
|
||||
.fuse
|
||||
*(.fuse)
|
||||
*(.lfuse)
|
||||
*(.hfuse)
|
||||
*(.efuse)
|
||||
|
||||
.lock
|
||||
*(.lock*)
|
||||
|
||||
.signature
|
||||
*(.signature*)
|
||||
|
||||
.stab
|
||||
*(.stab)
|
||||
|
||||
.stabstr
|
||||
*(.stabstr)
|
||||
|
||||
.stab.excl
|
||||
*(.stab.excl)
|
||||
|
||||
.stab.exclstr
|
||||
*(.stab.exclstr)
|
||||
|
||||
.stab.index
|
||||
*(.stab.index)
|
||||
|
||||
.stab.indexstr
|
||||
*(.stab.indexstr)
|
||||
|
||||
.comment 0x00000000 0x11
|
||||
*(.comment)
|
||||
.comment 0x00000000 0x11 main.o
|
||||
0x12 (size before relaxing)
|
||||
|
||||
.note.gnu.build-id
|
||||
*(.note.gnu.build-id)
|
||||
|
||||
.debug
|
||||
*(.debug)
|
||||
|
||||
.line
|
||||
*(.line)
|
||||
|
||||
.debug_srcinfo
|
||||
*(.debug_srcinfo)
|
||||
|
||||
.debug_sfnames
|
||||
*(.debug_sfnames)
|
||||
|
||||
.debug_aranges 0x00000000 0x28
|
||||
*(.debug_aranges)
|
||||
.debug_aranges
|
||||
0x00000000 0x28 main.o
|
||||
|
||||
.debug_pubnames
|
||||
*(.debug_pubnames)
|
||||
|
||||
.debug_info 0x00000000 0x340
|
||||
*(.debug_info .gnu.linkonce.wi.*)
|
||||
.debug_info 0x00000000 0x340 main.o
|
||||
|
||||
.debug_abbrev 0x00000000 0x168
|
||||
*(.debug_abbrev)
|
||||
.debug_abbrev 0x00000000 0x168 main.o
|
||||
|
||||
.debug_line 0x00000000 0x117
|
||||
*(.debug_line .debug_line.* .debug_line_end)
|
||||
.debug_line 0x00000000 0x117 main.o
|
||||
|
||||
.debug_frame 0x00000000 0x60
|
||||
*(.debug_frame)
|
||||
.debug_frame 0x00000000 0x60 main.o
|
||||
|
||||
.debug_str 0x00000000 0x153
|
||||
*(.debug_str)
|
||||
.debug_str 0x00000000 0x153 main.o
|
||||
0x18c (size before relaxing)
|
||||
|
||||
.debug_loc 0x00000000 0xbf
|
||||
*(.debug_loc)
|
||||
.debug_loc 0x00000000 0xbf main.o
|
||||
|
||||
.debug_macinfo
|
||||
*(.debug_macinfo)
|
||||
|
||||
.debug_weaknames
|
||||
*(.debug_weaknames)
|
||||
|
||||
.debug_funcnames
|
||||
*(.debug_funcnames)
|
||||
|
||||
.debug_typenames
|
||||
*(.debug_typenames)
|
||||
|
||||
.debug_varnames
|
||||
*(.debug_varnames)
|
||||
|
||||
.debug_pubtypes
|
||||
*(.debug_pubtypes)
|
||||
|
||||
.debug_ranges 0x00000000 0x18
|
||||
*(.debug_ranges)
|
||||
.debug_ranges 0x00000000 0x18 main.o
|
||||
|
||||
.debug_macro
|
||||
*(.debug_macro)
|
||||
OUTPUT(main.elf elf32-avr)
|
||||
LOAD linker stubs
|
||||
|
||||
Cross Reference Table
|
||||
|
||||
Symbol File
|
||||
__bad_interrupt e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__data_end e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
__data_load_start e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
__data_start e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
__do_copy_data e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||
main.o
|
||||
__heap_end e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__init e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__stack e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_1 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_10 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_11 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_12 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_13 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_14 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_15 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_16 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_17 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_18 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_19 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_2 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_20 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_21 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_22 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_23 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_24 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_25 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_3 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_5 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_6 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_7 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_8 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_9 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vector_default e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
__vectors e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
_exit e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
exit e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
main main.o
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm168p.o
|
||||
uart_init main.o
|
||||
uart_putc main.o
|
||||
uart_puts main.o
|
||||
58
trunk/AVRProjects/ATMega168/main.sym
Normal file
58
trunk/AVRProjects/ATMega168/main.sym
Normal file
@@ -0,0 +1,58 @@
|
||||
00000000 W __heap_end
|
||||
00000000 a __tmp_reg__
|
||||
00000000 W __vector_default
|
||||
00000000 T __vectors
|
||||
00000001 a __zero_reg__
|
||||
0000003d a __SP_L__
|
||||
0000003e a __SP_H__
|
||||
0000003f a __SREG__
|
||||
00000068 T __ctors_end
|
||||
00000068 T __ctors_start
|
||||
00000068 T __dtors_end
|
||||
00000068 T __dtors_start
|
||||
00000068 W __init
|
||||
00000068 T __trampolines_end
|
||||
00000068 T __trampolines_start
|
||||
00000074 T __do_copy_data
|
||||
00000092 T __bad_interrupt
|
||||
00000092 W __vector_1
|
||||
00000092 W __vector_10
|
||||
00000092 W __vector_11
|
||||
00000092 W __vector_12
|
||||
00000092 W __vector_13
|
||||
00000092 W __vector_14
|
||||
00000092 W __vector_15
|
||||
00000092 W __vector_16
|
||||
00000092 W __vector_17
|
||||
00000092 W __vector_18
|
||||
00000092 W __vector_19
|
||||
00000092 W __vector_2
|
||||
00000092 W __vector_20
|
||||
00000092 W __vector_21
|
||||
00000092 W __vector_22
|
||||
00000092 W __vector_23
|
||||
00000092 W __vector_24
|
||||
00000092 W __vector_25
|
||||
00000092 W __vector_3
|
||||
00000092 W __vector_4
|
||||
00000092 W __vector_5
|
||||
00000092 W __vector_6
|
||||
00000092 W __vector_7
|
||||
00000092 W __vector_8
|
||||
00000092 W __vector_9
|
||||
00000096 T uart_init
|
||||
000000b8 T uart_putc
|
||||
000000ca T uart_puts
|
||||
000000e2 T main
|
||||
0000017e T _exit
|
||||
0000017e W exit
|
||||
00000180 t __stop_program
|
||||
00000182 A __data_load_start
|
||||
00000182 T _etext
|
||||
000001a2 A __data_load_end
|
||||
000004ff W __stack
|
||||
00800100 D __data_start
|
||||
00800120 D __data_end
|
||||
00800120 D _edata
|
||||
00800120 T _end
|
||||
00810000 T __eeprom_end
|
||||
441
trunk/AVRProjects/ATMega168/makefile
Normal file
441
trunk/AVRProjects/ATMega168/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega168p
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 8000000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
46
trunk/AVRProjects/ATMega328/.dep/main.o.d
Normal file
46
trunk/AVRProjects/ATMega328/.dep/main.o.d
Normal file
@@ -0,0 +1,46 @@
|
||||
main.o: main.c \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\io.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\sfr_defs.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\inttypes.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\stdint.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom328.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom328p.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\portpins.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\common.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\version.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\fuse.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\lock.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay_basic.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\math.h
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\io.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\sfr_defs.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\inttypes.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\stdint.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom328.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom328p.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\portpins.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\common.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\version.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\fuse.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\lock.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay_basic.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\math.h:
|
||||
44
trunk/AVRProjects/ATMega328/main.c
Normal file
44
trunk/AVRProjects/ATMega328/main.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 88 / Mega 168 / Mega 328 Pin map
|
||||
+-\/-+
|
||||
/Reset PC6 1|o |28 PC5 ADC5
|
||||
RXD PD0 2| |27 PC4 ADC4
|
||||
TXD PD1 3| |26 PC3 ADC3
|
||||
PD2 4| |25 PC2 ADC2
|
||||
OC2B PD3 5| |24 PC1 ADC1
|
||||
PD4 6| |23 PC0 ADC0
|
||||
VCC 7| |22 GND
|
||||
GND 8| |21 AREF
|
||||
OSC1 PB6 9| |20 VCC
|
||||
OSC2 PB7 10| |19 PB5 SCK
|
||||
OC0B PD5 11| |18 PB4 MISO
|
||||
AIN0 OC0A PD6 12| |17 PB3 OC2A MOSI
|
||||
AIN1 PD7 13| |16 PB2 OC1B
|
||||
PB0 14| |15 PB1 OC1A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000100;
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
PORTB = zwischenspeicher;
|
||||
_delay_ms(500);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
1
trunk/AVRProjects/ATMega328/main.eep
Normal file
1
trunk/AVRProjects/ATMega328/main.eep
Normal file
@@ -0,0 +1 @@
|
||||
:00000001FF
|
||||
BIN
trunk/AVRProjects/ATMega328/main.elf
Normal file
BIN
trunk/AVRProjects/ATMega328/main.elf
Normal file
Binary file not shown.
12
trunk/AVRProjects/ATMega328/main.hex
Normal file
12
trunk/AVRProjects/ATMega328/main.hex
Normal file
@@ -0,0 +1,12 @@
|
||||
:100000000C9434000C943E000C943E000C943E0082
|
||||
:100010000C943E000C943E000C943E000C943E0068
|
||||
:100020000C943E000C943E000C943E000C943E0058
|
||||
:100030000C943E000C943E000C943E000C943E0048
|
||||
:100040000C943E000C943E000C943E000C943E0038
|
||||
:100050000C943E000C943E000C943E000C943E0028
|
||||
:100060000C943E000C943E0011241FBECFEFD8E04C
|
||||
:10007000DEBFCDBF0E9440000C9450000C940000E5
|
||||
:1000800084E084B994E085B1892785B92FE936E801
|
||||
:1000900081E0215030408040E1F700C00000F3CF04
|
||||
:0400A000F894FFCF02
|
||||
:00000001FF
|
||||
118
trunk/AVRProjects/ATMega328/main.lss
Normal file
118
trunk/AVRProjects/ATMega328/main.lss
Normal file
@@ -0,0 +1,118 @@
|
||||
|
||||
main.elf: file format elf32-avr
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .data 00000000 00800100 000000a4 00000118 2**0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
1 .text 000000a4 00000000 00000000 00000074 2**1
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
2 .comment 00000011 00000000 00000000 00000118 2**0
|
||||
CONTENTS, READONLY
|
||||
3 .debug_aranges 00000020 00000000 00000000 00000129 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
4 .debug_info 00000119 00000000 00000000 00000149 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
5 .debug_abbrev 000000d1 00000000 00000000 00000262 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
6 .debug_line 000000d7 00000000 00000000 00000333 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
7 .debug_frame 00000024 00000000 00000000 0000040c 2**2
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
8 .debug_str 00000134 00000000 00000000 00000430 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
9 .debug_loc 0000001f 00000000 00000000 00000564 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
10 .debug_ranges 00000010 00000000 00000000 00000583 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <__vectors>:
|
||||
0: 0c 94 34 00 jmp 0x68 ; 0x68 <__ctors_end>
|
||||
4: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
8: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
10: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
14: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
18: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
1c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
20: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
24: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
28: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
2c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
30: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
34: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
38: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
3c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
40: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
44: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
48: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
4c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
50: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
54: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
58: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
5c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
60: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
64: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
|
||||
|
||||
00000068 <__ctors_end>:
|
||||
68: 11 24 eor r1, r1
|
||||
6a: 1f be out 0x3f, r1 ; 63
|
||||
6c: cf ef ldi r28, 0xFF ; 255
|
||||
6e: d8 e0 ldi r29, 0x08 ; 8
|
||||
70: de bf out 0x3e, r29 ; 62
|
||||
72: cd bf out 0x3d, r28 ; 61
|
||||
74: 0e 94 40 00 call 0x80 ; 0x80 <main>
|
||||
78: 0c 94 50 00 jmp 0xa0 ; 0xa0 <_exit>
|
||||
|
||||
0000007c <__bad_interrupt>:
|
||||
7c: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
|
||||
|
||||
00000080 <main>:
|
||||
#include <util/delay.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000100;
|
||||
80: 84 e0 ldi r24, 0x04 ; 4
|
||||
82: 84 b9 out 0x04, r24 ; 4
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
84: 94 e0 ldi r25, 0x04 ; 4
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000100;
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
86: 85 b1 in r24, 0x05 ; 5
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
88: 89 27 eor r24, r25
|
||||
PORTB = zwischenspeicher;
|
||||
8a: 85 b9 out 0x05, r24 ; 5
|
||||
#else
|
||||
//round up by default
|
||||
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
#endif
|
||||
|
||||
__builtin_avr_delay_cycles(__ticks_dc);
|
||||
8c: 2f e9 ldi r18, 0x9F ; 159
|
||||
8e: 36 e8 ldi r19, 0x86 ; 134
|
||||
90: 81 e0 ldi r24, 0x01 ; 1
|
||||
92: 21 50 subi r18, 0x01 ; 1
|
||||
94: 30 40 sbci r19, 0x00 ; 0
|
||||
96: 80 40 sbci r24, 0x00 ; 0
|
||||
98: e1 f7 brne .-8 ; 0x92 <main+0x12>
|
||||
9a: 00 c0 rjmp .+0 ; 0x9c <main+0x1c>
|
||||
9c: 00 00 nop
|
||||
9e: f3 cf rjmp .-26 ; 0x86 <main+0x6>
|
||||
|
||||
000000a0 <_exit>:
|
||||
a0: f8 94 cli
|
||||
|
||||
000000a2 <__stop_program>:
|
||||
a2: ff cf rjmp .-2 ; 0xa2 <__stop_program>
|
||||
243
trunk/AVRProjects/ATMega328/main.lst
Normal file
243
trunk/AVRProjects/ATMega328/main.lst
Normal file
@@ -0,0 +1,243 @@
|
||||
1 .file "main.c"
|
||||
2 __SP_H__ = 0x3e
|
||||
3 __SP_L__ = 0x3d
|
||||
4 __SREG__ = 0x3f
|
||||
5 __tmp_reg__ = 0
|
||||
6 __zero_reg__ = 1
|
||||
7 .text
|
||||
8 .Ltext0:
|
||||
9 .cfi_sections .debug_frame
|
||||
10 .section .text.startup,"ax",@progbits
|
||||
11 .global main
|
||||
13 main:
|
||||
14 .LFB6:
|
||||
15 .file 1 "main.c"
|
||||
1:main.c **** #include <avr/io.h>
|
||||
2:main.c **** #include <util/delay.h>
|
||||
3:main.c ****
|
||||
4:main.c **** int main (void)
|
||||
5:main.c **** {
|
||||
16 .loc 1 5 0
|
||||
17 .cfi_startproc
|
||||
18 /* prologue: function */
|
||||
19 /* frame size = 0 */
|
||||
20 /* stack size = 0 */
|
||||
21 .L__stack_usage = 0
|
||||
6:main.c **** unsigned char zwischenspeicher;
|
||||
7:main.c **** DDRB = 0b00000100;
|
||||
22 .loc 1 7 0
|
||||
23 0000 84E0 ldi r24,lo8(4)
|
||||
24 0002 84B9 out 0x4,r24
|
||||
8:main.c **** while(1)
|
||||
9:main.c **** {
|
||||
10:main.c **** zwischenspeicher = PORTB;
|
||||
11:main.c **** zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
25 .loc 1 11 0
|
||||
26 0004 94E0 ldi r25,lo8(4)
|
||||
27 .L2:
|
||||
10:main.c **** zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
28 .loc 1 10 0 discriminator 1
|
||||
29 0006 85B1 in r24,0x5
|
||||
30 .LVL0:
|
||||
31 .loc 1 11 0 discriminator 1
|
||||
32 0008 8927 eor r24,r25
|
||||
33 .LVL1:
|
||||
12:main.c **** PORTB = zwischenspeicher;
|
||||
34 .loc 1 12 0 discriminator 1
|
||||
35 000a 85B9 out 0x5,r24
|
||||
36 .LVL2:
|
||||
37 .LBB4:
|
||||
38 .LBB5:
|
||||
39 .file 2 "e:\\progs\\arduino-1.7.4\\hardware\\tools\\avr\\avr\\include\\util\\delay.h"
|
||||
1:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* Copyright (c) 2002, Marek Michalkiewicz
|
||||
2:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Copyright (c) 2004,2005,2007 Joerg Wunsch
|
||||
3:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Copyright (c) 2007 Florin-Viorel Petrov
|
||||
4:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** All rights reserved.
|
||||
5:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
6:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Redistribution and use in source and binary forms, with or without
|
||||
7:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** modification, are permitted provided that the following conditions are met:
|
||||
8:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
9:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Redistributions of source code must retain the above copyright
|
||||
10:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** notice, this list of conditions and the following disclaimer.
|
||||
11:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
12:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Redistributions in binary form must reproduce the above copyright
|
||||
13:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** notice, this list of conditions and the following disclaimer in
|
||||
14:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** the documentation and/or other materials provided with the
|
||||
15:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** distribution.
|
||||
16:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
17:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Neither the name of the copyright holders nor the names of
|
||||
18:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** contributors may be used to endorse or promote products derived
|
||||
19:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** from this software without specific prior written permission.
|
||||
20:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
21:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
22:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
23:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
24:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
25:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
26:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
27:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
28:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
29:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
30:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
31:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** POSSIBILITY OF SUCH DAMAGE. */
|
||||
32:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
33:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* $Id$ */
|
||||
34:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
35:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef _UTIL_DELAY_H_
|
||||
36:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define _UTIL_DELAY_H_ 1
|
||||
37:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
38:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef __HAS_DELAY_CYCLES
|
||||
39:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define __HAS_DELAY_CYCLES 1
|
||||
40:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
41:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
42:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <inttypes.h>
|
||||
43:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <util/delay_basic.h>
|
||||
44:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <math.h>
|
||||
45:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
46:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /** \file */
|
||||
47:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /** \defgroup util_delay <util/delay.h>: Convenience functions for busy-wait delay loops
|
||||
48:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \code
|
||||
49:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define F_CPU 1000000UL // 1 MHz
|
||||
50:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** //#define F_CPU 14.7456E6
|
||||
51:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <util/delay.h>
|
||||
52:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \endcode
|
||||
53:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
54:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \note As an alternative method, it is possible to pass the
|
||||
55:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** F_CPU macro down to the compiler from the Makefile.
|
||||
56:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Obviously, in that case, no \c \#define statement should be
|
||||
57:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** used.
|
||||
58:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
59:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The functions in this header file are wrappers around the basic
|
||||
60:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** busy-wait functions from <util/delay_basic.h>. They are meant as
|
||||
61:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** convenience functions where actual time values can be specified
|
||||
62:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** rather than a number of cycles to wait for. The idea behind is
|
||||
63:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** that compile-time constant expressions will be eliminated by
|
||||
64:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** compiler optimization so floating-point expressions can be used
|
||||
65:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** to calculate the number of delay cycles needed based on the CPU
|
||||
66:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** frequency passed by the macro F_CPU.
|
||||
67:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
68:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \note In order for these functions to work as intended, compiler
|
||||
69:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** optimizations <em>must</em> be enabled, and the delay time
|
||||
70:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** <em>must</em> be an expression that is a known constant at
|
||||
71:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** compile-time. If these requirements are not met, the resulting
|
||||
72:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** delay will be much longer (and basically unpredictable), and
|
||||
73:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** applications that otherwise do not use floating-point calculations
|
||||
74:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** will experience severe code bloat by the floating-point library
|
||||
75:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** routines linked into the application.
|
||||
76:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
77:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The functions available allow the specification of microsecond, and
|
||||
78:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** millisecond delays directly, using the application-supplied macro
|
||||
79:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** F_CPU as the CPU clock frequency (in Hertz).
|
||||
80:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
81:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** */
|
||||
82:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
83:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if !defined(__DOXYGEN__)
|
||||
84:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** static inline void _delay_us(double __us) __attribute__((always_inline));
|
||||
85:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** static inline void _delay_ms(double __ms) __attribute__((always_inline));
|
||||
86:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
87:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
88:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef F_CPU
|
||||
89:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* prevent compiler error by supplying a default */
|
||||
90:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # warning "F_CPU not defined for <util/delay.h>"
|
||||
91:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # define F_CPU 1000000UL
|
||||
92:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
93:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
94:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef __OPTIMIZE__
|
||||
95:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
|
||||
96:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
97:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
98:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
||||
99:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
||||
100:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __STDC_HOSTED__
|
||||
101:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # include <math.h>
|
||||
102:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
103:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
104:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /**
|
||||
105:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \ingroup util_delay
|
||||
106:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
107:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Perform a delay of \c __ms milliseconds, using _delay_loop_2().
|
||||
108:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
109:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The macro F_CPU is supposed to be defined to a
|
||||
110:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** constant defining the CPU clock frequency (in Hertz).
|
||||
111:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
112:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The maximal possible delay is 262.14 ms / F_CPU in MHz.
|
||||
113:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
114:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** When the user request delay which exceed the maximum possible one,
|
||||
115:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** _delay_ms() provides a decreased resolution functionality. In this
|
||||
116:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** mode _delay_ms() will work with a resolution of 1/10 ms, providing
|
||||
117:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** delays up to 6.5535 seconds (independent from CPU frequency). The
|
||||
118:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** user will not be informed about decreased resolution.
|
||||
119:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
120:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long)
|
||||
121:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** support, maximal possible delay is 4294967.295 ms/ F_CPU in MHz. For
|
||||
122:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** values greater than the maximal possible delay, overflows results in
|
||||
123:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** no delay i.e., 0ms.
|
||||
124:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
125:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Conversion of __us into clock cycles may not always result in integer.
|
||||
126:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** By default, the clock cycles rounded up to next integer. This ensures that
|
||||
127:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** the user gets atleast __us microseconds of delay.
|
||||
128:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
129:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Alternatively, user can define __DELAY_ROUND_DOWN__ and __DELAY_ROUND_CLOSEST__
|
||||
130:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** to round down and round to closest integer.
|
||||
131:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
132:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Note: The new implementation of _delay_ms(double __ms) with
|
||||
133:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __builtin_avr_delay_cycles(unsigned long) support is not backward compatible.
|
||||
134:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay.
|
||||
135:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Also, the backward compatible
|
||||
136:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** algorithm will be chosen if the code is compiled in a <em>freestanding
|
||||
137:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** environment</em> (GCC option \c -ffreestanding), as the math functions
|
||||
138:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** required for rounding are not available to the compiler then.
|
||||
139:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
140:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** */
|
||||
141:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** void
|
||||
142:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** _delay_ms(double __ms)
|
||||
143:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** {
|
||||
144:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** double __tmp ;
|
||||
145:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
||||
146:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
||||
147:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __STDC_HOSTED__
|
||||
148:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** uint32_t __ticks_dc;
|
||||
149:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** extern void __builtin_avr_delay_cycles(unsigned long);
|
||||
150:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __tmp = ((F_CPU) / 1e3) * __ms;
|
||||
151:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
152:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if defined(__DELAY_ROUND_DOWN__)
|
||||
153:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)fabs(__tmp);
|
||||
154:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
155:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #elif defined(__DELAY_ROUND_CLOSEST__)
|
||||
156:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)(fabs(__tmp)+0.5);
|
||||
157:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
158:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #else
|
||||
159:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** //round up by default
|
||||
160:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
161:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
162:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
163:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __builtin_avr_delay_cycles(__ticks_dc);
|
||||
40 .loc 2 163 0 discriminator 1
|
||||
41 000c 2FE9 ldi r18,lo8(99999)
|
||||
42 000e 36E8 ldi r19,hi8(99999)
|
||||
43 0010 81E0 ldi r24,hlo8(99999)
|
||||
44 0012 2150 1: subi r18,1
|
||||
45 0014 3040 sbci r19,0
|
||||
46 0016 8040 sbci r24,0
|
||||
47 0018 01F4 brne 1b
|
||||
48 .LVL3:
|
||||
49 001a 00C0 rjmp .
|
||||
50 001c 0000 nop
|
||||
51 001e 00C0 rjmp .L2
|
||||
52 .LBE5:
|
||||
53 .LBE4:
|
||||
54 .cfi_endproc
|
||||
55 .LFE6:
|
||||
57 .text
|
||||
58 .Letext0:
|
||||
59 .file 3 "e:\\progs\\arduino-1.7.4\\hardware\\tools\\avr\\avr\\include\\stdint.h"
|
||||
DEFINED SYMBOLS
|
||||
*ABS*:00000000 main.c
|
||||
C:\Users\q242695\AppData\Local\Temp\cc6uM2d3.s:2 *ABS*:0000003e __SP_H__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc6uM2d3.s:3 *ABS*:0000003d __SP_L__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc6uM2d3.s:4 *ABS*:0000003f __SREG__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc6uM2d3.s:5 *ABS*:00000000 __tmp_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc6uM2d3.s:6 *ABS*:00000001 __zero_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\cc6uM2d3.s:13 .text.startup:00000000 main
|
||||
|
||||
NO UNDEFINED SYMBOLS
|
||||
429
trunk/AVRProjects/ATMega328/main.map
Normal file
429
trunk/AVRProjects/ATMega328/main.map
Normal file
@@ -0,0 +1,429 @@
|
||||
Archive member included to satisfy reference by file (symbol)
|
||||
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o (exit)
|
||||
|
||||
Memory Configuration
|
||||
|
||||
Name Origin Length Attributes
|
||||
text 0x00000000 0x00020000 xr
|
||||
data 0x00800060 0x0000ffa0 rw !x
|
||||
eeprom 0x00810000 0x00010000 rw !x
|
||||
fuse 0x00820000 0x00000400 rw !x
|
||||
lock 0x00830000 0x00000400 rw !x
|
||||
signature 0x00840000 0x00000400 rw !x
|
||||
*default* 0x00000000 0xffffffff
|
||||
|
||||
Linker script and memory map
|
||||
|
||||
Address of section .data set to 0x800100
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
LOAD main.o
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libm.a
|
||||
START GROUP
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libm.a
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libc.a
|
||||
END GROUP
|
||||
|
||||
.hash
|
||||
*(.hash)
|
||||
|
||||
.dynsym
|
||||
*(.dynsym)
|
||||
|
||||
.dynstr
|
||||
*(.dynstr)
|
||||
|
||||
.gnu.version
|
||||
*(.gnu.version)
|
||||
|
||||
.gnu.version_d
|
||||
*(.gnu.version_d)
|
||||
|
||||
.gnu.version_r
|
||||
*(.gnu.version_r)
|
||||
|
||||
.rel.init
|
||||
*(.rel.init)
|
||||
|
||||
.rela.init
|
||||
*(.rela.init)
|
||||
|
||||
.rel.text
|
||||
*(.rel.text)
|
||||
*(.rel.text.*)
|
||||
*(.rel.gnu.linkonce.t*)
|
||||
|
||||
.rela.text
|
||||
*(.rela.text)
|
||||
*(.rela.text.*)
|
||||
*(.rela.gnu.linkonce.t*)
|
||||
|
||||
.rel.fini
|
||||
*(.rel.fini)
|
||||
|
||||
.rela.fini
|
||||
*(.rela.fini)
|
||||
|
||||
.rel.rodata
|
||||
*(.rel.rodata)
|
||||
*(.rel.rodata.*)
|
||||
*(.rel.gnu.linkonce.r*)
|
||||
|
||||
.rela.rodata
|
||||
*(.rela.rodata)
|
||||
*(.rela.rodata.*)
|
||||
*(.rela.gnu.linkonce.r*)
|
||||
|
||||
.rel.data
|
||||
*(.rel.data)
|
||||
*(.rel.data.*)
|
||||
*(.rel.gnu.linkonce.d*)
|
||||
|
||||
.rela.data
|
||||
*(.rela.data)
|
||||
*(.rela.data.*)
|
||||
*(.rela.gnu.linkonce.d*)
|
||||
|
||||
.rel.ctors
|
||||
*(.rel.ctors)
|
||||
|
||||
.rela.ctors
|
||||
*(.rela.ctors)
|
||||
|
||||
.rel.dtors
|
||||
*(.rel.dtors)
|
||||
|
||||
.rela.dtors
|
||||
*(.rela.dtors)
|
||||
|
||||
.rel.got
|
||||
*(.rel.got)
|
||||
|
||||
.rela.got
|
||||
*(.rela.got)
|
||||
|
||||
.rel.bss
|
||||
*(.rel.bss)
|
||||
|
||||
.rela.bss
|
||||
*(.rela.bss)
|
||||
|
||||
.rel.plt
|
||||
*(.rel.plt)
|
||||
|
||||
.rela.plt
|
||||
*(.rela.plt)
|
||||
|
||||
.text 0x00000000 0xa4
|
||||
*(.vectors)
|
||||
.vectors 0x00000000 0x68 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
0x00000000 __vector_default
|
||||
0x00000000 __vectors
|
||||
*(.vectors)
|
||||
*(.progmem.gcc*)
|
||||
0x00000068 . = ALIGN (0x2)
|
||||
0x00000068 __trampolines_start = .
|
||||
*(.trampolines)
|
||||
.trampolines 0x00000068 0x0 linker stubs
|
||||
*(.trampolines*)
|
||||
0x00000068 __trampolines_end = .
|
||||
*(.progmem*)
|
||||
0x00000068 . = ALIGN (0x2)
|
||||
*(.jumptables)
|
||||
*(.jumptables*)
|
||||
*(.lowtext)
|
||||
*(.lowtext*)
|
||||
0x00000068 __ctors_start = .
|
||||
*(.ctors)
|
||||
0x00000068 __ctors_end = .
|
||||
0x00000068 __dtors_start = .
|
||||
*(.dtors)
|
||||
0x00000068 __dtors_end = .
|
||||
SORT(*)(.ctors)
|
||||
SORT(*)(.dtors)
|
||||
*(.init0)
|
||||
.init0 0x00000068 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
0x00000068 __init
|
||||
*(.init0)
|
||||
*(.init1)
|
||||
*(.init1)
|
||||
*(.init2)
|
||||
.init2 0x00000068 0xc e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
*(.init2)
|
||||
*(.init3)
|
||||
*(.init3)
|
||||
*(.init4)
|
||||
*(.init4)
|
||||
*(.init5)
|
||||
*(.init5)
|
||||
*(.init6)
|
||||
*(.init6)
|
||||
*(.init7)
|
||||
*(.init7)
|
||||
*(.init8)
|
||||
*(.init8)
|
||||
*(.init9)
|
||||
.init9 0x00000074 0x8 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
*(.init9)
|
||||
*(.text)
|
||||
.text 0x0000007c 0x4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
0x0000007c __vector_22
|
||||
0x0000007c __vector_1
|
||||
0x0000007c __vector_24
|
||||
0x0000007c __vector_12
|
||||
0x0000007c __bad_interrupt
|
||||
0x0000007c __vector_6
|
||||
0x0000007c __vector_3
|
||||
0x0000007c __vector_23
|
||||
0x0000007c __vector_25
|
||||
0x0000007c __vector_11
|
||||
0x0000007c __vector_13
|
||||
0x0000007c __vector_17
|
||||
0x0000007c __vector_19
|
||||
0x0000007c __vector_7
|
||||
0x0000007c __vector_5
|
||||
0x0000007c __vector_4
|
||||
0x0000007c __vector_9
|
||||
0x0000007c __vector_2
|
||||
0x0000007c __vector_21
|
||||
0x0000007c __vector_15
|
||||
0x0000007c __vector_8
|
||||
0x0000007c __vector_14
|
||||
0x0000007c __vector_10
|
||||
0x0000007c __vector_16
|
||||
0x0000007c __vector_18
|
||||
0x0000007c __vector_20
|
||||
.text 0x00000080 0x0 main.o
|
||||
.text 0x00000080 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
0x00000080 . = ALIGN (0x2)
|
||||
*(.text.*)
|
||||
.text.startup 0x00000080 0x20 main.o
|
||||
0x00000080 main
|
||||
.text.libgcc.mul
|
||||
0x000000a0 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.div
|
||||
0x000000a0 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc 0x000000a0 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.prologue
|
||||
0x000000a0 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.builtins
|
||||
0x000000a0 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.fmul
|
||||
0x000000a0 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
.text.libgcc.fixed
|
||||
0x000000a0 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
0x000000a0 . = ALIGN (0x2)
|
||||
*(.fini9)
|
||||
.fini9 0x000000a0 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
0x000000a0 _exit
|
||||
0x000000a0 exit
|
||||
*(.fini9)
|
||||
*(.fini8)
|
||||
*(.fini8)
|
||||
*(.fini7)
|
||||
*(.fini7)
|
||||
*(.fini6)
|
||||
*(.fini6)
|
||||
*(.fini5)
|
||||
*(.fini5)
|
||||
*(.fini4)
|
||||
*(.fini4)
|
||||
*(.fini3)
|
||||
*(.fini3)
|
||||
*(.fini2)
|
||||
*(.fini2)
|
||||
*(.fini1)
|
||||
*(.fini1)
|
||||
*(.fini0)
|
||||
.fini0 0x000000a0 0x4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
*(.fini0)
|
||||
0x000000a4 _etext = .
|
||||
|
||||
.data 0x00800100 0x0 load address 0x000000a4
|
||||
0x00800100 PROVIDE (__data_start, .)
|
||||
*(.data)
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
.data 0x00800100 0x0 main.o
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
*(.data*)
|
||||
*(.rodata)
|
||||
*(.rodata*)
|
||||
*(.gnu.linkonce.d*)
|
||||
0x00800100 . = ALIGN (0x2)
|
||||
0x00800100 _edata = .
|
||||
0x00800100 PROVIDE (__data_end, .)
|
||||
|
||||
.bss 0x00800100 0x0
|
||||
0x00800100 PROVIDE (__bss_start, .)
|
||||
*(.bss)
|
||||
.bss 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
.bss 0x00800100 0x0 main.o
|
||||
.bss 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
0x00800100 PROVIDE (__bss_end, .)
|
||||
0x000000a4 __data_load_start = LOADADDR (.data)
|
||||
0x000000a4 __data_load_end = (__data_load_start + SIZEOF (.data))
|
||||
|
||||
.noinit 0x00800100 0x0
|
||||
0x00800100 PROVIDE (__noinit_start, .)
|
||||
*(.noinit*)
|
||||
0x00800100 PROVIDE (__noinit_end, .)
|
||||
0x00800100 _end = .
|
||||
0x00800100 PROVIDE (__heap_start, .)
|
||||
|
||||
.eeprom 0x00810000 0x0
|
||||
*(.eeprom*)
|
||||
0x00810000 __eeprom_end = .
|
||||
|
||||
.fuse
|
||||
*(.fuse)
|
||||
*(.lfuse)
|
||||
*(.hfuse)
|
||||
*(.efuse)
|
||||
|
||||
.lock
|
||||
*(.lock*)
|
||||
|
||||
.signature
|
||||
*(.signature*)
|
||||
|
||||
.stab
|
||||
*(.stab)
|
||||
|
||||
.stabstr
|
||||
*(.stabstr)
|
||||
|
||||
.stab.excl
|
||||
*(.stab.excl)
|
||||
|
||||
.stab.exclstr
|
||||
*(.stab.exclstr)
|
||||
|
||||
.stab.index
|
||||
*(.stab.index)
|
||||
|
||||
.stab.indexstr
|
||||
*(.stab.indexstr)
|
||||
|
||||
.comment 0x00000000 0x11
|
||||
*(.comment)
|
||||
.comment 0x00000000 0x11 main.o
|
||||
0x12 (size before relaxing)
|
||||
|
||||
.note.gnu.build-id
|
||||
*(.note.gnu.build-id)
|
||||
|
||||
.debug
|
||||
*(.debug)
|
||||
|
||||
.line
|
||||
*(.line)
|
||||
|
||||
.debug_srcinfo
|
||||
*(.debug_srcinfo)
|
||||
|
||||
.debug_sfnames
|
||||
*(.debug_sfnames)
|
||||
|
||||
.debug_aranges 0x00000000 0x20
|
||||
*(.debug_aranges)
|
||||
.debug_aranges
|
||||
0x00000000 0x20 main.o
|
||||
|
||||
.debug_pubnames
|
||||
*(.debug_pubnames)
|
||||
|
||||
.debug_info 0x00000000 0x119
|
||||
*(.debug_info .gnu.linkonce.wi.*)
|
||||
.debug_info 0x00000000 0x119 main.o
|
||||
|
||||
.debug_abbrev 0x00000000 0xd1
|
||||
*(.debug_abbrev)
|
||||
.debug_abbrev 0x00000000 0xd1 main.o
|
||||
|
||||
.debug_line 0x00000000 0xd7
|
||||
*(.debug_line .debug_line.* .debug_line_end)
|
||||
.debug_line 0x00000000 0xd7 main.o
|
||||
|
||||
.debug_frame 0x00000000 0x24
|
||||
*(.debug_frame)
|
||||
.debug_frame 0x00000000 0x24 main.o
|
||||
|
||||
.debug_str 0x00000000 0x134
|
||||
*(.debug_str)
|
||||
.debug_str 0x00000000 0x134 main.o
|
||||
0x168 (size before relaxing)
|
||||
|
||||
.debug_loc 0x00000000 0x1f
|
||||
*(.debug_loc)
|
||||
.debug_loc 0x00000000 0x1f main.o
|
||||
|
||||
.debug_macinfo
|
||||
*(.debug_macinfo)
|
||||
|
||||
.debug_weaknames
|
||||
*(.debug_weaknames)
|
||||
|
||||
.debug_funcnames
|
||||
*(.debug_funcnames)
|
||||
|
||||
.debug_typenames
|
||||
*(.debug_typenames)
|
||||
|
||||
.debug_varnames
|
||||
*(.debug_varnames)
|
||||
|
||||
.debug_pubtypes
|
||||
*(.debug_pubtypes)
|
||||
|
||||
.debug_ranges 0x00000000 0x10
|
||||
*(.debug_ranges)
|
||||
.debug_ranges 0x00000000 0x10 main.o
|
||||
|
||||
.debug_macro
|
||||
*(.debug_macro)
|
||||
OUTPUT(main.elf elf32-avr)
|
||||
LOAD linker stubs
|
||||
|
||||
Cross Reference Table
|
||||
|
||||
Symbol File
|
||||
__bad_interrupt e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__heap_end e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__init e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__stack e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_1 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_10 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_11 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_12 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_13 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_14 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_15 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_16 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_17 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_18 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_19 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_2 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_20 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_21 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_22 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_23 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_24 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_25 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_3 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_5 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_6 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_7 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_8 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_9 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vector_default e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
__vectors e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
_exit e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
exit e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
main main.o
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328.o
|
||||
52
trunk/AVRProjects/ATMega328/main.sym
Normal file
52
trunk/AVRProjects/ATMega328/main.sym
Normal file
@@ -0,0 +1,52 @@
|
||||
00000000 W __heap_end
|
||||
00000000 a __tmp_reg__
|
||||
00000000 W __vector_default
|
||||
00000000 T __vectors
|
||||
00000001 a __zero_reg__
|
||||
0000003d a __SP_L__
|
||||
0000003e a __SP_H__
|
||||
0000003f a __SREG__
|
||||
00000068 T __ctors_end
|
||||
00000068 T __ctors_start
|
||||
00000068 T __dtors_end
|
||||
00000068 T __dtors_start
|
||||
00000068 W __init
|
||||
00000068 T __trampolines_end
|
||||
00000068 T __trampolines_start
|
||||
0000007c T __bad_interrupt
|
||||
0000007c W __vector_1
|
||||
0000007c W __vector_10
|
||||
0000007c W __vector_11
|
||||
0000007c W __vector_12
|
||||
0000007c W __vector_13
|
||||
0000007c W __vector_14
|
||||
0000007c W __vector_15
|
||||
0000007c W __vector_16
|
||||
0000007c W __vector_17
|
||||
0000007c W __vector_18
|
||||
0000007c W __vector_19
|
||||
0000007c W __vector_2
|
||||
0000007c W __vector_20
|
||||
0000007c W __vector_21
|
||||
0000007c W __vector_22
|
||||
0000007c W __vector_23
|
||||
0000007c W __vector_24
|
||||
0000007c W __vector_25
|
||||
0000007c W __vector_3
|
||||
0000007c W __vector_4
|
||||
0000007c W __vector_5
|
||||
0000007c W __vector_6
|
||||
0000007c W __vector_7
|
||||
0000007c W __vector_8
|
||||
0000007c W __vector_9
|
||||
00000080 T main
|
||||
000000a0 T _exit
|
||||
000000a0 W exit
|
||||
000000a2 t __stop_program
|
||||
000000a4 A __data_load_end
|
||||
000000a4 A __data_load_start
|
||||
000000a4 T _etext
|
||||
000008ff W __stack
|
||||
00800100 D _edata
|
||||
00800100 T _end
|
||||
00810000 T __eeprom_end
|
||||
441
trunk/AVRProjects/ATMega328/makefile
Normal file
441
trunk/AVRProjects/ATMega328/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega328
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 4190000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
48
trunk/AVRProjects/ATMega48/.dep/main.o.d
Normal file
48
trunk/AVRProjects/ATMega48/.dep/main.o.d
Normal file
@@ -0,0 +1,48 @@
|
||||
main.o: main.c main.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\io.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\sfr_defs.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\inttypes.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\stdint.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom48.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iomx8.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\portpins.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\common.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\version.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\fuse.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\lock.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay_basic.h \
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\math.h
|
||||
|
||||
main.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\io.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\sfr_defs.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\inttypes.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\stdint.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iom48.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\iomx8.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\portpins.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\common.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\version.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\fuse.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\avr\lock.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay_basic.h:
|
||||
|
||||
e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\math.h:
|
||||
45
trunk/AVRProjects/ATMega48/main.c
Normal file
45
trunk/AVRProjects/ATMega48/main.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 88 / Mega 168 / Mega 328 Pin map
|
||||
+-\/-+
|
||||
/Reset PC6 1|o |28 PC5 ADC5
|
||||
RXD PD0 2| |27 PC4 ADC4
|
||||
TXD PD1 3| |26 PC3 ADC3
|
||||
PD2 4| |25 PC2 ADC2
|
||||
OC2B PD3 5| |24 PC1 ADC1
|
||||
PD4 6| |23 PC0 ADC0
|
||||
VCC 7| |22 GND
|
||||
GND 8| |21 AREF
|
||||
OSC1 PB6 9| |20 VCC
|
||||
OSC2 PB7 10| |19 PB5 SCK
|
||||
OC0B PD5 11| |18 PB4 MISO
|
||||
AIN0 OC0A PD6 12| |17 PB3 OC2A MOSI
|
||||
AIN1 PD7 13| |16 PB2 OC1B
|
||||
PB0 14| |15 PB1 OC1A
|
||||
+----+
|
||||
* ******************************************************** */
|
||||
|
||||
#include "main.h"
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000100;
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
PORTB = zwischenspeicher;
|
||||
_delay_ms(500);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
1
trunk/AVRProjects/ATMega48/main.eep
Normal file
1
trunk/AVRProjects/ATMega48/main.eep
Normal file
@@ -0,0 +1 @@
|
||||
:00000001FF
|
||||
BIN
trunk/AVRProjects/ATMega48/main.elf
Normal file
BIN
trunk/AVRProjects/ATMega48/main.elf
Normal file
Binary file not shown.
18
trunk/AVRProjects/ATMega48/main.h
Normal file
18
trunk/AVRProjects/ATMega48/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* ******************************************************** *
|
||||
* *
|
||||
* Simple Template for ATMEL Microcontroller *
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 25.07.2016 *
|
||||
* Author: Paolo Iocco *
|
||||
* ******************************************************** */
|
||||
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 1000000L
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
8
trunk/AVRProjects/ATMega48/main.hex
Normal file
8
trunk/AVRProjects/ATMega48/main.hex
Normal file
@@ -0,0 +1,8 @@
|
||||
:1000000019C020C01FC01EC01DC01CC01BC01AC00C
|
||||
:1000100019C018C017C016C015C014C013C012C034
|
||||
:1000200011C010C00FC00EC00DC00CC00BC00AC064
|
||||
:1000300009C008C011241FBECFEFD2E0DEBFCDBF84
|
||||
:1000400002D011C0DDCF84E084B994E085B1892766
|
||||
:1000500085B92FE936E881E0215030408040E1F752
|
||||
:0A00600000C00000F3CFF894FFCFBA
|
||||
:00000001FF
|
||||
118
trunk/AVRProjects/ATMega48/main.lss
Normal file
118
trunk/AVRProjects/ATMega48/main.lss
Normal file
@@ -0,0 +1,118 @@
|
||||
|
||||
main.elf: file format elf32-avr
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .data 00000000 00800100 0000006a 000000de 2**0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
1 .text 0000006a 00000000 00000000 00000074 2**1
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
2 .comment 00000011 00000000 00000000 000000de 2**0
|
||||
CONTENTS, READONLY
|
||||
3 .debug_aranges 00000020 00000000 00000000 000000ef 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
4 .debug_info 00000119 00000000 00000000 0000010f 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
5 .debug_abbrev 000000d1 00000000 00000000 00000228 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
6 .debug_line 000000d9 00000000 00000000 000002f9 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
7 .debug_frame 00000024 00000000 00000000 000003d4 2**2
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
8 .debug_str 00000132 00000000 00000000 000003f8 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
9 .debug_loc 0000001f 00000000 00000000 0000052a 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
10 .debug_ranges 00000010 00000000 00000000 00000549 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <__vectors>:
|
||||
0: 19 c0 rjmp .+50 ; 0x34 <__ctors_end>
|
||||
2: 20 c0 rjmp .+64 ; 0x44 <__bad_interrupt>
|
||||
4: 1f c0 rjmp .+62 ; 0x44 <__bad_interrupt>
|
||||
6: 1e c0 rjmp .+60 ; 0x44 <__bad_interrupt>
|
||||
8: 1d c0 rjmp .+58 ; 0x44 <__bad_interrupt>
|
||||
a: 1c c0 rjmp .+56 ; 0x44 <__bad_interrupt>
|
||||
c: 1b c0 rjmp .+54 ; 0x44 <__bad_interrupt>
|
||||
e: 1a c0 rjmp .+52 ; 0x44 <__bad_interrupt>
|
||||
10: 19 c0 rjmp .+50 ; 0x44 <__bad_interrupt>
|
||||
12: 18 c0 rjmp .+48 ; 0x44 <__bad_interrupt>
|
||||
14: 17 c0 rjmp .+46 ; 0x44 <__bad_interrupt>
|
||||
16: 16 c0 rjmp .+44 ; 0x44 <__bad_interrupt>
|
||||
18: 15 c0 rjmp .+42 ; 0x44 <__bad_interrupt>
|
||||
1a: 14 c0 rjmp .+40 ; 0x44 <__bad_interrupt>
|
||||
1c: 13 c0 rjmp .+38 ; 0x44 <__bad_interrupt>
|
||||
1e: 12 c0 rjmp .+36 ; 0x44 <__bad_interrupt>
|
||||
20: 11 c0 rjmp .+34 ; 0x44 <__bad_interrupt>
|
||||
22: 10 c0 rjmp .+32 ; 0x44 <__bad_interrupt>
|
||||
24: 0f c0 rjmp .+30 ; 0x44 <__bad_interrupt>
|
||||
26: 0e c0 rjmp .+28 ; 0x44 <__bad_interrupt>
|
||||
28: 0d c0 rjmp .+26 ; 0x44 <__bad_interrupt>
|
||||
2a: 0c c0 rjmp .+24 ; 0x44 <__bad_interrupt>
|
||||
2c: 0b c0 rjmp .+22 ; 0x44 <__bad_interrupt>
|
||||
2e: 0a c0 rjmp .+20 ; 0x44 <__bad_interrupt>
|
||||
30: 09 c0 rjmp .+18 ; 0x44 <__bad_interrupt>
|
||||
32: 08 c0 rjmp .+16 ; 0x44 <__bad_interrupt>
|
||||
|
||||
00000034 <__ctors_end>:
|
||||
34: 11 24 eor r1, r1
|
||||
36: 1f be out 0x3f, r1 ; 63
|
||||
38: cf ef ldi r28, 0xFF ; 255
|
||||
3a: d2 e0 ldi r29, 0x02 ; 2
|
||||
3c: de bf out 0x3e, r29 ; 62
|
||||
3e: cd bf out 0x3d, r28 ; 61
|
||||
40: 02 d0 rcall .+4 ; 0x46 <main>
|
||||
42: 11 c0 rjmp .+34 ; 0x66 <_exit>
|
||||
|
||||
00000044 <__bad_interrupt>:
|
||||
44: dd cf rjmp .-70 ; 0x0 <__vectors>
|
||||
|
||||
00000046 <main>:
|
||||
#include <util/delay.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000100;
|
||||
46: 84 e0 ldi r24, 0x04 ; 4
|
||||
48: 84 b9 out 0x04, r24 ; 4
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
4a: 94 e0 ldi r25, 0x04 ; 4
|
||||
{
|
||||
unsigned char zwischenspeicher;
|
||||
DDRB = 0b00000100;
|
||||
while(1)
|
||||
{
|
||||
zwischenspeicher = PORTB;
|
||||
4c: 85 b1 in r24, 0x05 ; 5
|
||||
zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
4e: 89 27 eor r24, r25
|
||||
PORTB = zwischenspeicher;
|
||||
50: 85 b9 out 0x05, r24 ; 5
|
||||
#else
|
||||
//round up by default
|
||||
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
#endif
|
||||
|
||||
__builtin_avr_delay_cycles(__ticks_dc);
|
||||
52: 2f e9 ldi r18, 0x9F ; 159
|
||||
54: 36 e8 ldi r19, 0x86 ; 134
|
||||
56: 81 e0 ldi r24, 0x01 ; 1
|
||||
58: 21 50 subi r18, 0x01 ; 1
|
||||
5a: 30 40 sbci r19, 0x00 ; 0
|
||||
5c: 80 40 sbci r24, 0x00 ; 0
|
||||
5e: e1 f7 brne .-8 ; 0x58 <main+0x12>
|
||||
60: 00 c0 rjmp .+0 ; 0x62 <main+0x1c>
|
||||
62: 00 00 nop
|
||||
64: f3 cf rjmp .-26 ; 0x4c <main+0x6>
|
||||
|
||||
00000066 <_exit>:
|
||||
66: f8 94 cli
|
||||
|
||||
00000068 <__stop_program>:
|
||||
68: ff cf rjmp .-2 ; 0x68 <__stop_program>
|
||||
271
trunk/AVRProjects/ATMega48/main.lst
Normal file
271
trunk/AVRProjects/ATMega48/main.lst
Normal file
@@ -0,0 +1,271 @@
|
||||
1 .file "main.c"
|
||||
2 __SP_H__ = 0x3e
|
||||
3 __SP_L__ = 0x3d
|
||||
4 __SREG__ = 0x3f
|
||||
5 __tmp_reg__ = 0
|
||||
6 __zero_reg__ = 1
|
||||
7 .text
|
||||
8 .Ltext0:
|
||||
9 .cfi_sections .debug_frame
|
||||
10 .section .text.startup,"ax",@progbits
|
||||
11 .global main
|
||||
13 main:
|
||||
14 .LFB6:
|
||||
15 .file 1 "main.c"
|
||||
1:main.c **** /* ******************************************************** *
|
||||
2:main.c **** *
|
||||
3:main.c **** * Simple Template for ATMEL Microcontroller *
|
||||
4:main.c **** * -------------------------------------------------------- *
|
||||
5:main.c **** * Created on: 25.07.2016
|
||||
6:main.c **** * Author: Paolo Iocco
|
||||
7:main.c **** * ******************************************************** */
|
||||
8:main.c **** /* ******************************************************** *
|
||||
9:main.c **** ATtiny 88 / Mega 168 / Mega 328 Pin map
|
||||
10:main.c **** +-\/-+
|
||||
11:main.c **** /Reset PC6 1|o |28 PC5 ADC5
|
||||
12:main.c **** RXD PD0 2| |27 PC4 ADC4
|
||||
13:main.c **** TXD PD1 3| |26 PC3 ADC3
|
||||
14:main.c **** PD2 4| |25 PC2 ADC2
|
||||
15:main.c **** OC2B PD3 5| |24 PC1 ADC1
|
||||
16:main.c **** PD4 6| |23 PC0 ADC0
|
||||
17:main.c **** VCC 7| |22 GND
|
||||
18:main.c **** GND 8| |21 AREF
|
||||
19:main.c **** OSC1 PB6 9| |20 VCC
|
||||
20:main.c **** OSC2 PB7 10| |19 PB5 SCK
|
||||
21:main.c **** OC0B PD5 11| |18 PB4 MISO
|
||||
22:main.c **** AIN0 OC0A PD6 12| |17 PB3 OC2A MOSI
|
||||
23:main.c **** AIN1 PD7 13| |16 PB2 OC1B
|
||||
24:main.c **** PB0 14| |15 PB1 OC1A
|
||||
25:main.c **** +----+
|
||||
26:main.c **** * ******************************************************** */
|
||||
27:main.c ****
|
||||
28:main.c **** #include "main.h"
|
||||
29:main.c **** #include <avr/io.h>
|
||||
30:main.c **** #include <util/delay.h>
|
||||
31:main.c ****
|
||||
32:main.c **** int main (void)
|
||||
33:main.c **** {
|
||||
16 .loc 1 33 0
|
||||
17 .cfi_startproc
|
||||
18 /* prologue: function */
|
||||
19 /* frame size = 0 */
|
||||
20 /* stack size = 0 */
|
||||
21 .L__stack_usage = 0
|
||||
34:main.c **** unsigned char zwischenspeicher;
|
||||
35:main.c **** DDRB = 0b00000100;
|
||||
22 .loc 1 35 0
|
||||
23 0000 84E0 ldi r24,lo8(4)
|
||||
24 0002 84B9 out 0x4,r24
|
||||
36:main.c **** while(1)
|
||||
37:main.c **** {
|
||||
38:main.c **** zwischenspeicher = PORTB;
|
||||
39:main.c **** zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
25 .loc 1 39 0
|
||||
26 0004 94E0 ldi r25,lo8(4)
|
||||
27 .L2:
|
||||
38:main.c **** zwischenspeicher = zwischenspeicher ^ 0b00000100;
|
||||
28 .loc 1 38 0 discriminator 1
|
||||
29 0006 85B1 in r24,0x5
|
||||
30 .LVL0:
|
||||
31 .loc 1 39 0 discriminator 1
|
||||
32 0008 8927 eor r24,r25
|
||||
33 .LVL1:
|
||||
40:main.c **** PORTB = zwischenspeicher;
|
||||
34 .loc 1 40 0 discriminator 1
|
||||
35 000a 85B9 out 0x5,r24
|
||||
36 .LVL2:
|
||||
37 .LBB4:
|
||||
38 .LBB5:
|
||||
39 .file 2 "e:\\progs\\arduino-1.7.4\\hardware\\tools\\avr\\avr\\include\\util\\delay.h"
|
||||
1:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* Copyright (c) 2002, Marek Michalkiewicz
|
||||
2:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Copyright (c) 2004,2005,2007 Joerg Wunsch
|
||||
3:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Copyright (c) 2007 Florin-Viorel Petrov
|
||||
4:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** All rights reserved.
|
||||
5:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
6:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Redistribution and use in source and binary forms, with or without
|
||||
7:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** modification, are permitted provided that the following conditions are met:
|
||||
8:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
9:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Redistributions of source code must retain the above copyright
|
||||
10:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** notice, this list of conditions and the following disclaimer.
|
||||
11:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
12:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Redistributions in binary form must reproduce the above copyright
|
||||
13:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** notice, this list of conditions and the following disclaimer in
|
||||
14:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** the documentation and/or other materials provided with the
|
||||
15:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** distribution.
|
||||
16:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
17:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** * Neither the name of the copyright holders nor the names of
|
||||
18:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** contributors may be used to endorse or promote products derived
|
||||
19:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** from this software without specific prior written permission.
|
||||
20:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
21:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
22:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
23:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
24:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
25:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
26:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
27:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
28:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
29:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
30:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
31:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** POSSIBILITY OF SUCH DAMAGE. */
|
||||
32:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
33:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* $Id$ */
|
||||
34:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
35:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef _UTIL_DELAY_H_
|
||||
36:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define _UTIL_DELAY_H_ 1
|
||||
37:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
38:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef __HAS_DELAY_CYCLES
|
||||
39:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define __HAS_DELAY_CYCLES 1
|
||||
40:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
41:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
42:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <inttypes.h>
|
||||
43:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <util/delay_basic.h>
|
||||
44:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <math.h>
|
||||
45:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
46:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /** \file */
|
||||
47:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /** \defgroup util_delay <util/delay.h>: Convenience functions for busy-wait delay loops
|
||||
48:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \code
|
||||
49:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #define F_CPU 1000000UL // 1 MHz
|
||||
50:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** //#define F_CPU 14.7456E6
|
||||
51:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #include <util/delay.h>
|
||||
52:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \endcode
|
||||
53:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
54:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \note As an alternative method, it is possible to pass the
|
||||
55:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** F_CPU macro down to the compiler from the Makefile.
|
||||
56:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Obviously, in that case, no \c \#define statement should be
|
||||
57:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** used.
|
||||
58:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
59:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The functions in this header file are wrappers around the basic
|
||||
60:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** busy-wait functions from <util/delay_basic.h>. They are meant as
|
||||
61:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** convenience functions where actual time values can be specified
|
||||
62:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** rather than a number of cycles to wait for. The idea behind is
|
||||
63:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** that compile-time constant expressions will be eliminated by
|
||||
64:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** compiler optimization so floating-point expressions can be used
|
||||
65:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** to calculate the number of delay cycles needed based on the CPU
|
||||
66:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** frequency passed by the macro F_CPU.
|
||||
67:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
68:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \note In order for these functions to work as intended, compiler
|
||||
69:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** optimizations <em>must</em> be enabled, and the delay time
|
||||
70:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** <em>must</em> be an expression that is a known constant at
|
||||
71:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** compile-time. If these requirements are not met, the resulting
|
||||
72:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** delay will be much longer (and basically unpredictable), and
|
||||
73:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** applications that otherwise do not use floating-point calculations
|
||||
74:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** will experience severe code bloat by the floating-point library
|
||||
75:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** routines linked into the application.
|
||||
76:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
77:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The functions available allow the specification of microsecond, and
|
||||
78:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** millisecond delays directly, using the application-supplied macro
|
||||
79:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** F_CPU as the CPU clock frequency (in Hertz).
|
||||
80:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
81:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** */
|
||||
82:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
83:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if !defined(__DOXYGEN__)
|
||||
84:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** static inline void _delay_us(double __us) __attribute__((always_inline));
|
||||
85:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** static inline void _delay_ms(double __ms) __attribute__((always_inline));
|
||||
86:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
87:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
88:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef F_CPU
|
||||
89:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /* prevent compiler error by supplying a default */
|
||||
90:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # warning "F_CPU not defined for <util/delay.h>"
|
||||
91:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # define F_CPU 1000000UL
|
||||
92:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
93:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
94:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #ifndef __OPTIMIZE__
|
||||
95:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
|
||||
96:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
97:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
98:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
||||
99:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
||||
100:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __STDC_HOSTED__
|
||||
101:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** # include <math.h>
|
||||
102:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
103:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
104:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** /**
|
||||
105:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** \ingroup util_delay
|
||||
106:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
107:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Perform a delay of \c __ms milliseconds, using _delay_loop_2().
|
||||
108:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
109:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The macro F_CPU is supposed to be defined to a
|
||||
110:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** constant defining the CPU clock frequency (in Hertz).
|
||||
111:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
112:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** The maximal possible delay is 262.14 ms / F_CPU in MHz.
|
||||
113:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
114:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** When the user request delay which exceed the maximum possible one,
|
||||
115:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** _delay_ms() provides a decreased resolution functionality. In this
|
||||
116:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** mode _delay_ms() will work with a resolution of 1/10 ms, providing
|
||||
117:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** delays up to 6.5535 seconds (independent from CPU frequency). The
|
||||
118:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** user will not be informed about decreased resolution.
|
||||
119:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
120:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long)
|
||||
121:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** support, maximal possible delay is 4294967.295 ms/ F_CPU in MHz. For
|
||||
122:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** values greater than the maximal possible delay, overflows results in
|
||||
123:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** no delay i.e., 0ms.
|
||||
124:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
125:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Conversion of __us into clock cycles may not always result in integer.
|
||||
126:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** By default, the clock cycles rounded up to next integer. This ensures that
|
||||
127:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** the user gets atleast __us microseconds of delay.
|
||||
128:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
129:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Alternatively, user can define __DELAY_ROUND_DOWN__ and __DELAY_ROUND_CLOSEST__
|
||||
130:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** to round down and round to closest integer.
|
||||
131:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
132:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Note: The new implementation of _delay_ms(double __ms) with
|
||||
133:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __builtin_avr_delay_cycles(unsigned long) support is not backward compatible.
|
||||
134:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay.
|
||||
135:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** Also, the backward compatible
|
||||
136:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** algorithm will be chosen if the code is compiled in a <em>freestanding
|
||||
137:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** environment</em> (GCC option \c -ffreestanding), as the math functions
|
||||
138:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** required for rounding are not available to the compiler then.
|
||||
139:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
140:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** */
|
||||
141:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** void
|
||||
142:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** _delay_ms(double __ms)
|
||||
143:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** {
|
||||
144:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** double __tmp ;
|
||||
145:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
||||
146:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
||||
147:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __STDC_HOSTED__
|
||||
148:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** uint32_t __ticks_dc;
|
||||
149:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** extern void __builtin_avr_delay_cycles(unsigned long);
|
||||
150:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __tmp = ((F_CPU) / 1e3) * __ms;
|
||||
151:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
152:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #if defined(__DELAY_ROUND_DOWN__)
|
||||
153:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)fabs(__tmp);
|
||||
154:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
155:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #elif defined(__DELAY_ROUND_CLOSEST__)
|
||||
156:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)(fabs(__tmp)+0.5);
|
||||
157:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
158:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #else
|
||||
159:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** //round up by default
|
||||
160:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
161:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** #endif
|
||||
162:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h ****
|
||||
163:e:\progs\arduino-1.7.4\hardware\tools\avr\avr\include\util\delay.h **** __builtin_avr_delay_cycles(__ticks_dc);
|
||||
40 .loc 2 163 0 discriminator 1
|
||||
41 000c 2FE9 ldi r18,lo8(99999)
|
||||
42 000e 36E8 ldi r19,hi8(99999)
|
||||
43 0010 81E0 ldi r24,hlo8(99999)
|
||||
44 0012 2150 1: subi r18,1
|
||||
45 0014 3040 sbci r19,0
|
||||
46 0016 8040 sbci r24,0
|
||||
47 0018 01F4 brne 1b
|
||||
48 .LVL3:
|
||||
49 001a 00C0 rjmp .
|
||||
50 001c 0000 nop
|
||||
51 001e 00C0 rjmp .L2
|
||||
52 .LBE5:
|
||||
53 .LBE4:
|
||||
54 .cfi_endproc
|
||||
55 .LFE6:
|
||||
57 .text
|
||||
58 .Letext0:
|
||||
59 .file 3 "e:\\progs\\arduino-1.7.4\\hardware\\tools\\avr\\avr\\include\\stdint.h"
|
||||
DEFINED SYMBOLS
|
||||
*ABS*:00000000 main.c
|
||||
C:\Users\q242695\AppData\Local\Temp\cckLBHgu.s:2 *ABS*:0000003e __SP_H__
|
||||
C:\Users\q242695\AppData\Local\Temp\cckLBHgu.s:3 *ABS*:0000003d __SP_L__
|
||||
C:\Users\q242695\AppData\Local\Temp\cckLBHgu.s:4 *ABS*:0000003f __SREG__
|
||||
C:\Users\q242695\AppData\Local\Temp\cckLBHgu.s:5 *ABS*:00000000 __tmp_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\cckLBHgu.s:6 *ABS*:00000001 __zero_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\cckLBHgu.s:13 .text.startup:00000000 main
|
||||
|
||||
NO UNDEFINED SYMBOLS
|
||||
429
trunk/AVRProjects/ATMega48/main.map
Normal file
429
trunk/AVRProjects/ATMega48/main.map
Normal file
@@ -0,0 +1,429 @@
|
||||
Archive member included to satisfy reference by file (symbol)
|
||||
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o (exit)
|
||||
|
||||
Memory Configuration
|
||||
|
||||
Name Origin Length Attributes
|
||||
text 0x00000000 0x00002000 xr
|
||||
data 0x00800060 0x0000ffa0 rw !x
|
||||
eeprom 0x00810000 0x00010000 rw !x
|
||||
fuse 0x00820000 0x00000400 rw !x
|
||||
lock 0x00830000 0x00000400 rw !x
|
||||
signature 0x00840000 0x00000400 rw !x
|
||||
*default* 0x00000000 0xffffffff
|
||||
|
||||
Linker script and memory map
|
||||
|
||||
Address of section .data set to 0x800100
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
LOAD main.o
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4\libm.a
|
||||
START GROUP
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4\libm.a
|
||||
LOAD e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4\libc.a
|
||||
END GROUP
|
||||
|
||||
.hash
|
||||
*(.hash)
|
||||
|
||||
.dynsym
|
||||
*(.dynsym)
|
||||
|
||||
.dynstr
|
||||
*(.dynstr)
|
||||
|
||||
.gnu.version
|
||||
*(.gnu.version)
|
||||
|
||||
.gnu.version_d
|
||||
*(.gnu.version_d)
|
||||
|
||||
.gnu.version_r
|
||||
*(.gnu.version_r)
|
||||
|
||||
.rel.init
|
||||
*(.rel.init)
|
||||
|
||||
.rela.init
|
||||
*(.rela.init)
|
||||
|
||||
.rel.text
|
||||
*(.rel.text)
|
||||
*(.rel.text.*)
|
||||
*(.rel.gnu.linkonce.t*)
|
||||
|
||||
.rela.text
|
||||
*(.rela.text)
|
||||
*(.rela.text.*)
|
||||
*(.rela.gnu.linkonce.t*)
|
||||
|
||||
.rel.fini
|
||||
*(.rel.fini)
|
||||
|
||||
.rela.fini
|
||||
*(.rela.fini)
|
||||
|
||||
.rel.rodata
|
||||
*(.rel.rodata)
|
||||
*(.rel.rodata.*)
|
||||
*(.rel.gnu.linkonce.r*)
|
||||
|
||||
.rela.rodata
|
||||
*(.rela.rodata)
|
||||
*(.rela.rodata.*)
|
||||
*(.rela.gnu.linkonce.r*)
|
||||
|
||||
.rel.data
|
||||
*(.rel.data)
|
||||
*(.rel.data.*)
|
||||
*(.rel.gnu.linkonce.d*)
|
||||
|
||||
.rela.data
|
||||
*(.rela.data)
|
||||
*(.rela.data.*)
|
||||
*(.rela.gnu.linkonce.d*)
|
||||
|
||||
.rel.ctors
|
||||
*(.rel.ctors)
|
||||
|
||||
.rela.ctors
|
||||
*(.rela.ctors)
|
||||
|
||||
.rel.dtors
|
||||
*(.rel.dtors)
|
||||
|
||||
.rela.dtors
|
||||
*(.rela.dtors)
|
||||
|
||||
.rel.got
|
||||
*(.rel.got)
|
||||
|
||||
.rela.got
|
||||
*(.rela.got)
|
||||
|
||||
.rel.bss
|
||||
*(.rel.bss)
|
||||
|
||||
.rela.bss
|
||||
*(.rela.bss)
|
||||
|
||||
.rel.plt
|
||||
*(.rel.plt)
|
||||
|
||||
.rela.plt
|
||||
*(.rela.plt)
|
||||
|
||||
.text 0x00000000 0x6a
|
||||
*(.vectors)
|
||||
.vectors 0x00000000 0x34 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
0x00000000 __vector_default
|
||||
0x00000000 __vectors
|
||||
*(.vectors)
|
||||
*(.progmem.gcc*)
|
||||
0x00000034 . = ALIGN (0x2)
|
||||
0x00000034 __trampolines_start = .
|
||||
*(.trampolines)
|
||||
.trampolines 0x00000034 0x0 linker stubs
|
||||
*(.trampolines*)
|
||||
0x00000034 __trampolines_end = .
|
||||
*(.progmem*)
|
||||
0x00000034 . = ALIGN (0x2)
|
||||
*(.jumptables)
|
||||
*(.jumptables*)
|
||||
*(.lowtext)
|
||||
*(.lowtext*)
|
||||
0x00000034 __ctors_start = .
|
||||
*(.ctors)
|
||||
0x00000034 __ctors_end = .
|
||||
0x00000034 __dtors_start = .
|
||||
*(.dtors)
|
||||
0x00000034 __dtors_end = .
|
||||
SORT(*)(.ctors)
|
||||
SORT(*)(.dtors)
|
||||
*(.init0)
|
||||
.init0 0x00000034 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
0x00000034 __init
|
||||
*(.init0)
|
||||
*(.init1)
|
||||
*(.init1)
|
||||
*(.init2)
|
||||
.init2 0x00000034 0xc e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
*(.init2)
|
||||
*(.init3)
|
||||
*(.init3)
|
||||
*(.init4)
|
||||
*(.init4)
|
||||
*(.init5)
|
||||
*(.init5)
|
||||
*(.init6)
|
||||
*(.init6)
|
||||
*(.init7)
|
||||
*(.init7)
|
||||
*(.init8)
|
||||
*(.init8)
|
||||
*(.init9)
|
||||
.init9 0x00000040 0x4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
*(.init9)
|
||||
*(.text)
|
||||
.text 0x00000044 0x2 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
0x00000044 __vector_22
|
||||
0x00000044 __vector_1
|
||||
0x00000044 __vector_24
|
||||
0x00000044 __vector_12
|
||||
0x00000044 __bad_interrupt
|
||||
0x00000044 __vector_6
|
||||
0x00000044 __vector_3
|
||||
0x00000044 __vector_23
|
||||
0x00000044 __vector_25
|
||||
0x00000044 __vector_11
|
||||
0x00000044 __vector_13
|
||||
0x00000044 __vector_17
|
||||
0x00000044 __vector_19
|
||||
0x00000044 __vector_7
|
||||
0x00000044 __vector_5
|
||||
0x00000044 __vector_4
|
||||
0x00000044 __vector_9
|
||||
0x00000044 __vector_2
|
||||
0x00000044 __vector_21
|
||||
0x00000044 __vector_15
|
||||
0x00000044 __vector_8
|
||||
0x00000044 __vector_14
|
||||
0x00000044 __vector_10
|
||||
0x00000044 __vector_16
|
||||
0x00000044 __vector_18
|
||||
0x00000044 __vector_20
|
||||
.text 0x00000046 0x0 main.o
|
||||
.text 0x00000046 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
0x00000046 . = ALIGN (0x2)
|
||||
*(.text.*)
|
||||
.text.startup 0x00000046 0x20 main.o
|
||||
0x00000046 main
|
||||
.text.libgcc.mul
|
||||
0x00000066 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
.text.libgcc.div
|
||||
0x00000066 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
.text.libgcc 0x00000066 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
.text.libgcc.prologue
|
||||
0x00000066 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
.text.libgcc.builtins
|
||||
0x00000066 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
.text.libgcc.fmul
|
||||
0x00000066 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
.text.libgcc.fixed
|
||||
0x00000066 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
0x00000066 . = ALIGN (0x2)
|
||||
*(.fini9)
|
||||
.fini9 0x00000066 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
0x00000066 _exit
|
||||
0x00000066 exit
|
||||
*(.fini9)
|
||||
*(.fini8)
|
||||
*(.fini8)
|
||||
*(.fini7)
|
||||
*(.fini7)
|
||||
*(.fini6)
|
||||
*(.fini6)
|
||||
*(.fini5)
|
||||
*(.fini5)
|
||||
*(.fini4)
|
||||
*(.fini4)
|
||||
*(.fini3)
|
||||
*(.fini3)
|
||||
*(.fini2)
|
||||
*(.fini2)
|
||||
*(.fini1)
|
||||
*(.fini1)
|
||||
*(.fini0)
|
||||
.fini0 0x00000066 0x4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
*(.fini0)
|
||||
0x0000006a _etext = .
|
||||
|
||||
.data 0x00800100 0x0 load address 0x0000006a
|
||||
[!provide] PROVIDE (__data_start, .)
|
||||
*(.data)
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
.data 0x00800100 0x0 main.o
|
||||
.data 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
*(.data*)
|
||||
*(.rodata)
|
||||
*(.rodata*)
|
||||
*(.gnu.linkonce.d*)
|
||||
0x00800100 . = ALIGN (0x2)
|
||||
0x00800100 _edata = .
|
||||
[!provide] PROVIDE (__data_end, .)
|
||||
|
||||
.bss 0x00800100 0x0
|
||||
[!provide] PROVIDE (__bss_start, .)
|
||||
*(.bss)
|
||||
.bss 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
.bss 0x00800100 0x0 main.o
|
||||
.bss 0x00800100 0x0 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
[!provide] PROVIDE (__bss_end, .)
|
||||
0x0000006a __data_load_start = LOADADDR (.data)
|
||||
0x0000006a __data_load_end = (__data_load_start + SIZEOF (.data))
|
||||
|
||||
.noinit 0x00800100 0x0
|
||||
[!provide] PROVIDE (__noinit_start, .)
|
||||
*(.noinit*)
|
||||
[!provide] PROVIDE (__noinit_end, .)
|
||||
0x00800100 _end = .
|
||||
[!provide] PROVIDE (__heap_start, .)
|
||||
|
||||
.eeprom 0x00810000 0x0
|
||||
*(.eeprom*)
|
||||
0x00810000 __eeprom_end = .
|
||||
|
||||
.fuse
|
||||
*(.fuse)
|
||||
*(.lfuse)
|
||||
*(.hfuse)
|
||||
*(.efuse)
|
||||
|
||||
.lock
|
||||
*(.lock*)
|
||||
|
||||
.signature
|
||||
*(.signature*)
|
||||
|
||||
.stab
|
||||
*(.stab)
|
||||
|
||||
.stabstr
|
||||
*(.stabstr)
|
||||
|
||||
.stab.excl
|
||||
*(.stab.excl)
|
||||
|
||||
.stab.exclstr
|
||||
*(.stab.exclstr)
|
||||
|
||||
.stab.index
|
||||
*(.stab.index)
|
||||
|
||||
.stab.indexstr
|
||||
*(.stab.indexstr)
|
||||
|
||||
.comment 0x00000000 0x11
|
||||
*(.comment)
|
||||
.comment 0x00000000 0x11 main.o
|
||||
0x12 (size before relaxing)
|
||||
|
||||
.note.gnu.build-id
|
||||
*(.note.gnu.build-id)
|
||||
|
||||
.debug
|
||||
*(.debug)
|
||||
|
||||
.line
|
||||
*(.line)
|
||||
|
||||
.debug_srcinfo
|
||||
*(.debug_srcinfo)
|
||||
|
||||
.debug_sfnames
|
||||
*(.debug_sfnames)
|
||||
|
||||
.debug_aranges 0x00000000 0x20
|
||||
*(.debug_aranges)
|
||||
.debug_aranges
|
||||
0x00000000 0x20 main.o
|
||||
|
||||
.debug_pubnames
|
||||
*(.debug_pubnames)
|
||||
|
||||
.debug_info 0x00000000 0x119
|
||||
*(.debug_info .gnu.linkonce.wi.*)
|
||||
.debug_info 0x00000000 0x119 main.o
|
||||
|
||||
.debug_abbrev 0x00000000 0xd1
|
||||
*(.debug_abbrev)
|
||||
.debug_abbrev 0x00000000 0xd1 main.o
|
||||
|
||||
.debug_line 0x00000000 0xd9
|
||||
*(.debug_line .debug_line.* .debug_line_end)
|
||||
.debug_line 0x00000000 0xd9 main.o
|
||||
|
||||
.debug_frame 0x00000000 0x24
|
||||
*(.debug_frame)
|
||||
.debug_frame 0x00000000 0x24 main.o
|
||||
|
||||
.debug_str 0x00000000 0x132
|
||||
*(.debug_str)
|
||||
.debug_str 0x00000000 0x132 main.o
|
||||
0x166 (size before relaxing)
|
||||
|
||||
.debug_loc 0x00000000 0x1f
|
||||
*(.debug_loc)
|
||||
.debug_loc 0x00000000 0x1f main.o
|
||||
|
||||
.debug_macinfo
|
||||
*(.debug_macinfo)
|
||||
|
||||
.debug_weaknames
|
||||
*(.debug_weaknames)
|
||||
|
||||
.debug_funcnames
|
||||
*(.debug_funcnames)
|
||||
|
||||
.debug_typenames
|
||||
*(.debug_typenames)
|
||||
|
||||
.debug_varnames
|
||||
*(.debug_varnames)
|
||||
|
||||
.debug_pubtypes
|
||||
*(.debug_pubtypes)
|
||||
|
||||
.debug_ranges 0x00000000 0x10
|
||||
*(.debug_ranges)
|
||||
.debug_ranges 0x00000000 0x10 main.o
|
||||
|
||||
.debug_macro
|
||||
*(.debug_macro)
|
||||
OUTPUT(main.elf elf32-avr)
|
||||
LOAD linker stubs
|
||||
|
||||
Cross Reference Table
|
||||
|
||||
Symbol File
|
||||
__bad_interrupt e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__heap_end e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__init e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__stack e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_1 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_10 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_11 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_12 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_13 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_14 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_15 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_16 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_17 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_18 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_19 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_2 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_20 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_21 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_22 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_23 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_24 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_25 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_3 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_4 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_5 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_6 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_7 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_8 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_9 e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vector_default e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
__vectors e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
_exit e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
exit e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/avr4\libgcc.a(_exit.o)
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
main main.o
|
||||
e:/progs/arduino-1.7.4/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr4/crtm48.o
|
||||
52
trunk/AVRProjects/ATMega48/main.sym
Normal file
52
trunk/AVRProjects/ATMega48/main.sym
Normal file
@@ -0,0 +1,52 @@
|
||||
00000000 W __heap_end
|
||||
00000000 a __tmp_reg__
|
||||
00000000 W __vector_default
|
||||
00000000 T __vectors
|
||||
00000001 a __zero_reg__
|
||||
00000034 T __ctors_end
|
||||
00000034 T __ctors_start
|
||||
00000034 T __dtors_end
|
||||
00000034 T __dtors_start
|
||||
00000034 W __init
|
||||
00000034 T __trampolines_end
|
||||
00000034 T __trampolines_start
|
||||
0000003d a __SP_L__
|
||||
0000003e a __SP_H__
|
||||
0000003f a __SREG__
|
||||
00000044 T __bad_interrupt
|
||||
00000044 W __vector_1
|
||||
00000044 W __vector_10
|
||||
00000044 W __vector_11
|
||||
00000044 W __vector_12
|
||||
00000044 W __vector_13
|
||||
00000044 W __vector_14
|
||||
00000044 W __vector_15
|
||||
00000044 W __vector_16
|
||||
00000044 W __vector_17
|
||||
00000044 W __vector_18
|
||||
00000044 W __vector_19
|
||||
00000044 W __vector_2
|
||||
00000044 W __vector_20
|
||||
00000044 W __vector_21
|
||||
00000044 W __vector_22
|
||||
00000044 W __vector_23
|
||||
00000044 W __vector_24
|
||||
00000044 W __vector_25
|
||||
00000044 W __vector_3
|
||||
00000044 W __vector_4
|
||||
00000044 W __vector_5
|
||||
00000044 W __vector_6
|
||||
00000044 W __vector_7
|
||||
00000044 W __vector_8
|
||||
00000044 W __vector_9
|
||||
00000046 T main
|
||||
00000066 T _exit
|
||||
00000066 W exit
|
||||
00000068 t __stop_program
|
||||
0000006a A __data_load_end
|
||||
0000006a A __data_load_start
|
||||
0000006a T _etext
|
||||
000002ff W __stack
|
||||
00800100 D _edata
|
||||
00800100 T _end
|
||||
00810000 T __eeprom_end
|
||||
441
trunk/AVRProjects/ATMega48/makefile
Normal file
441
trunk/AVRProjects/ATMega48/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega48
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
F_OSC = 8000000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
35
trunk/AVRProjects/ATTiny13/.dep/main.o.d
Normal file
35
trunk/AVRProjects/ATTiny13/.dep/main.o.d
Normal file
@@ -0,0 +1,35 @@
|
||||
main.o: main.c main.h a:\hardware\tools\avr\avr\include\avr\io.h \
|
||||
a:\hardware\tools\avr\avr\include\avr\sfr_defs.h \
|
||||
a:\hardware\tools\avr\avr\include\inttypes.h \
|
||||
a:\hardware\tools\avr\lib\gcc\avr\4.9.2\include\stdint.h \
|
||||
a:\hardware\tools\avr\avr\include\stdint.h \
|
||||
a:\hardware\tools\avr\avr\include\avr\iotn13.h \
|
||||
a:\hardware\tools\avr\avr\include\avr\portpins.h \
|
||||
a:\hardware\tools\avr\avr\include\avr\common.h \
|
||||
a:\hardware\tools\avr\avr\include\avr\version.h \
|
||||
a:\hardware\tools\avr\avr\include\avr\fuse.h \
|
||||
a:\hardware\tools\avr\avr\include\avr\lock.h
|
||||
|
||||
main.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\avr\io.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\avr\sfr_defs.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\inttypes.h:
|
||||
|
||||
a:\hardware\tools\avr\lib\gcc\avr\4.9.2\include\stdint.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\stdint.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\avr\iotn13.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\avr\portpins.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\avr\common.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\avr\version.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\avr\fuse.h:
|
||||
|
||||
a:\hardware\tools\avr\avr\include\avr\lock.h:
|
||||
67
trunk/AVRProjects/ATTiny13/main.c
Normal file
67
trunk/AVRProjects/ATTiny13/main.c
Normal file
@@ -0,0 +1,67 @@
|
||||
/* ******************************************************** *
|
||||
*
|
||||
* Simple program with avr-gcc and ATtiny13
|
||||
* -------------------------------------------------------- *
|
||||
* Created on: 07.06.2016
|
||||
* Author: Paolo Iocco
|
||||
* ******************************************************** */
|
||||
/* ******************************************************** *
|
||||
ATtiny 13/45/85 Pin map
|
||||
+--\/--+
|
||||
/Reset ADC0 PB5 -|1° 8|- Vcc
|
||||
ADC3 PB3 -|2 7|- PB2 ADC1 SCK
|
||||
ADC2 PB4 -|3 6|- PB1 OC0B MISO AIN1
|
||||
GND -|4 5|- PB0 OC0A MOSI AIN0
|
||||
+------+
|
||||
* ********************************************************* */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void adc_setup (void)
|
||||
{
|
||||
// Set the ADC input to PB2/ADC1
|
||||
ADMUX |= (1 << MUX0);
|
||||
ADMUX |= (1 << ADLAR);
|
||||
// Set the prescaler to clock/128 & enable ADC
|
||||
ADCSRA |= (1 << ADPS1) | (1 << ADPS0) | (1 << ADEN);
|
||||
}
|
||||
|
||||
int adc_read (void)
|
||||
{
|
||||
// Start the conversion
|
||||
ADCSRA |= (1 << ADSC);
|
||||
// Wait for it to finish
|
||||
while (ADCSRA & (1 << ADSC));
|
||||
return ADCH;
|
||||
}
|
||||
|
||||
void pwm_setup (void)
|
||||
{
|
||||
// Set Timer 0 prescaler to clock/8.
|
||||
// At 9.6 MHz this is 1.2 MHz.
|
||||
TCCR0B |= (1 << CS01) | (1 << CS00);
|
||||
// Set to 'Fast PWM' mode
|
||||
TCCR0A |= (1 << WGM01) | (1 << WGM00);
|
||||
// Clear OC0B output on compare match, upwards counting.
|
||||
TCCR0A |= (1 << COM0B1);
|
||||
}
|
||||
|
||||
void pwm_write (int val)
|
||||
{
|
||||
OCR0B = val;
|
||||
}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int adc_in;
|
||||
// LED is an output.
|
||||
DDRB |= (1 << LED);
|
||||
adc_setup();
|
||||
pwm_setup();
|
||||
while (1) {
|
||||
// Get the ADC value
|
||||
adc_in = adc_read();
|
||||
// Now write it to the PWM counter
|
||||
pwm_write(adc_in);
|
||||
}
|
||||
}
|
||||
1
trunk/AVRProjects/ATTiny13/main.eep
Normal file
1
trunk/AVRProjects/ATTiny13/main.eep
Normal file
@@ -0,0 +1 @@
|
||||
:00000001FF
|
||||
BIN
trunk/AVRProjects/ATTiny13/main.elf
Normal file
BIN
trunk/AVRProjects/ATTiny13/main.elf
Normal file
Binary file not shown.
18
trunk/AVRProjects/ATTiny13/main.h
Normal file
18
trunk/AVRProjects/ATTiny13/main.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* main.h
|
||||
*
|
||||
* Created on: 20.07.2016
|
||||
* Author: q242695
|
||||
*/
|
||||
#ifndef MAIN_H_
|
||||
#define MAIN_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 9600000L
|
||||
#endif
|
||||
|
||||
#define LED PB3
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
8
trunk/AVRProjects/ATTiny13/main.hex
Normal file
8
trunk/AVRProjects/ATTiny13/main.hex
Normal file
@@ -0,0 +1,8 @@
|
||||
:1000000009C00EC00DC00CC00BC00AC009C008C09A
|
||||
:1000100007C006C011241FBECFE9CDBF1AD01FC034
|
||||
:10002000EFCF389A3D9A86B1836886B90895369A9B
|
||||
:100030003699FECF85B190E0089583B7836083BF82
|
||||
:100040008FB583608FBD8FB580628FBD089589BDE8
|
||||
:100050000895BB9AE6DFF1DFEADF89BDFDCFF894B2
|
||||
:02006000FFCFD0
|
||||
:00000001FF
|
||||
149
trunk/AVRProjects/ATTiny13/main.lss
Normal file
149
trunk/AVRProjects/ATTiny13/main.lss
Normal file
@@ -0,0 +1,149 @@
|
||||
|
||||
main.elf: file format elf32-avr
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .text 00000062 00000000 00000000 00000074 2**1
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
1 .data 00000000 00800060 00000062 000000d6 2**0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
2 .comment 00000011 00000000 00000000 000000d6 2**0
|
||||
CONTENTS, READONLY
|
||||
3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000000e8 2**2
|
||||
CONTENTS, READONLY
|
||||
4 .debug_aranges 00000028 00000000 00000000 00000124 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
5 .debug_info 00000410 00000000 00000000 0000014c 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
6 .debug_abbrev 0000037f 00000000 00000000 0000055c 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
7 .debug_line 0000010a 00000000 00000000 000008db 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
8 .debug_frame 00000064 00000000 00000000 000009e8 2**2
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
9 .debug_str 00000217 00000000 00000000 00000a4c 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
10 .debug_ranges 00000018 00000000 00000000 00000c63 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <__vectors>:
|
||||
0: 09 c0 rjmp .+18 ; 0x14 <__ctors_end>
|
||||
2: 0e c0 rjmp .+28 ; 0x20 <__bad_interrupt>
|
||||
4: 0d c0 rjmp .+26 ; 0x20 <__bad_interrupt>
|
||||
6: 0c c0 rjmp .+24 ; 0x20 <__bad_interrupt>
|
||||
8: 0b c0 rjmp .+22 ; 0x20 <__bad_interrupt>
|
||||
a: 0a c0 rjmp .+20 ; 0x20 <__bad_interrupt>
|
||||
c: 09 c0 rjmp .+18 ; 0x20 <__bad_interrupt>
|
||||
e: 08 c0 rjmp .+16 ; 0x20 <__bad_interrupt>
|
||||
10: 07 c0 rjmp .+14 ; 0x20 <__bad_interrupt>
|
||||
12: 06 c0 rjmp .+12 ; 0x20 <__bad_interrupt>
|
||||
|
||||
00000014 <__ctors_end>:
|
||||
14: 11 24 eor r1, r1
|
||||
16: 1f be out 0x3f, r1 ; 63
|
||||
18: cf e9 ldi r28, 0x9F ; 159
|
||||
1a: cd bf out 0x3d, r28 ; 61
|
||||
1c: 1a d0 rcall .+52 ; 0x52 <main>
|
||||
1e: 1f c0 rjmp .+62 ; 0x5e <_exit>
|
||||
|
||||
00000020 <__bad_interrupt>:
|
||||
20: ef cf rjmp .-34 ; 0x0 <__vectors>
|
||||
|
||||
00000022 <adc_setup>:
|
||||
#include "main.h"
|
||||
|
||||
void adc_setup (void)
|
||||
{
|
||||
// Set the ADC input to PB2/ADC1
|
||||
ADMUX |= (1 << MUX0);
|
||||
22: 38 9a sbi 0x07, 0 ; 7
|
||||
ADMUX |= (1 << ADLAR);
|
||||
24: 3d 9a sbi 0x07, 5 ; 7
|
||||
// Set the prescaler to clock/128 & enable ADC
|
||||
ADCSRA |= (1 << ADPS1) | (1 << ADPS0) | (1 << ADEN);
|
||||
26: 86 b1 in r24, 0x06 ; 6
|
||||
28: 83 68 ori r24, 0x83 ; 131
|
||||
2a: 86 b9 out 0x06, r24 ; 6
|
||||
2c: 08 95 ret
|
||||
|
||||
0000002e <adc_read>:
|
||||
}
|
||||
|
||||
int adc_read (void)
|
||||
{
|
||||
// Start the conversion
|
||||
ADCSRA |= (1 << ADSC);
|
||||
2e: 36 9a sbi 0x06, 6 ; 6
|
||||
// Wait for it to finish
|
||||
while (ADCSRA & (1 << ADSC));
|
||||
30: 36 99 sbic 0x06, 6 ; 6
|
||||
32: fe cf rjmp .-4 ; 0x30 <adc_read+0x2>
|
||||
return ADCH;
|
||||
34: 85 b1 in r24, 0x05 ; 5
|
||||
}
|
||||
36: 90 e0 ldi r25, 0x00 ; 0
|
||||
38: 08 95 ret
|
||||
|
||||
0000003a <pwm_setup>:
|
||||
|
||||
void pwm_setup (void)
|
||||
{
|
||||
// Set Timer 0 prescaler to clock/8.
|
||||
// At 9.6 MHz this is 1.2 MHz.
|
||||
TCCR0B |= (1 << CS01) | (1 << CS00);
|
||||
3a: 83 b7 in r24, 0x33 ; 51
|
||||
3c: 83 60 ori r24, 0x03 ; 3
|
||||
3e: 83 bf out 0x33, r24 ; 51
|
||||
// Set to 'Fast PWM' mode
|
||||
TCCR0A |= (1 << WGM01) | (1 << WGM00);
|
||||
40: 8f b5 in r24, 0x2f ; 47
|
||||
42: 83 60 ori r24, 0x03 ; 3
|
||||
44: 8f bd out 0x2f, r24 ; 47
|
||||
// Clear OC0B output on compare match, upwards counting.
|
||||
TCCR0A |= (1 << COM0B1);
|
||||
46: 8f b5 in r24, 0x2f ; 47
|
||||
48: 80 62 ori r24, 0x20 ; 32
|
||||
4a: 8f bd out 0x2f, r24 ; 47
|
||||
4c: 08 95 ret
|
||||
|
||||
0000004e <pwm_write>:
|
||||
}
|
||||
|
||||
void pwm_write (int val)
|
||||
{
|
||||
OCR0B = val;
|
||||
4e: 89 bd out 0x29, r24 ; 41
|
||||
50: 08 95 ret
|
||||
|
||||
00000052 <main>:
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int adc_in;
|
||||
// LED is an output.
|
||||
DDRB |= (1 << LED);
|
||||
52: bb 9a sbi 0x17, 3 ; 23
|
||||
adc_setup();
|
||||
54: e6 df rcall .-52 ; 0x22 <adc_setup>
|
||||
pwm_setup();
|
||||
56: f1 df rcall .-30 ; 0x3a <pwm_setup>
|
||||
while (1) {
|
||||
// Get the ADC value
|
||||
adc_in = adc_read();
|
||||
58: ea df rcall .-44 ; 0x2e <adc_read>
|
||||
TCCR0A |= (1 << COM0B1);
|
||||
}
|
||||
|
||||
void pwm_write (int val)
|
||||
{
|
||||
OCR0B = val;
|
||||
5a: 89 bd out 0x29, r24 ; 41
|
||||
5c: fd cf rjmp .-6 ; 0x58 <main+0x6>
|
||||
|
||||
0000005e <_exit>:
|
||||
5e: f8 94 cli
|
||||
|
||||
00000060 <__stop_program>:
|
||||
60: ff cf rjmp .-2 ; 0x60 <__stop_program>
|
||||
201
trunk/AVRProjects/ATTiny13/main.lst
Normal file
201
trunk/AVRProjects/ATTiny13/main.lst
Normal file
@@ -0,0 +1,201 @@
|
||||
1 .file "main.c"
|
||||
2 __SP_L__ = 0x3d
|
||||
3 __SREG__ = 0x3f
|
||||
4 __tmp_reg__ = 0
|
||||
5 __zero_reg__ = 1
|
||||
6 .text
|
||||
7 .Ltext0:
|
||||
8 .cfi_sections .debug_frame
|
||||
9 .global adc_setup
|
||||
11 adc_setup:
|
||||
12 .LFB0:
|
||||
13 .file 1 "main.c"
|
||||
1:main.c **** /* ******************************************************** *
|
||||
2:main.c **** *
|
||||
3:main.c **** * Simple program with avr-gcc and ATtiny13
|
||||
4:main.c **** * -------------------------------------------------------- *
|
||||
5:main.c **** * Created on: 07.06.2016
|
||||
6:main.c **** * Author: Paolo Iocco
|
||||
7:main.c **** * ******************************************************** */
|
||||
8:main.c **** /* ******************************************************** *
|
||||
9:main.c **** ATtiny 13/45/85 Pin map
|
||||
10:main.c **** +--\/--+
|
||||
11:main.c **** /Reset ADC0 PB5 -|1° 8|- Vcc
|
||||
12:main.c **** ADC3 PB3 -|2 7|- PB2 ADC1 SCK
|
||||
13:main.c **** ADC2 PB4 -|3 6|- PB1 OC0B MISO AIN1
|
||||
14:main.c **** GND -|4 5|- PB0 OC0A MOSI AIN0
|
||||
15:main.c **** +------+
|
||||
16:main.c **** * ********************************************************* */
|
||||
17:main.c ****
|
||||
18:main.c **** #include "main.h"
|
||||
19:main.c ****
|
||||
20:main.c **** void adc_setup (void)
|
||||
21:main.c **** {
|
||||
14 .loc 1 21 0
|
||||
15 .cfi_startproc
|
||||
16 /* prologue: function */
|
||||
17 /* frame size = 0 */
|
||||
18 /* stack size = 0 */
|
||||
19 .L__stack_usage = 0
|
||||
22:main.c **** // Set the ADC input to PB2/ADC1
|
||||
23:main.c **** ADMUX |= (1 << MUX0);
|
||||
20 .loc 1 23 0
|
||||
21 0000 389A sbi 0x7,0
|
||||
24:main.c **** ADMUX |= (1 << ADLAR);
|
||||
22 .loc 1 24 0
|
||||
23 0002 3D9A sbi 0x7,5
|
||||
25:main.c **** // Set the prescaler to clock/128 & enable ADC
|
||||
26:main.c **** ADCSRA |= (1 << ADPS1) | (1 << ADPS0) | (1 << ADEN);
|
||||
24 .loc 1 26 0
|
||||
25 0004 86B1 in r24,0x6
|
||||
26 0006 8368 ori r24,lo8(-125)
|
||||
27 0008 86B9 out 0x6,r24
|
||||
28 000a 0895 ret
|
||||
29 .cfi_endproc
|
||||
30 .LFE0:
|
||||
32 .global adc_read
|
||||
34 adc_read:
|
||||
35 .LFB1:
|
||||
27:main.c **** }
|
||||
28:main.c ****
|
||||
29:main.c **** int adc_read (void)
|
||||
30:main.c **** {
|
||||
36 .loc 1 30 0
|
||||
37 .cfi_startproc
|
||||
38 /* prologue: function */
|
||||
39 /* frame size = 0 */
|
||||
40 /* stack size = 0 */
|
||||
41 .L__stack_usage = 0
|
||||
31:main.c **** // Start the conversion
|
||||
32:main.c **** ADCSRA |= (1 << ADSC);
|
||||
42 .loc 1 32 0
|
||||
43 000c 369A sbi 0x6,6
|
||||
44 .L3:
|
||||
33:main.c **** // Wait for it to finish
|
||||
34:main.c **** while (ADCSRA & (1 << ADSC));
|
||||
45 .loc 1 34 0 discriminator 1
|
||||
46 000e 3699 sbic 0x6,6
|
||||
47 0010 00C0 rjmp .L3
|
||||
35:main.c **** return ADCH;
|
||||
48 .loc 1 35 0
|
||||
49 0012 85B1 in r24,0x5
|
||||
36:main.c **** }
|
||||
50 .loc 1 36 0
|
||||
51 0014 90E0 ldi r25,0
|
||||
52 0016 0895 ret
|
||||
53 .cfi_endproc
|
||||
54 .LFE1:
|
||||
56 .global pwm_setup
|
||||
58 pwm_setup:
|
||||
59 .LFB2:
|
||||
37:main.c ****
|
||||
38:main.c **** void pwm_setup (void)
|
||||
39:main.c **** {
|
||||
60 .loc 1 39 0
|
||||
61 .cfi_startproc
|
||||
62 /* prologue: function */
|
||||
63 /* frame size = 0 */
|
||||
64 /* stack size = 0 */
|
||||
65 .L__stack_usage = 0
|
||||
40:main.c **** // Set Timer 0 prescaler to clock/8.
|
||||
41:main.c **** // At 9.6 MHz this is 1.2 MHz.
|
||||
42:main.c **** TCCR0B |= (1 << CS01) | (1 << CS00);
|
||||
66 .loc 1 42 0
|
||||
67 0018 83B7 in r24,0x33
|
||||
68 001a 8360 ori r24,lo8(3)
|
||||
69 001c 83BF out 0x33,r24
|
||||
43:main.c **** // Set to 'Fast PWM' mode
|
||||
44:main.c **** TCCR0A |= (1 << WGM01) | (1 << WGM00);
|
||||
70 .loc 1 44 0
|
||||
71 001e 8FB5 in r24,0x2f
|
||||
72 0020 8360 ori r24,lo8(3)
|
||||
73 0022 8FBD out 0x2f,r24
|
||||
45:main.c **** // Clear OC0B output on compare match, upwards counting.
|
||||
46:main.c **** TCCR0A |= (1 << COM0B1);
|
||||
74 .loc 1 46 0
|
||||
75 0024 8FB5 in r24,0x2f
|
||||
76 0026 8062 ori r24,lo8(32)
|
||||
77 0028 8FBD out 0x2f,r24
|
||||
78 002a 0895 ret
|
||||
79 .cfi_endproc
|
||||
80 .LFE2:
|
||||
82 .global pwm_write
|
||||
84 pwm_write:
|
||||
85 .LFB3:
|
||||
47:main.c **** }
|
||||
48:main.c ****
|
||||
49:main.c **** void pwm_write (int val)
|
||||
50:main.c **** {
|
||||
86 .loc 1 50 0
|
||||
87 .cfi_startproc
|
||||
88 .LVL0:
|
||||
89 /* prologue: function */
|
||||
90 /* frame size = 0 */
|
||||
91 /* stack size = 0 */
|
||||
92 .L__stack_usage = 0
|
||||
51:main.c **** OCR0B = val;
|
||||
93 .loc 1 51 0
|
||||
94 002c 89BD out 0x29,r24
|
||||
95 002e 0895 ret
|
||||
96 .cfi_endproc
|
||||
97 .LFE3:
|
||||
99 .section .text.startup,"ax",@progbits
|
||||
100 .global main
|
||||
102 main:
|
||||
103 .LFB4:
|
||||
52:main.c **** }
|
||||
53:main.c ****
|
||||
54:main.c **** int main (void)
|
||||
55:main.c **** {
|
||||
104 .loc 1 55 0
|
||||
105 .cfi_startproc
|
||||
106 /* prologue: function */
|
||||
107 /* frame size = 0 */
|
||||
108 /* stack size = 0 */
|
||||
109 .L__stack_usage = 0
|
||||
56:main.c **** int adc_in;
|
||||
57:main.c **** // LED is an output.
|
||||
58:main.c **** DDRB |= (1 << LED);
|
||||
110 .loc 1 58 0
|
||||
111 0000 BB9A sbi 0x17,3
|
||||
59:main.c **** adc_setup();
|
||||
112 .loc 1 59 0
|
||||
113 0002 00D0 rcall adc_setup
|
||||
114 .LVL1:
|
||||
60:main.c **** pwm_setup();
|
||||
115 .loc 1 60 0
|
||||
116 0004 00D0 rcall pwm_setup
|
||||
117 .LVL2:
|
||||
118 .L9:
|
||||
61:main.c **** while (1) {
|
||||
62:main.c **** // Get the ADC value
|
||||
63:main.c **** adc_in = adc_read();
|
||||
119 .loc 1 63 0 discriminator 1
|
||||
120 0006 00D0 rcall adc_read
|
||||
121 .LVL3:
|
||||
122 .LBB4:
|
||||
123 .LBB5:
|
||||
51:main.c **** }
|
||||
124 .loc 1 51 0 discriminator 1
|
||||
125 0008 89BD out 0x29,r24
|
||||
126 000a 00C0 rjmp .L9
|
||||
127 .LBE5:
|
||||
128 .LBE4:
|
||||
129 .cfi_endproc
|
||||
130 .LFE4:
|
||||
132 .text
|
||||
133 .Letext0:
|
||||
134 .file 2 "a:\\hardware\\tools\\avr\\avr\\include\\stdint.h"
|
||||
DEFINED SYMBOLS
|
||||
*ABS*:00000000 main.c
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:2 *ABS*:0000003d __SP_L__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:3 *ABS*:0000003f __SREG__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:4 *ABS*:00000000 __tmp_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:5 *ABS*:00000001 __zero_reg__
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:11 .text:00000000 adc_setup
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:34 .text:0000000c adc_read
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:58 .text:00000018 pwm_setup
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:84 .text:0000002c pwm_write
|
||||
C:\Users\q242695\AppData\Local\Temp\ccY7rbVv.s:102 .text.startup:00000000 main
|
||||
|
||||
NO UNDEFINED SYMBOLS
|
||||
427
trunk/AVRProjects/ATTiny13/main.map
Normal file
427
trunk/AVRProjects/ATTiny13/main.map
Normal file
@@ -0,0 +1,427 @@
|
||||
Archive member included to satisfy reference by file (symbol)
|
||||
|
||||
a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o (exit)
|
||||
|
||||
Memory Configuration
|
||||
|
||||
Name Origin Length Attributes
|
||||
text 0x00000000 0x00002000 xr
|
||||
data 0x00800060 0x0000ffa0 rw !x
|
||||
eeprom 0x00810000 0x00010000 rw !x
|
||||
fuse 0x00820000 0x00000002 rw !x
|
||||
lock 0x00830000 0x00000400 rw !x
|
||||
signature 0x00840000 0x00000400 rw !x
|
||||
user_signatures 0x00850000 0x00000400 rw !x
|
||||
*default* 0x00000000 0xffffffff
|
||||
|
||||
Linker script and memory map
|
||||
|
||||
LOAD a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
LOAD main.o
|
||||
LOAD a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack\libm.a
|
||||
START GROUP
|
||||
LOAD a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a
|
||||
LOAD a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack\libm.a
|
||||
LOAD a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack\libc.a
|
||||
LOAD a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack\libattiny13.a
|
||||
END GROUP
|
||||
0x00002000 __TEXT_REGION_LENGTH__ = DEFINED (__TEXT_REGION_LENGTH__)?__TEXT_REGION_LENGTH__:0x2000
|
||||
0x0000ffa0 __DATA_REGION_LENGTH__ = DEFINED (__DATA_REGION_LENGTH__)?__DATA_REGION_LENGTH__:0xffa0
|
||||
0x00010000 __EEPROM_REGION_LENGTH__ = DEFINED (__EEPROM_REGION_LENGTH__)?__EEPROM_REGION_LENGTH__:0x10000
|
||||
[0x00000002] __FUSE_REGION_LENGTH__ = DEFINED (__FUSE_REGION_LENGTH__)?__FUSE_REGION_LENGTH__:0x400
|
||||
0x00000400 __LOCK_REGION_LENGTH__ = DEFINED (__LOCK_REGION_LENGTH__)?__LOCK_REGION_LENGTH__:0x400
|
||||
0x00000400 __SIGNATURE_REGION_LENGTH__ = DEFINED (__SIGNATURE_REGION_LENGTH__)?__SIGNATURE_REGION_LENGTH__:0x400
|
||||
0x00000400 __USER_SIGNATURE_REGION_LENGTH__ = DEFINED (__USER_SIGNATURE_REGION_LENGTH__)?__USER_SIGNATURE_REGION_LENGTH__:0x400
|
||||
|
||||
.hash
|
||||
*(.hash)
|
||||
|
||||
.dynsym
|
||||
*(.dynsym)
|
||||
|
||||
.dynstr
|
||||
*(.dynstr)
|
||||
|
||||
.gnu.version
|
||||
*(.gnu.version)
|
||||
|
||||
.gnu.version_d
|
||||
*(.gnu.version_d)
|
||||
|
||||
.gnu.version_r
|
||||
*(.gnu.version_r)
|
||||
|
||||
.rel.init
|
||||
*(.rel.init)
|
||||
|
||||
.rela.init
|
||||
*(.rela.init)
|
||||
|
||||
.rel.text
|
||||
*(.rel.text)
|
||||
*(.rel.text.*)
|
||||
*(.rel.gnu.linkonce.t*)
|
||||
|
||||
.rela.text
|
||||
*(.rela.text)
|
||||
*(.rela.text.*)
|
||||
*(.rela.gnu.linkonce.t*)
|
||||
|
||||
.rel.fini
|
||||
*(.rel.fini)
|
||||
|
||||
.rela.fini
|
||||
*(.rela.fini)
|
||||
|
||||
.rel.rodata
|
||||
*(.rel.rodata)
|
||||
*(.rel.rodata.*)
|
||||
*(.rel.gnu.linkonce.r*)
|
||||
|
||||
.rela.rodata
|
||||
*(.rela.rodata)
|
||||
*(.rela.rodata.*)
|
||||
*(.rela.gnu.linkonce.r*)
|
||||
|
||||
.rel.data
|
||||
*(.rel.data)
|
||||
*(.rel.data.*)
|
||||
*(.rel.gnu.linkonce.d*)
|
||||
|
||||
.rela.data
|
||||
*(.rela.data)
|
||||
*(.rela.data.*)
|
||||
*(.rela.gnu.linkonce.d*)
|
||||
|
||||
.rel.ctors
|
||||
*(.rel.ctors)
|
||||
|
||||
.rela.ctors
|
||||
*(.rela.ctors)
|
||||
|
||||
.rel.dtors
|
||||
*(.rel.dtors)
|
||||
|
||||
.rela.dtors
|
||||
*(.rela.dtors)
|
||||
|
||||
.rel.got
|
||||
*(.rel.got)
|
||||
|
||||
.rela.got
|
||||
*(.rela.got)
|
||||
|
||||
.rel.bss
|
||||
*(.rel.bss)
|
||||
|
||||
.rela.bss
|
||||
*(.rela.bss)
|
||||
|
||||
.rel.plt
|
||||
*(.rel.plt)
|
||||
|
||||
.rela.plt
|
||||
*(.rela.plt)
|
||||
|
||||
.text 0x00000000 0x62
|
||||
*(.vectors)
|
||||
.vectors 0x00000000 0x14 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
0x00000000 __vector_default
|
||||
0x00000000 __vectors
|
||||
*(.vectors)
|
||||
*(.progmem.gcc*)
|
||||
0x00000014 . = ALIGN (0x2)
|
||||
0x00000014 __trampolines_start = .
|
||||
*(.trampolines)
|
||||
.trampolines 0x00000014 0x0 linker stubs
|
||||
*(.trampolines*)
|
||||
0x00000014 __trampolines_end = .
|
||||
*libprintf_flt.a:*(.progmem.data)
|
||||
*libc.a:*(.progmem.data)
|
||||
*(.progmem*)
|
||||
0x00000014 . = ALIGN (0x2)
|
||||
*(.jumptables)
|
||||
*(.jumptables*)
|
||||
*(.lowtext)
|
||||
*(.lowtext*)
|
||||
0x00000014 __ctors_start = .
|
||||
*(.ctors)
|
||||
0x00000014 __ctors_end = .
|
||||
0x00000014 __dtors_start = .
|
||||
*(.dtors)
|
||||
0x00000014 __dtors_end = .
|
||||
SORT(*)(.ctors)
|
||||
SORT(*)(.dtors)
|
||||
*(.init0)
|
||||
.init0 0x00000014 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
0x00000014 __init
|
||||
*(.init0)
|
||||
*(.init1)
|
||||
*(.init1)
|
||||
*(.init2)
|
||||
.init2 0x00000014 0x8 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
*(.init2)
|
||||
*(.init3)
|
||||
*(.init3)
|
||||
*(.init4)
|
||||
*(.init4)
|
||||
*(.init5)
|
||||
*(.init5)
|
||||
*(.init6)
|
||||
*(.init6)
|
||||
*(.init7)
|
||||
*(.init7)
|
||||
*(.init8)
|
||||
*(.init8)
|
||||
*(.init9)
|
||||
.init9 0x0000001c 0x4 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
*(.init9)
|
||||
*(.text)
|
||||
.text 0x00000020 0x2 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
0x00000020 __vector_1
|
||||
0x00000020 __bad_interrupt
|
||||
0x00000020 __vector_6
|
||||
0x00000020 __vector_3
|
||||
0x00000020 __vector_7
|
||||
0x00000020 __vector_5
|
||||
0x00000020 __vector_4
|
||||
0x00000020 __vector_9
|
||||
0x00000020 __vector_2
|
||||
0x00000020 __vector_8
|
||||
.text 0x00000022 0x30 main.o
|
||||
0x00000022 adc_setup
|
||||
0x0000002e adc_read
|
||||
0x0000003a pwm_setup
|
||||
0x0000004e pwm_write
|
||||
.text 0x00000052 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
0x00000052 . = ALIGN (0x2)
|
||||
*(.text.*)
|
||||
.text.startup 0x00000052 0xc main.o
|
||||
0x00000052 main
|
||||
.text.libgcc.mul
|
||||
0x0000005e 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
.text.libgcc.div
|
||||
0x0000005e 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
.text.libgcc 0x0000005e 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
.text.libgcc.prologue
|
||||
0x0000005e 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
.text.libgcc.builtins
|
||||
0x0000005e 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
.text.libgcc.fmul
|
||||
0x0000005e 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
.text.libgcc.fixed
|
||||
0x0000005e 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
0x0000005e . = ALIGN (0x2)
|
||||
*(.fini9)
|
||||
.fini9 0x0000005e 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
0x0000005e _exit
|
||||
0x0000005e exit
|
||||
*(.fini9)
|
||||
*(.fini8)
|
||||
*(.fini8)
|
||||
*(.fini7)
|
||||
*(.fini7)
|
||||
*(.fini6)
|
||||
*(.fini6)
|
||||
*(.fini5)
|
||||
*(.fini5)
|
||||
*(.fini4)
|
||||
*(.fini4)
|
||||
*(.fini3)
|
||||
*(.fini3)
|
||||
*(.fini2)
|
||||
*(.fini2)
|
||||
*(.fini1)
|
||||
*(.fini1)
|
||||
*(.fini0)
|
||||
.fini0 0x0000005e 0x4 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
*(.fini0)
|
||||
0x00000062 _etext = .
|
||||
|
||||
.data 0x00800060 0x0 load address 0x00000062
|
||||
[!provide] PROVIDE (__data_start, .)
|
||||
*(.data)
|
||||
.data 0x00800060 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
.data 0x00800060 0x0 main.o
|
||||
.data 0x00800060 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
*(.data*)
|
||||
*(.rodata)
|
||||
*(.rodata*)
|
||||
*(.gnu.linkonce.d*)
|
||||
0x00800060 . = ALIGN (0x2)
|
||||
0x00800060 _edata = .
|
||||
[!provide] PROVIDE (__data_end, .)
|
||||
|
||||
.bss 0x00800060 0x0
|
||||
[!provide] PROVIDE (__bss_start, .)
|
||||
*(.bss)
|
||||
.bss 0x00800060 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
.bss 0x00800060 0x0 main.o
|
||||
.bss 0x00800060 0x0 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
[!provide] PROVIDE (__bss_end, .)
|
||||
0x00000062 __data_load_start = LOADADDR (.data)
|
||||
0x00000062 __data_load_end = (__data_load_start + SIZEOF (.data))
|
||||
|
||||
.noinit 0x00800060 0x0
|
||||
[!provide] PROVIDE (__noinit_start, .)
|
||||
*(.noinit*)
|
||||
[!provide] PROVIDE (__noinit_end, .)
|
||||
0x00800060 _end = .
|
||||
[!provide] PROVIDE (__heap_start, .)
|
||||
|
||||
.eeprom 0x00810000 0x0
|
||||
*(.eeprom*)
|
||||
0x00810000 __eeprom_end = .
|
||||
|
||||
.fuse
|
||||
*(.fuse)
|
||||
*(.lfuse)
|
||||
*(.hfuse)
|
||||
*(.efuse)
|
||||
|
||||
.lock
|
||||
*(.lock*)
|
||||
|
||||
.signature
|
||||
*(.signature*)
|
||||
|
||||
.user_signatures
|
||||
*(.user_signatures*)
|
||||
|
||||
.stab
|
||||
*(.stab)
|
||||
|
||||
.stabstr
|
||||
*(.stabstr)
|
||||
|
||||
.stab.excl
|
||||
*(.stab.excl)
|
||||
|
||||
.stab.exclstr
|
||||
*(.stab.exclstr)
|
||||
|
||||
.stab.index
|
||||
*(.stab.index)
|
||||
|
||||
.stab.indexstr
|
||||
*(.stab.indexstr)
|
||||
|
||||
.comment 0x00000000 0x11
|
||||
*(.comment)
|
||||
.comment 0x00000000 0x11 main.o
|
||||
0x12 (size before relaxing)
|
||||
|
||||
.note.gnu.avr.deviceinfo
|
||||
0x00000000 0x3c
|
||||
.note.gnu.avr.deviceinfo
|
||||
0x00000000 0x3c a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
|
||||
.note.gnu.build-id
|
||||
*(.note.gnu.build-id)
|
||||
|
||||
.debug
|
||||
*(.debug)
|
||||
|
||||
.line
|
||||
*(.line)
|
||||
|
||||
.debug_srcinfo
|
||||
*(.debug_srcinfo)
|
||||
|
||||
.debug_sfnames
|
||||
*(.debug_sfnames)
|
||||
|
||||
.debug_aranges 0x00000000 0x28
|
||||
*(.debug_aranges)
|
||||
.debug_aranges
|
||||
0x00000000 0x28 main.o
|
||||
|
||||
.debug_pubnames
|
||||
*(.debug_pubnames)
|
||||
|
||||
.debug_info 0x00000000 0x410
|
||||
*(.debug_info .gnu.linkonce.wi.*)
|
||||
.debug_info 0x00000000 0x2b8 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
.debug_info 0x000002b8 0x158 main.o
|
||||
|
||||
.debug_abbrev 0x00000000 0x37f
|
||||
*(.debug_abbrev)
|
||||
.debug_abbrev 0x00000000 0x294 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
.debug_abbrev 0x00000294 0xeb main.o
|
||||
|
||||
.debug_line 0x00000000 0x10a
|
||||
*(.debug_line .debug_line.* .debug_line_end)
|
||||
.debug_line 0x00000000 0x1a a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
.debug_line 0x0000001a 0xf0 main.o
|
||||
|
||||
.debug_frame 0x00000000 0x64
|
||||
*(.debug_frame)
|
||||
.debug_frame 0x00000000 0x64 main.o
|
||||
|
||||
.debug_str 0x00000000 0x217
|
||||
*(.debug_str)
|
||||
.debug_str 0x00000000 0xf6 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
.debug_str 0x000000f6 0x121 main.o
|
||||
0x155 (size before relaxing)
|
||||
|
||||
.debug_loc
|
||||
*(.debug_loc)
|
||||
|
||||
.debug_macinfo
|
||||
*(.debug_macinfo)
|
||||
|
||||
.debug_weaknames
|
||||
*(.debug_weaknames)
|
||||
|
||||
.debug_funcnames
|
||||
*(.debug_funcnames)
|
||||
|
||||
.debug_typenames
|
||||
*(.debug_typenames)
|
||||
|
||||
.debug_varnames
|
||||
*(.debug_varnames)
|
||||
|
||||
.debug_pubtypes
|
||||
*(.debug_pubtypes)
|
||||
|
||||
.debug_ranges 0x00000000 0x18
|
||||
*(.debug_ranges)
|
||||
.debug_ranges 0x00000000 0x18 main.o
|
||||
|
||||
.debug_macro
|
||||
*(.debug_macro)
|
||||
OUTPUT(main.elf elf32-avr)
|
||||
LOAD linker stubs
|
||||
|
||||
Cross Reference Table
|
||||
|
||||
Symbol File
|
||||
__FUSE_REGION_LENGTH__ a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__bad_interrupt a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__heap_end a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__init a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__stack a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_1 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_2 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_3 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_4 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_5 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_6 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_7 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_8 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_9 a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vector_default a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
__vectors a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
_exit a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
adc_read main.o
|
||||
adc_setup main.o
|
||||
exit a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/avr25/tiny-stack\libgcc.a(_exit.o)
|
||||
a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
main main.o
|
||||
a:/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr25/tiny-stack/crtattiny13.o
|
||||
pwm_setup main.o
|
||||
pwm_write main.o
|
||||
46
trunk/AVRProjects/ATTiny13/main.sym
Normal file
46
trunk/AVRProjects/ATTiny13/main.sym
Normal file
@@ -0,0 +1,46 @@
|
||||
00000000 W __heap_end
|
||||
00000000 a __tmp_reg__
|
||||
00000000 W __vector_default
|
||||
00000000 T __vectors
|
||||
00000001 a __zero_reg__
|
||||
00000002 A __FUSE_REGION_LENGTH__
|
||||
00000014 T __ctors_end
|
||||
00000014 T __ctors_start
|
||||
00000014 T __dtors_end
|
||||
00000014 T __dtors_start
|
||||
00000014 W __init
|
||||
00000014 T __trampolines_end
|
||||
00000014 T __trampolines_start
|
||||
00000020 T __bad_interrupt
|
||||
00000020 W __vector_1
|
||||
00000020 W __vector_2
|
||||
00000020 W __vector_3
|
||||
00000020 W __vector_4
|
||||
00000020 W __vector_5
|
||||
00000020 W __vector_6
|
||||
00000020 W __vector_7
|
||||
00000020 W __vector_8
|
||||
00000020 W __vector_9
|
||||
00000022 T adc_setup
|
||||
0000002e T adc_read
|
||||
0000003a T pwm_setup
|
||||
0000003d a __SP_L__
|
||||
0000003f a __SREG__
|
||||
0000004e T pwm_write
|
||||
00000052 T main
|
||||
0000005e T _exit
|
||||
0000005e W exit
|
||||
00000060 t __stop_program
|
||||
00000062 A __data_load_end
|
||||
00000062 A __data_load_start
|
||||
00000062 T _etext
|
||||
0000009f W __stack
|
||||
00000400 A __LOCK_REGION_LENGTH__
|
||||
00000400 A __SIGNATURE_REGION_LENGTH__
|
||||
00000400 A __USER_SIGNATURE_REGION_LENGTH__
|
||||
00002000 A __TEXT_REGION_LENGTH__
|
||||
0000ffa0 A __DATA_REGION_LENGTH__
|
||||
00010000 A __EEPROM_REGION_LENGTH__
|
||||
00800060 D _edata
|
||||
00800060 D _end
|
||||
00810000 D __eeprom_end
|
||||
441
trunk/AVRProjects/ATTiny13/makefile
Normal file
441
trunk/AVRProjects/ATTiny13/makefile
Normal file
@@ -0,0 +1,441 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
# mth 2004/09
|
||||
# Differences from WinAVR 20040720 sample:
|
||||
# - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum)
|
||||
# - F_OSC Define in CFLAGS and AFLAGS
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = attiny13
|
||||
|
||||
# Main Oscillator Frequency
|
||||
# This is only used to define F_OSC in all assembler and c-sources.
|
||||
#F_OSC = 9600000
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = main
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||||
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS =
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS =
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
CFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
ASFLAGS += -DF_OSC=$(F_OSC)
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
#AVRDUDE_PROGRAMMER = stk500
|
||||
AVRDUDE_PROGRAMMER = usbasp
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = usb # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = c:/winavr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
DIRAVRUTILS = $(DIRAVR)/utils/bin
|
||||
DIRINC = .
|
||||
DIRLIB = $(DIRAVR)/avr/lib
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
### GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d
|
||||
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
#all: begin gccversion sizebefore build sizeafter finished end
|
||||
all: begin gccversion build size finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
size:
|
||||
$(SIZE) -C --mcu=$(MCU) $(TARGET).elf
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) .dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
||||
36
trunk/AVRProjects/ATTiny13a-primo_asm/tiny13a_primo.avr
Normal file
36
trunk/AVRProjects/ATTiny13a-primo_asm/tiny13a_primo.avr
Normal file
@@ -0,0 +1,36 @@
|
||||
;* ******************************************************** *
|
||||
; ATtiny 13/45/85 Pin map
|
||||
; +--\/--+
|
||||
; /Reset ADC0 PB5 -|1° 8|- Vcc
|
||||
; ADC3 PB3 -|2 7|- PB2 ADC1 SCK
|
||||
; ADC2 PB4 -|3 6|- PB1 OC0B MISO AIN1
|
||||
; GND -|4 5|- PB0 OC0A MOSI AIN0
|
||||
; +------+
|
||||
;* ******************************************************** */
|
||||
|
||||
; Define processor type on top of the source code
|
||||
;
|
||||
;.DEVICE ATtiny13A
|
||||
.include "tn13def.inc"
|
||||
|
||||
; Int-Vector area
|
||||
.CSEG
|
||||
.ORG $0000
|
||||
rjmp Setup ;Reset
|
||||
reti ;INT0 - External Int0 Vector
|
||||
reti ;PCINT0 - Pin Change Interrupt handler
|
||||
reti ;TIM0_OVF - Timer0 Overflow handler
|
||||
reti ;EE_RDY - EEPROM Ready Handler
|
||||
reti ;ANA_COMP - Analog Comparator Handler
|
||||
reti ;TIM0_COMPA - Timer0 Compare match A Handler
|
||||
reti ;TIM0_COMPB - Timer0 Compare match B Handler
|
||||
reti ;WDT - Watchdog Overflow Handler
|
||||
reti ;ADC - ADC Conversion Handler
|
||||
|
||||
.ORG $000A
|
||||
Setup:
|
||||
cli ; Disable Interrupts
|
||||
ldi r16, low(RAMEND)
|
||||
out SPL,r16 ; Set Stack Pointer to top of RAM
|
||||
Main:
|
||||
rjmp Main ; infinite loop
|
||||
4
trunk/AVRProjects/ATTiny13a-primo_asm/tiny13a_primo.hex
Normal file
4
trunk/AVRProjects/ATTiny13a-primo_asm/tiny13a_primo.hex
Normal file
@@ -0,0 +1,4 @@
|
||||
:020000020000FC
|
||||
:1000000009C018951895189518951895189518956C
|
||||
:0C00100018951895F8940FE90DBFFFCF6C
|
||||
:00000001FF
|
||||
50
trunk/AVRProjects/ATTiny13a-primo_asm/tiny13a_primo.lst
Normal file
50
trunk/AVRProjects/ATTiny13a-primo_asm/tiny13a_primo.lst
Normal file
@@ -0,0 +1,50 @@
|
||||
gavrasm Gerd's AVR assembler version 3.5 (C)2015 by DG4FAC
|
||||
----------------------------------------------------------
|
||||
Source file: tiny13a_primo.avr
|
||||
Hex file: tiny13a_primo.hex
|
||||
Eeprom file: tiny13a_primo.eep
|
||||
Compiled: 08.11.2019, 14:49:53
|
||||
Pass: 2
|
||||
1: ;* ******************************************************** *
|
||||
2: ; ATtiny 13/45/85 Pin map
|
||||
3: ; +--\/--+
|
||||
4: ; /Reset ADC0 PB5 -|1° 8|- Vcc
|
||||
5: ; ADC3 PB3 -|2 7|- PB2 ADC1 SCK
|
||||
6: ; ADC2 PB4 -|3 6|- PB1 OC0B MISO AIN1
|
||||
7: ; GND -|4 5|- PB0 OC0A MOSI AIN0
|
||||
8: ; +------+
|
||||
9: ;* ******************************************************** */
|
||||
10:
|
||||
11: ; Define processor type on top of the source code
|
||||
12: ;
|
||||
13: .DEVICE ATtiny13A
|
||||
14:
|
||||
15: ; Int-Vector area
|
||||
16: .CSEG
|
||||
17: .ORG $0000
|
||||
18: 000000 C009 rjmp Setup ;Reset
|
||||
19: 000001 9518 reti ;INT0 - External Int0 Vector
|
||||
20: 000002 9518 reti ;PCINT0 - Pin Change Interrupt handler
|
||||
21: 000003 9518 reti ;TIM0_OVF - Timer0 Overflow handler
|
||||
22: 000004 9518 reti ;EE_RDY - EEPROM Ready Handler
|
||||
23: 000005 9518 reti ;ANA_COMP - Analog Comparator Handler
|
||||
24: 000006 9518 reti ;TIM0_COMPA - Timer0 Compare match A Handler
|
||||
25: 000007 9518 reti ;TIM0_COMPB - Timer0 Compare match B Handler
|
||||
26: 000008 9518 reti ;WDT - Watchdog Overflow Handler
|
||||
27: 000009 9518 reti ;ADC - ADC Conversion Handler
|
||||
28:
|
||||
29: .ORG $000A
|
||||
30: Setup:
|
||||
31: 00000A 94F8 cli ; Disable Interrupts
|
||||
32: 00000B E90F ldi r16, low(RAMEND)
|
||||
33: 00000C BF0D out SPL,r16 ; Set Stack Pointer to top of RAM
|
||||
34: Main:
|
||||
35: 00000D CFFF rjmp Main ; infinite loop
|
||||
|
||||
Program : 14 words.
|
||||
Constants : 0 words.
|
||||
Total program memory: 14 words.
|
||||
Eeprom space : 0 bytes.
|
||||
Data segment : 0 bytes.
|
||||
Compilation completed, no errors.
|
||||
Compilation endet 08.11.2019, 14:49:53
|
||||
49
trunk/AVRProjects/ATTiny2313-primo_asm/tiny2313a_primo.avr
Normal file
49
trunk/AVRProjects/ATTiny2313-primo_asm/tiny2313a_primo.avr
Normal file
@@ -0,0 +1,49 @@
|
||||
;* ******************************************************** *
|
||||
; ATtiny 2313/4313 Pin map
|
||||
; +-\/-+
|
||||
; /Reset PA2 1|o |20 Vcc
|
||||
; RXD PD0 2| |19 PB7 SCK
|
||||
; TXD PD1 3| |18 PB6 MISO
|
||||
; PA1 4| |17 PB5 MOSI
|
||||
; PA0 5| |16 PB4 OC1B
|
||||
; PD2 6| |15 PB3 OC1A
|
||||
; PD3 7| |14 PB2 OC0A
|
||||
; PD4 8| |13 PB1 AIN1
|
||||
; OC0B PD5 9| |12 PB0 AIN0
|
||||
; GND 10| |11 PD6
|
||||
; +----+
|
||||
;* ******************************************************** */
|
||||
|
||||
; Define processor type on top of the source code
|
||||
;
|
||||
.DEVICE ATtiny2313A
|
||||
|
||||
; Int-Vector area
|
||||
.CSEG
|
||||
.ORG $0000
|
||||
rjmp Setup ; for all types
|
||||
reti ; External Int0 Vector, not used
|
||||
reti ; External Int1 Vector, not used
|
||||
reti ; Timer Tim1_Capt, not used
|
||||
reti ; Timer Tim1_CompA, not used
|
||||
reti ; Timer Tim1_Ovf, not used
|
||||
reti ; Timer Tim0_Ovf, used
|
||||
reti ; Usart_RXC, not used
|
||||
reti ; Usart_dre, not used
|
||||
reti ; Usart_TXC, not used
|
||||
reti ; ANA_COMP ; Analog Comparator Handler
|
||||
reti ; PCINT ; Pin Change Interrupt
|
||||
reti ; TIMER1_COMPB ; Timer1 Compare B Handler
|
||||
reti ; TIMER0_COMPA ; Timer0 Compare A Handler
|
||||
reti ; TIMER0_COMPB ; Timer0 Compare B Handler
|
||||
reti ; USI_START ; USI Start Handler
|
||||
reti ; USI_OVERFLOW ; USI Overflow Handler
|
||||
reti ; EE_READY ; EEPROM Ready Handler
|
||||
reti ; WDT_OVERFLOW ; Watchdog Overflow Handler
|
||||
|
||||
Setup:
|
||||
cli ; Disable Interrupts
|
||||
ldi r16, low(RAMEND)
|
||||
out SPL,r16 ;Set Stack Pointer to top of RAM
|
||||
Main:
|
||||
rjmp Main ; infinite loop
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user