AnsweredAssumed Answered

STM8S Discovery - blink led1

Question asked by tuxd3v on Mar 9, 2015
Hi guys,

I am trying to understand the ports of stm8s105c6..
I want to blink the led1 of the board on port PD0..

For what I understand I need to configure PD0 as Output, and after, drive current to the logic on front of portD0, configuring it as push pull low...

I don't like to mess with STD Libraries for now, so,

// Configure pins
PD_DDR = 0x01;//output
PD_CR1 = 0x01;//push-pull
PD_CR2 &= 0xfe;//Speed of port configured to max 2MHz
// Loop
do {
    PD_ODR ^= 0x01;
    for(d = 0; d < 29000; d++) {//nothing to do, only burning cycles :S
}
} while(1);


it seems that I have configured it to output push pull...but How to configure push pull low?

By push Pull low, you mean PD_ODR = 0x01, and by high PD_ODR = 0x00 ??

thanks in advnce.

regards
tux

Outcomes