Hello Erich,

Am 09.10.2013 07:43, schrieb Erich Waelde:
> Hello,
>
>> But there are much errors for the ATMega32:
>>
>> @/srv/test/amforth-5.1/appl/template$ make template.hex
>> wine ../../Atmel/avrasm2.exe -I ../../Atmel/Appnotes -I ../../core
>> -I ../../core/devices/atmega32 -fI -v0 -e template.eep.hex -l
>> template.lst template.asm
>> err:winedevice:ServiceMain driver L"IOPort" failed to load
>> ../../core\drivers/usart_0.asm(1): error: Undefined symbol: UBRR0L
>> ../../core\drivers/usart_0.asm(2): error: Undefined symbol: UBRR0H
>> ../../core\drivers/usart_0.asm(3): error: Undefined symbol: UCSR0C
>> ../../core\drivers/usart_0.asm(4): error: Undefined symbol: UCSR0B
>> ../../core\drivers/usart_0.asm(5): error: Undefined symbol: UCSR0A
>> ../../core\drivers/usart_0.asm(12): error: Undefined symbol: RXC0
>> ../../core\drivers/usart_0.asm(13): error: Undefined symbol: UDRE0
>> ../../core\drivers/usart_0.asm(14): error: Undefined symbol: TXEN0
>> ../../core\drivers/usart_0.asm(15): error: Undefined symbol: RXEN0
>> ../../core\drivers/usart_0.asm(16): error: Undefined symbol: RXCIE0
>> ../../core\drivers/usart_0.asm(17): error: Undefined symbol: UDRIE0
>>
>> Assembly failed, 11 errors, 12 warnings
>> make: *** [template.hex] Fehler 1
> For the atmega32 you need to edit one line
> in template.asm
>
>   ; define which usart to use.
> -.include "drivers/usart_0.asm"
> +.include "drivers/usart.asm"
>
> I assume you use the latest amForth (5.1 or trunk). In older versions
> the following lines were added:
>   ; Baud settings
>   .equ BAUD = 115200
>   ; additional .equs for "old fashioned" mcu with usart, not usart0
> +.equ TXEN0  = TXEN
> +.equ RXEN0  = RXEN
> +.equ RXCIE0 = RXCIE
> +.equ UCSZ00 = UCSZ0
>
> atmega32 is a member of the older atmega family, there are more, which
> need this change (usart instead of usart_0).
>
> Good luck,
> Erich
>

this works - thank you! :-)

At this moment i am sceptical about the produced code, because after converting 
hex to bin
i get 30447 bytes with a big block of FF in the middle ?

When i disassemble the bin there are much invalide opcodes.

; Referenced from offset 0x34 by jmp
Label1:
   64:   [2  ] af 93           push    r26
   66:   [1  ] af b7           in      r26, SREG
   68:   [2  ] af 93           push    r26
   6a:   [2  ] bf 93           push    r27
   6c:   [2  ] ef 93           push    r30
   6e:   [2  ] ff 93           push    r31
   70:   [2  ] b0 91 2c 00     lds     0x002c, r27
   74:   [2  ] a0 91 60 00     lds     0x0060, r26
   78:   [1  ] e2 e6           ldi     r30, 0x62       ; 98
   7a:   [1  ] f0 e0           ldi     r31, 0x00       ; 0
   7c:   [1  ] ea 0f           add     r30, r26
   7e:   [1  ] f3 1d           adc     r31, r3
   80:   [2  ] b0 83           st      Z, r27
   82:   [1  ] a3 95           inc     r26
   84:   [1  ] af 70           cbr     r26, 0xf0       ; 240
   86:   [2  ] a0 93 60 00     sts     0x0060, r26
   8a:   [2  ] ff 91           pop     r31
   8c:   [2  ] ef 91           pop     r30
   8e:   [2  ] bf 91           pop     r27
   90:   [2  ] af 91           pop     r26
   92:   [1  ] af bf           out     SREG, r26
   94:   [2  ] af 91           pop     r26
   96:   [4  ] 18 95           reti
   98:   [1  ] 00 38           cpi     r16, 0x80       ; 128
   9a:   [1  ] 39 39           cpi     r19, 0x99       ; 153
   9c:   [1  ] 37 38           cpi     r19, 0x87       ; 135
