2018-05-28 12:30 PM
Hi guy,
I'm new to STM32. I'm using a STM32F373. I'm just trying to use the GPIO, and turn on some LEDS that are on port C(C0,C1,C2,C3) but it does not work. Actually, my problem is with the written operation. I am not able to configure my GPIOC->ODR register to turn on only LED1 (which is on C0). I tried to use the BSRR register but I get the same result: LED2-3-4 turn on( C1,C2,C3) but the only LED I was trying to power on is off... Thanks for the help !
#include 'stm32f3xx.h' // Device header
unsigned int i;int main(void){ //AHB peripheral clock enable register, needs to be activated so that the readable values are good (used to recude power consumption) (RCC->AHBENR )= (1UL << 19); //GPIO mode register Configure desired I/o pin as out,in,analog //(GPIOC->MODER)= 0x00000031; (GPIOC->MODER)|= 0x00000055; // Reset output data register //(GPIOC->ODR) = (0x00000000);while(1)
{ // First attempt with ODR GPIOC->ODR|=0x00000001; // Second attempt with BSRR //GPIOC->BSRR=1<<0; }}2018-05-28 10:18 PM
Hello,
What is the full partnumber of the MCU you are using?
Would it be possible for you to share screenshot with GPIOC registers content after write '1' on PC0, please (including GPIOC->IDR)?
Thank you in advance,
Best Regards,
Artur
2018-05-28 10:42 PM
How are the LEDs physically connected? Any drawing?
JW
2018-05-29 01:08 AM
Or anything else connected to this GPIOs ?
I'm new to STM32. ...
STM32F3 GPIO not working properly
Seems a bit of a contradiction to me.
I always start to look at my work for mistakes.