Steps for Interfacing
1.Open Keil software ->project->New uVisionProject.
2.Check the following options as shown and click on OK.
3.Type stm32f407vgtx in search bar click on OK
4. On the left panel right click on source group and click on add new item as shown.
5. Click on C file and give a name and click on OK.
6.Write the following code in the writing are and save it and also connect the Microcontroller to the pc.
C
#include "stm32f4xx.h" void delay ( int n); int main( void ) { RCC->AHB1ENR |=8; //enable clock to GPIOD GPIOD->MODER |=0X55000000; //set pin to output mode while (1) { GPIOD->ODR ^=0X0000F000; // turn on all LED's delay(300); } } void delay( int n){ int i,j; for (j=0;j<n;j++) for (i=0;i<3195;i++); //16MHz System Clock } |
7. Now again in left panel right click on Target and select options for Target.
8. Go to Target tab and choose V6.19 in ARM compiler.
9.Now to to Debug tab Use-> ST-Link Debugger. And click on settings.
10.Go to Flash Download -> Check Reset and run. Click on OK in all.
11. Press ctrl + s to save. Build the project and verify. i.e click on first three options one by one after each gets completed without any error. And click on load.
You can see the internal LED Blinking on the microcontroller.
Blink LED in Arm Cortex Microcontroller using Keil software
The ARM Cortex-M4 is a 32-bit processor core that is widely used in microcontrollers for embedded systems. It is designed to be highly efficient, and low-cost. The Cortex-M4 architecture is based on the ARMv7 instruction set architecture and It’s capable of handling up to 4GB of memory address space.
In this tutorial, we will demonstrate how to blink the inbuilt LED of an ARM Cortex M4 microcontroller using the Keil software and the C programming language.
Table of Content
- Required Software and Hardware
- About Keil Software
- STM32F407xx MicroController
- Circuit Diagram
- Steps for Interfacing