.word 0x0060    ; Invalid opcode at 0x009e (158). Disassembler skipped two 
bytes.
   a0:   [1  ] 78 38           cpi     r23, 0x88       ; 136
   a2:   [1  ] 1a 38           cpi     r17, 0x8a       ; 138
   a4:   [1-3] 06 ff           sbrs    r16, 6          ; 0x40 = 64
   a6:   [1  ] 72 78           andi    r23, 0x82       ; 130
   a8:   [1  ] 2d 69           ori     r18, 0x9d       ; 157
   aa:   [1  ] 73 72           andi    r23, 0x23       ; 35
   ac:   [1  ] 00 00           nop
   ae:   [1  ] 00 38           cpi     r16, 0x80       ; 128
.word 0x0071    ; Invalid opcode at 0x00b0 (176). Disassembler skipped two 
bytes.
   b2:   [1  ] 30 38           cpi     r19, 0x80       ; 128
.word 0x0058    ; Invalid opcode at 0x00b4 (180). Disassembler skipped two 
bytes.
   b6:   [1  ] 37 38           cpi     r19, 0x87       ; 135
.word 0x0061    ; Invalid opcode at 0x00b8 (184). Disassembler skipped two 
bytes.
   ba:   [1  ] 8f 38           cpi     r24, 0x8f       ; 143
   bc:   [1  ] a8 38           cpi     r26, 0x88       ; 136
   be:   [1  ] 32 3a           cpi     r19, 0xa2       ; 162
   c0:   [1  ] 37 38           cpi     r19, 0x87       ; 135
.word 0x000f    ; Invalid opcode at 0x00c2 (194). Disassembler skipped two 
bytes.
   c4:   [1  ] 16 3a           cpi     r17, 0xa6       ; 166
   c6:   [1  ] 37 38           cpi     r19, 0x87       ; 135
.word 0x0061    ; Invalid opcode at 0x00c8 (200). Disassembler skipped two 
bytes.
   ca:   [1  ] 84 38           cpi     r24, 0x84       ; 132
   cc:   [1  ] 37 38           cpi     r19, 0x87       ; 135
.word 0x0062    ; Invalid opcode at 0x00ce (206). Disassembler skipped two 
bytes.
   d0:   [1  ] a0 39           cpi     r26, 0x90       ; 144
   d2:   [1  ] 8f 38           cpi     r24, 0x8f       ; 143
   d4:   [1  ] 1a 38           cpi     r17, 0x8a       ; 138
   d6:   [1-3] 07 ff           sbrs    r16, 7          ; 0x80 = 128
   d8:   [1  ] 72 78           andi    r23, 0x82       ; 130
   da:   [1  ] 3f 2d           mov     r19, r15
   dc:   [1  ] 69 73           cbr     r22, 0xc6       ; 198
.word 0x0072    ; Invalid opcode at 0x00de (222). Disassembler skipped two 
bytes.
.word 0x0052    ; Invalid opcode at 0x00e0 (224). Disassembler skipped two 
bytes.
   e2:   [1  ] 00 38           cpi     r16, 0x80       ; 128
   e4:   [1  ] ac 06           cpc     r10, r28
   e6:   [1  ] 37 38           cpi     r19, 0x87       ; 135
.word 0x0061    ; Invalid opcode at 0x00e8 (232). Disassembler skipped two 
bytes.
   ea:   [1  ] 8f 38           cpi     r24, 0x8f       ; 143
   ec:   [1  ] 37 38           cpi     r19, 0x87       ; 135
.word 0x0060    ; Invalid opcode at 0x00ee (238). Disassembler skipped two 
bytes.
   f0:   [1  ] 8f 38           cpi     r24, 0x8f       ; 143
   f2:   [1  ] 03 39           cpi     r16, 0x93       ; 147
   f4:   [1  ] 1a 38           cpi     r17, 0x8a       ; 138
   f6:   [1-3] 07 ff           sbrs    r16, 7          ; 0x80 = 128
   f8:   [1  ] 74 78           andi    r23, 0x84       ; 132
   fa:   [1  ] 2d 70           andi    r18, 0x0d       ; 13
   fc:   [1  ] 6f 6c           ori     r22, 0xcf       ; 207
...

But i will program it and will see if it works ...

Best regards
Karsten

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to