Hallo,
ich versuch gerade meine günstigen stm8003 Breakout Boards zu benützen.
ich hab mir jetzt ein kleines Makefile und C Programm
zustammengschustert und compilier es mit SDCC, hab aber das Problem, das
sich nichts tut.
Das ist mein Code:
1 | /* GPIO */
|
2 | #define PD_ODR *(unsigned char*)0x500F
|
3 | #define PD_IDR *(unsigned char*)0x5010
|
4 | #define PD_DDR *(unsigned char*)0x5011
|
5 | #define PD_CR1 *(unsigned char*)0x5012
|
6 | #define PD_CR2 *(unsigned char*)0x5013
|
7 |
|
8 | int main() {
|
9 | PD_DDR = 0x08;
|
10 | PD_CR1 = 0x08;
|
11 | PD_ODR = 0x08;
|
12 | while(1);
|
13 | }
|
Und mein Makefile:
1 | SDCC=sdcc
|
2 | SDLD=sdld
|
3 | TARGET=main
|
4 | .PHONY: all clean flash
|
5 |
|
6 | all: $(TARGET).hex
|
7 |
|
8 | flash: $(TARGET).hex
|
9 | stm8flash -cstlinkv2 -pstm8s003 -w $(TARGET).hex
|
10 |
|
11 | %.hex: %.c
|
12 | $(SDCC) -lstm8 -mstm8 $(CFLAGS) $(LDFLAGS) -o blinky.hex $^
|
Der Flashvorgang läuft problemlos und ich kann das ganze auch verifyen
(gibts das? Egal). Aber es gibt bei D3 keinen High Level. Ich weiß auch
der Pin nicht kaputt ist, da im Auslieferungszustand ein BLinky drauf
war.