BEE-9D ESD Lab 1
BEE-9D ESD Lab 1
(This lab report is submitted alone due to a late group formation. A group will be formed for
the next coming labs)
Introduction:
Development for embedded system engineers has never been about coming up with pieces
but an end-to-end solution. For this purpose, all the parties at stake need to be considered and
referred to throughout the development phase. One mode of communication with entities at
each layer is documentation which is already well-versed for famous microcontrollers. In
case of an embedded system design with STM32F4 microcontroller, following
documentations need to be frequently referred to:
• STM32F429ZI Discovery Kit User Manual (UM1670)
• STM32F4xxxx Application Developer Reference Manual (RM0090)
• ARMv7-M Architecture Reference Manual
Objectives:
The purpose of this lab is to:
1. Setup IAR Embedded Workbench for programming STM32F429I Discovery Board.
2. Translate 8 bit 8051 concepts to 32-bit ARM processor; particularly:
• GPIOs • Timers • Interrupts
3. Design an optimized embedded system through Embedded C using microcontrollers.
Task 1:
#include "stm32f4xx.h"
/* Function prototypes */
int main(void);
void delay(uint32_t);
int main(void)
{
/* Enable clock for GPIOG */
RCC->AHB1ENR |= 1 << 6;
while(1)
{
delay(10000000);
GPIOG->ODR ^= (1 << 13) | (1 << 14); // Toggle LED
}
void delay(uint32_t s)
{
for(s; s>0; s--){
asm("NOP");
}
}
Output:
Task 2:
#include "stm32f4xx.h"
/* Function prototypes */
int main(void);
void delay(uint32_t);
int main(void)
{
/* Enable clock for
* - GPIO Port G
* - GPIO Port A
*/
RCC->AHB1ENR |= 1 << 6 | 1 << 0;
while(1)
{
delay(10000000);
GPIOG->ODR ^= (1 << 13); // Toggle LED
if (GPIOA->IDR & 0x00000001) // Toggle for Button Press
GPIOG->ODR ^= (1 << 14);
}
void delay(uint32_t s)
{
for(s; s>0; s--){
asm("NOP");
}
}
Output:
The green LED is on continuously while the red one toggles when the button is pressed.
CONCLUSION:
In this lab, we learned how an ARM based MCU works and we learned about IAR Embedded
Workbench environment which is used by most industries.