cancel
Showing results for 
Search instead for 
Did you mean: 

PA4 and PA5 don't work STM8S208RB

MykolaLevun
Associate III

Hello,

STM8S208RB microcontroller. Pins PA4 and PA5 do not work in push-pull mode. Why? I haven't tried it in other modes. It's not a microcontroller issue because I tested it on two different microcontrollers. Pins are shown in the datasheet (see figure bellow).

MykolaLevun_0-1711293982148.png

I tested the robotic functionality using this code:
main()
{
    PA_DDR = 0b01111110;
    PA_CR1 = 0b01111110;
    PA_CR2 = 0b00000000;
    PA_ODR = 0b00000000;
    while (1)
    {
        delay_miles(2000);
        PA_ODR = 0b01111110;
        delay_miles(2000);
        PA_ODR = 0b00000000;
    }
}

1 ACCEPTED SOLUTION

Accepted Solutions
MykolaLevun
Associate III

The answer to why PA4 and PA5 did not work is in the UM2364 manual in section 6.8 USART communication

 (see figure below).

MykolaLevun_0-1711346879834.png

 

View solution in original post

5 REPLIES 5
AA1
Senior III

The problem is only with PA4 and PA5?

Try with other pins.

PA4 and PA5 are UART1 RX and TX pins. If UART1 is enable it controls these pins.

 

Works well with other pins. As far as I understand, after the reset the UART1 is turned off, but I didn’t turn it on in software. PA4 and PA5 are always logically 0, checked with an oscilloscope.

AA1
Senior III

Maybe bootloader is active and it left UART1 enable. Check UART1 registers or disable UART1.

 

I checked it in the debugger and UART1 is turned off. I also need to say that I am using a NUCLEO-8S208RB board.

MykolaLevun
Associate III

The answer to why PA4 and PA5 did not work is in the UM2364 manual in section 6.8 USART communication

 (see figure below).

MykolaLevun_0-1711346879834.png