Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/models.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,33 @@ model_info models[] = {
".EQU P13, 7 \n"

".EQU _ms_stack, __stack\n"
},
{
"ATmega32",

"atmega32",
"avrispmkii",
"115200",

false,

// diagnostic output is PORTC7
".EQU PORT13, 0x15 \n"
".EQU DDR13, 0x14 \n"
".EQU P13, 7 \n"

".EQU _ms_stack, __stack\n"

".EQU UDR0, 0x2C \n"
".EQU UBRR0H, 0x40 \n"
".EQU UBRR0L, 0x29 \n"
".EQU UCSR0B, 0x2A \n"
".EQU UCSR0A, 0x2B \n"
".EQU TXEN0, 3 \n"
".EQU RXEN0, 4 \n"
".EQU UDRE0, 5 \n"
".EQU TXC0, 6 \n"
".EQU RXC0, 7 \n"
}
};

Expand Down
12 changes: 12 additions & 0 deletions src/stdlib.ms
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@
(define arduino-ports)
(define arduino-pins)

;; A = #x39, B = #x36, C = #x33, D = #x30
(@if-model "ATmega32"
(begin
(set! arduino-ports (vector #x39 #x39 #x39 #x39 #x39 #x39 #x39 #x39
#x36 #x36 #x36 #x36 #x36 #x36 #x36 #x36
#x33 #x33 #x33 #x33 #x33 #x33 #x33 #x33
#x30 #x30 #x30 #x30 #x30 #x30 #x30 #x30))
(set! arduino-pins (vector 1 2 4 8 16 32 64 128
1 2 4 8 16 32 64 128
1 2 4 8 16 32 64 128
1 2 4 8 16 32 64 128))))

(@if-model "MEGA"
(begin
(set! arduino-ports (vector #x2C #x2C #x2C #x2C #x32 #x2C #x100 #x100
Expand Down