sathishramachandhiran / EXPERIMENT--02-INTEFACING-A-DIGITAL-INPUT-TO-ARM-DEVELOPMENT-BOARD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Name : SATHISH R
Roll no : 212222100048

EXPERIMENT--02-INTEFACING-A-DIGITAL-INPUT-TO-ARM-DEVELOPMENT-BOARD

Aim: To Interface a Digital Input (userpush button ) to ARM development board and write a program to obtain the data and flash the led

Components required: STM32 CUBE IDE, ARM IOT development board, STM programmer tool.

Theory

The full form of an ARM is an advanced reduced instruction set computer (RISC) machine, and it is a 32-bit processor architecture expanded by ARM holdings. The applications of an ARM processor include several microcontrollers as well as processors. The architecture of an ARM processor was licensed by many corporations for designing ARM processor-based SoC products and CPUs. This allows the corporations to manufacture their products using ARM architecture. Likewise, all main semiconductor companies will make ARM-based SOCs such as Samsung, Atmel, TI etc.

Procedure:

  1. click on STM 32 CUBE IDE, the following screen will appear image

  2. click on FILE, click on new stm 32 project image image

  3. select the target to be programmed as shown below and click on next

image

4.select the program name image

  1. corresponding ioc file will be generated automatically image

6.select the appropriate pins as gipo, in or out, USART or required options and configure image image

7.click on cntrl+S , automaticall C program will be generated image image 8. edit the program and as per required image

  1. use project and build all image

  2. once the project is bulild image

  3. click on debug option image

  4. connect the ARM board to power supply and usb

  5. check for execution of the output using run option

STM 32 CUBE PROGRAM :

DEVELOPED BY : SATHISH R
REG NO : 212222100048

#include "main.h"
#include "stdbool.h"
bool button_status;
void push_button();

void SystemClock_Config(void);
static void MX_GPIO_Init(void);

int main(void)
{
  HAL_Init();
  SystemClock_Config();
  MX_GPIO_Init();
  
  while (1)
  {
	   push_button();
  }
}

void push_button()
{
	button_status = HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13);
	if(button_status == 0)
	{
		 HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
		 HAL_Delay(1000);
		 HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
		 HAL_Delay(1000);
	}
 else
 {
	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
 }
}

Output :

LED-OFF:

OUT

LED-ON:

OUT

Result :

Thus,Interfacing a digital Input (Pushbutton ) with ARM microcontroller based IOT development is executed and the results are verified.

About