Next Generation Emulation banner
1 - 1 of 1 Posts

·
Registered
Joined
·
2 Posts
Discussion Starter · #1 ·
Hello, everyone!

I am trying to get a standard linking led program running on my STM8S103F3P6 development board but I am not sure what I am doing wrong. I connected a LED to PIN D3, this is my code:

#include <stm8s. h>

void

delay_ ms (uint16. _t ms) ;

void

delay_ _ms(uint16 _t ms) {

while

(ms- -) {

uint16_ t i;

for

(i = 0:i< ms; i++){

nop () ;

}

}

}

main()

{

GPI0D- >DDR |=0x03;

//PD3 as Output

GPI0D- >CR1 |=0x03:

//PD3 as Push Pull

while

GPI0D- >0DR|=(1<<3) :

//turn PD3 on

de1ay_ ms (1000):

GPI0D->0DR&=' ~ (1<<3) ;

//turn PD3 off

delay_ ms (1000) :

}

}

Thanks.
 
1 - 1 of 1 Posts
Top