cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO

morykeys
Associate II
Posted on September 15, 2013 at 17:55

hello 

i wanna build a project in keil that is a blinker actually a wanna set and reset GPIOA pins 

which registers i should adjust ?

my program is:

#define STM32F10X_CL

#include <stm32f10x.h>

int main(){

int i=0;

RCC->APB2ENR=0x1c;

GPIOA->CRL=0x22222222;

GPIOA->CRH=0x22222222; 

 while(1)

 {

  GPIOA->ODR = 0x0000ffff;

  for(i=0;i<500000;i++);

  GPIOA->ODR = 0x00005555;

  for(i=0;i<700000;i++); 

  }

}

thanks 
1 REPLY 1
Posted on September 15, 2013 at 18:37

For register level programming you'll want to avail yourself of the Reference Manual

You might want you try the firmware library and it's examples.

Also be cautious about configuring all of Bank A to GPIO, because presumably you have a debugger either JTAG or SWD reliant on some of those pins.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..