AnsweredAssumed Answered

Generic F103 board & the proverbial Blink

Question asked by fairchild.eddie on Jun 16, 2016
Latest reply on Jun 17, 2016 by fairchild.eddie
Howdy all! 

So i have purchased a generic ebay f103 with the yellow headers, you know the one.
I have worked with Atmel Arm based chips before, no ASF just register access. 

I cannot seem to get the LED on PC13 to blink, i can get it on but it stays on and ignores values set on ODR and BRR in other words it does NOT go off once on, in fact it tunrs on by simply setting the OUTPUT PUSH PULL bits withouth me every setting output high on ODR or BSRR

Furthermore i have tried STD_PERIPH implemintation and those dont even turn the led on. I have tried CUBEMX's verbose version of the code and that does not even turn it on, atleast with my code it goes on just not off

On a side note, i have an f303 discovery board jumping through hoops but this f103 sucker is not cooperating

#include "stm32f10x.h"
 
int main ()
{
 
    SystemInit();
     
    //below code turns the led on without me setting output high on the odr or bssr
    RCC->APB2ENR |= 1<<4;
    GPIOC->CRH |= 00<<22;
    GPIOC->CRH |=  10<<20;
     
    //Has not effect LED stays on
    GPIOC->BSRR = 1<<29;
    GPIOC->BRR = 1<<13;
    GPIOC->ODR &=~(1<<13);
     
     
     
}

Outcomes