Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Ignore whitespace Rev 492 → Rev 493

/programy/C/avr/tests/ATmega644/Makefile
0,0 → 1,63
# makefile, written by guido socher
MCU=atmega645
FILE=blik
#MCU=at90s4433
CC=avr-gcc
OBJCOPY=avr-objcopy
# optimize for size:
CFLAGS=-g -mmcu=$(MCU) -Wall -Os
#-------------------
all: $(FILE).hex
#-------------------
help:
@echo "Usage: make all|load|load_pre|rdfuses|wrfuse1mhz|wrfuse4mhz|wrfusecrystal"
@echo "Warning: you will not be able to undo wrfusecrystal unless you connect an"
@echo " external crystal! uC is dead after wrfusecrystal if you do not"
@echo " have an external crystal."
#-------------------
$(FILE).hex : $(FILE).out
$(OBJCOPY) -R .eeprom -O ihex $(FILE).out $(FILE).hex
$(FILE).out : $(FILE).o
$(CC) $(CFLAGS) -o $(FILE).out -Wl,-Map,$(FILE).map $(FILE).o
$(FILE).o : $(FILE).c
$(CC) $(CFLAGS) -Os -c $(FILE).c
#------------------
load: $(FILE).hex
./prg_load_uc $(FILE).hex
# here is a pre-compiled version in case you have trouble with
# your development environment
load_pre: $(FILE).hex
./prg_load_uc $(FILE)_pre.hex
#
loaduisp: $(FILE).hex
./prg_load_uc -u $(FILE).hex
# here is a pre-compiled version in case you have trouble with
# your development environment
load_preuisp: $(FILE)_pre.hex
./prg_load_uc -u avrm8ledtest.hex
#-------------------
# fuse byte settings:
# Atmel AVR ATmega8
# Fuse Low Byte = 0xe1 (1MHz internal), 0xe3 (4MHz internal), 0xe4 (8MHz internal)
# Fuse High Byte = 0xd9
# Factory default is 0xe1 for low byte and 0xd9 for high byte
# Check this with make rdfuses
rdfuses:
./prg_fusebit_uc -r
# use internal RC oscillator 1 Mhz
wrfuse1mhz:
./prg_fusebit_uc -w 1
# use internal RC oscillator 4 Mhz
wrfuse4mhz:
./prg_fusebit_uc -w 4
# use external 3-8 Mhz crystal
# Warning: you can not reset this to intenal unless you connect a crystal!!
wrfusecrystal:
@echo "Warning: The external crystal setting can not be changed back without a working crystal"
@echo " You have 3 seconds to abort this with crtl-c"
@sleep 3
./prg_fusebit_uc -w 0
#-------------------
clean:
rm -f *.o *.map *.out *t.hex
#-------------------
/programy/C/avr/tests/ATmega644/blik.c
0,0 → 1,76
/*********************************************
* vim: set sw=8 ts=8 si :
* Author: Guido Socher, Copyright: GPL
* This program is to test the led connected to
* PC5.
* See http://linuxfocus.org/English/November2004/
* for details.
* Chip type : ATMEGA644
* Clock frequency : Internal clock 1 Mhz (factory default)
*********************************************/
#include <avr/io.h>
#include <inttypes.h>
#define F_CPU 1000000UL // 1 MHz
#include <util/delay.h>
 
 
/* compatibilty macros for old style */
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
 
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
 
 
void delay_ms(unsigned int ms)
/* delay for a minimum of <ms> */
{
// we use a calibrated macro. This is more
// accurate and not so much compiler dependent
// as self made code.
while(ms){
_delay_ms(0.96);
ms--;
}
}
 
 
/* new style */
int main(void)
{
/* INITIALIZE */
/* enable PC5 as output */
DDRC|= (1<<DDC5);
 
/* PC5 is 5 (see file include/avr/iom8.h) and 1<<PC5 is 00100000
* This can also be written as _BV(PC5)*/
while (1) {
/* led on, pin=0 */
PORTC &= ~(1<<PC5);
delay_ms(50);
/* set output to 5V, LED off */
PORTC|= (1<<PC5);
delay_ms(50);
}
return(0);
}
 
 
// // old style now depricated:
// int main(void)
// {
// // enable PC5 as output
// sbi(DDRC,PC5);
// while (1) {
// // led on, pin=0
// cbi(PORTC,PC5);
// delay_ms(500);
// // set output to 5V, LED off
// sbi(PORTC,PC5);
// delay_ms(500);
// }
// return(0);
// }
// // end of old style
/programy/C/avr/tests/ATmega644/blik.hex
0,0 → 1,14
:100000000C942E000C9449000C9449000C94490067
:100010000C9449000C9449000C9449000C9449003C
:100020000C9449000C9449000C9449000C9449002C
:100030000C9449000C9449000C9449000C9449001C
:100040000C9449000C9449000C9449000C9449000C
:100050000C9449000C9449000C94490011241FBED3
:10006000CFEFD0E1DEBFCDBF11E0A0E0B1E0EEEC1C
:10007000F0E002C005900D92A030B107D9F711E071
:10008000A0E0B1E001C01D92A030B107E1F70C94EF
:1000900057000C9400009C0106C080EF90E001978F
:1000A000F1F72150304021153105B9F70895CFEF10
:1000B000D0E1DEBFCDBF3D9A459882E390E00E943B
:0E00C0004B00459A82E390E00E944B00F5CF82
:00000001FF
/programy/C/avr/tests/ATmega644/blik.map
0,0 → 1,329
Archive member included because of file (symbol)
 
/usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_copy_data.o)
blik.o (__do_copy_data)
/usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_clear_bss.o)
blik.o (__do_clear_bss)
 
Discarded input sections
 
.stabstr 0x00000000 0x0 /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
.stabstr 0x00000000 0x0 blik.o
 
Memory Configuration
 
Name Origin Length Attributes
text 0x00000000 0x00020000 xr
data 0x00800060 0x0000ffa0 rw !x
eeprom 0x00810000 0x00010000 rw !x
*default* 0x00000000 0xffffffff
 
Linker script and memory map
 
Address of section .data set to 0x800100
LOAD /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
LOAD blik.o
LOAD /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a
LOAD /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/libc.a
LOAD /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a
 
.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 0xce
*(.vectors)
.vectors 0x00000000 0x5c /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
0x00000000 __vectors
0x00000000 __vector_default
*(.vectors)
0x0000005c __ctors_start = .
*(.ctors)
0x0000005c __ctors_end = .
0x0000005c __dtors_start = .
*(.dtors)
0x0000005c __dtors_end = .
SORT(*)(.ctors)
SORT(*)(.dtors)
*(.progmem.gcc*)
*(.progmem*)
0x0000005c . = ALIGN (0x2)
*(.jumptables)
*(.jumptables*)
*(.lowtext)
*(.lowtext*)
*(.init0)
.init0 0x0000005c 0x0 /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
0x0000005c __init
*(.init0)
*(.init1)
*(.init1)
*(.init2)
.init2 0x0000005c 0xc /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
*(.init2)
*(.init3)
*(.init3)
*(.init4)
.init4 0x00000068 0x16 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_copy_data.o)
0x00000068 __do_copy_data
.init4 0x0000007e 0x10 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_clear_bss.o)
0x0000007e __do_clear_bss
*(.init4)
*(.init5)
*(.init5)
*(.init6)
*(.init6)
*(.init7)
*(.init7)
*(.init8)
*(.init8)
*(.init9)
.init9 0x0000008e 0x4 /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
*(.init9)
*(.text)
.text 0x00000092 0x4 /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
0x00000092 __vector_22
0x00000092 __vector_1
0x00000092 __vector_12
0x00000092 __bad_interrupt
0x00000092 __vector_6
0x00000092 __vector_3
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 0x38 blik.o
0x000000ae main
0x00000096 delay_ms
.text 0x000000ce 0x0 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_copy_data.o)
.text 0x000000ce 0x0 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_clear_bss.o)
0x000000ce . = ALIGN (0x2)
*(.text.*)
.text.libgcc 0x000000ce 0x0 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_copy_data.o)
.text.libgcc 0x000000ce 0x0 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_clear_bss.o)
0x000000ce . = ALIGN (0x2)
*(.fini9)
*(.fini9)
*(.fini8)
*(.fini8)
*(.fini7)
*(.fini7)
*(.fini6)
*(.fini6)
*(.fini5)
*(.fini5)
*(.fini4)
*(.fini4)
*(.fini3)
*(.fini3)
*(.fini2)
*(.fini2)
*(.fini1)
*(.fini1)
*(.fini0)
*(.fini0)
0x000000ce _etext = .
 
.data 0x00800100 0x0 load address 0x000000ce
0x00800100 PROVIDE (__data_start, .)
*(.data)
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
.data 0x00800100 0x0 blik.o
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_copy_data.o)
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_clear_bss.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 /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
.bss 0x00800100 0x0 blik.o
.bss 0x00800100 0x0 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_copy_data.o)
.bss 0x00800100 0x0 /usr/lib/gcc/avr/4.2.1/avr5/libgcc.a(_clear_bss.o)
*(.bss*)
*(COMMON)
0x00800100 PROVIDE (__bss_end, .)
0x000000ce __data_load_start = LOADADDR (.data)
0x000000ce __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 = .
 
.stab 0x00000000 0x738
*(.stab)
.stab 0x00000000 0x36c /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
.stab 0x0000036c 0x3cc blik.o
0x3d8 (size before relaxing)
 
.stabstr 0x00000000 0x764
*(.stabstr)
.stabstr 0x00000000 0x764 /usr/lib/gcc/avr/4.2.1/../../../../avr/lib/avr5/crtm645.o
 
.stab.excl
*(.stab.excl)
 
.stab.exclstr
*(.stab.exclstr)
 
.stab.index
*(.stab.index)
 
.stab.indexstr
*(.stab.indexstr)
 
.comment
*(.comment)
 
.debug
*(.debug)
 
.line
*(.line)
 
.debug_srcinfo
*(.debug_srcinfo)
 
.debug_sfnames
*(.debug_sfnames)
 
.debug_aranges
*(.debug_aranges)
 
.debug_pubnames
*(.debug_pubnames)
 
.debug_info
*(.debug_info)
*(.gnu.linkonce.wi.*)
 
.debug_abbrev
*(.debug_abbrev)
 
.debug_line
*(.debug_line)
 
.debug_frame
*(.debug_frame)
 
.debug_str
*(.debug_str)
 
.debug_loc
*(.debug_loc)
 
.debug_macinfo
*(.debug_macinfo)
OUTPUT(blik.out elf32-avr)
/programy/C/avr/tests/ATmega644/blik.out
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property