Skip to content

Mahmoud-Ismail98/NTI-EMBEDDED-SYSTEM-4-MONTHS-INTERFACE-TASKS

Repository files navigation

NTI EMBEDDED SYSTEM 4 MONTHS TASK

TASKS under supervise ENG/MAHMOUD-ELIMBABI

TASK1 SEVEN SEGMENT COUNTER TASK

TASK Features:

  1. four seven segment able to count from 0 to 9999
  2. external push putton when pressed number pn seven segment increased by 1 with each putton pressed until reash to 9999

task1 simulation on Proteus

seven_segment_counter_task.mp4

TASK2 FOUR SEVEN SEGMENT STOP WATCH

TASK features

  1. four seven segment able to count from 0 to 9999
  2. there are three push putton control the stow watch

    a. start button start count until clear or stop putton pressed

    b. stop button is stop count on seven segment

    c. clear button is clear the counter on stop watch to zero

task2 simulation on Proteus

seven_segment_Stop_watch.task.mp4

TASK3 LCD RUNNING BOY TASK

TASK Features:

there are three object face a boy hole ,ramp and wall and there are three senatio faced aboy

  1. if aboy found ahole in the raw he dropped from ahole to next raw
  2. if aboy faced a ramp and above the ramp there is ahole he jump through the ramp and the hole to upper raw
  3. if aboy faced the wall and there is no holes or ramp on his way he crashed and the game end and print game over on lcd

task3 simulation on Proteus

LCD_running.boy.task.mp4

TASK4 ADC SHOW VOLT LCD

TASK Features:

  1. analog to digital converter sense the analog volt from 0 to 5 volt
  2. lcd that show the voltage in volt or mvolt
  3. push putton control the showing value in volt or mvolt on lcd

task4 simulation on Proteus

ADC.with.lcd.show.voltage.task.mp4

TASK5 ADC volume show lcd

TASK Features:

  1. potenshowmeter to control the required volume
  2. analog to digital converter sense the range of value indicated to the required volume
  3. lcd show the indicated volume

task5 simulation on Proteus

ADC.volume.show.lcd.mp4

task6 Calculator program that supports 4 operations (+,-,*,/)

TASK Features:

  1. The program starts with initializing the LCD and keypad and initializing the calculator to start accepting inputs for the first operand

  2. Every operand can consist of 5 digits and have a maximum of 65,535 because the variable is an unsigned 16-bit integer

  3. The program doesn't support floats or negative values. If you make a subtraction operation, the program checks which operand is bigger and calculates the difference between them, avoiding negative values

task6 simulation on Proteus

calculator.task.mp4

TASK7 ALARM WITH SELECTED TIME

task7 simulation on Proteus

TASK7.ALARM.WITH.SELECTED.TIME.mp4

TASK8 STOP WATCH ON LCD

task8 simulation on Proteus

TASK8.STOP.WATCH.USING.TIMER.mp4

STM32F401_DRIVERS_TEST_ON_KEIL

1)Reset and clock control (RCC) peripheral

is used to control the internal peripherals, as well as the reset signals and clock distribution. The RCC gets several internal (LSI, HSI and CSI) and external (LSE and HSE) clocks. They are used as clock sources for the hardware blocks, either directly or indirectly, via the PLL that allow to achieve high frequencies. There are three

clock sources can be used to drive the system clock

  1. HSI oscillator clock
  2. HSE oscillator clock
  3. PLL clock

the RCC function debuging on keil

1.Rcc_enuSelectSysCLk(RCC_CLK_HSE,RCC_HSI_disable);

a. first argument enable selected clock through RCC clock control register (RCC_CR) and configuar th first argument as the system clock through (RCC_CFGR)
b.second argumen disable selected clock through RCC clock control register (RCC_CR) 

select clock fun

2.Rcc_enuCheckCLk(RCC_CLK_HSE,&check_clk_on_flag);

a.this function check if passed clock in argument is enabled or not if enabled return 1 in check_clk_on_flag argument and vise versa

check clock

3.Rcc_enuControlCLk(RCC_CNTROL_HSION,RCC_CNTROL_HSEON,RCC_CNTROL_PLLON);

a.enable clock through RCC clock control register (RCC_CR) for HEI,HSE and PLL  but not configuar the system clock

control HSE-HSI-PLL on off fun

4.Rcc_enuCnfgrPll(u8 COPY_u8M , u16 Copy_u16N , u8 Copy_u8P , u8 Copy_u8SrcPll , u8 Copy_u8Q);

Rcc_enuCnfgrPll(8,192,1,0,0);

this function set system clock as 81MHZ not exceeded max freq 84MHZ

PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N 	
COPY_u8M=16 : PLL_M division to 16 to get the comparison frequency1 MHz 
Copy_u16N =192   PLL_N 192*1MHZ (192),
Copy_u8SrcPll=0 ---0: HSI clock selected as PLL
SYSCLK = PLL_VCO / PLL_P 	
Copy_u8P=1 (VCO/ PLLP(2))

Screenshot_30

5.Rcc_enuEnablePeriphral(RCC_REGISTER_AHB1 , AHB1_GPIOA_EN);

this function enable clock on selected bus in the first argument
and the preioheral we want enable clock on it in the second argument 

enable prephieral clock fun

6.Rcc_enuDiablePeriphral(RCC_REGISTER_AHB1 , AHB1_GPIOA_EN);

this function disable clock on selected bus in the first argument
and the preioheral we want disable clock on it in the second argument

Screenshot_31

7.Rcc_enuCfgBusPrescalers(RCC_AHB_DIV4);

The clocks are divided with the new prescaler factor from 1 to 16 AHB cycles after HPRE write.

Screenshot_33

2)the general-purpose I/O ports(GPIO)

is a pin on an IC (Integrated Circuit). It can be used for driving loads, reading digital and analog signals, controlling external components, generating triggers for external devices etc. Each of the general-purpose I/O ports has two 32-bit configuration registers, two 32-bit data registers, a 32-bit set/reset register , a 16-bit reset register and a 32-bit locking register.

Input floating

Input pull-up

Input-pull-down Analog

Output open-drain

Output push-pull

Alternate function push-pull

Alternate function open-drain

the GPIO function debuging on keil

1.Gpio_init(&led_configuraion);

GpioPinCfg_t led_configuraion={GPIO_MODE_u64_OUTPUT_PP,GPIO_PUPD_u32_FLOATING,GPIO_SPEED_LOW,GPIO_PIN_01,GPIO_PORT_B};

Screenshot_39

2.Gpio_setPinValue(&led_configuraion,GPIO_ODR_HIGH);

Screenshot_36

Screenshot_38

3.Gpio_readPinValue(&led_configuraion,&PIN_STATUS);

GpioPinCfg_t led_configuraion={GPIO_MODE_u64_INPUT,GPIO_PUPD_u32_PULL_UP,GPIO_SPEED_MEDIUM,GPIO_PIN_00,GPIO_PORT_B};

when i set pin1 in portB as input pullup we notice the regesters are changed except IDR that suppose it deected high as he connected on pullup but the regester value and passed argument not channged i thought that KEIL no support directly changed in hardware pullup input mode

Screenshot_40

3)SysTick timer (STK)

SysTick is a simple timer that is part of the NVIC controller in the Cortex-M microprocessor. Its intended purpose is to provide a periodic interrupt

the SysTick function debuging on keil

The systick a 24-bit system timer, SysTick, that counts down from the reload value to zero, reloads the value in the STK_LOAD register on the next clock edge, then counts down on subsequent clocks

Screenshot_46

1.Systick_Init(1000);

working on AHP/8 prescaller so we need cont 2000 to reach 1 ms so i made counter for COUNTER_MS variable that every ISR for SYSTICK decressed and when this var reach to zero that mean reach the required
ms timing and we can take action  

Screenshot_47

2.Systick_Start();

Enables the counter. When ENABLE the counter loads the RELOAD value from the LOAD register and then counts down. On reaching 0, it sets the COUNTFLAG to 1 and optionally asserts the SysTick depending on the value of TICKINT. It then loads the RELOAD
value again, and begins counting.

Screenshot_48

3.Systick_RegisterCbf(ISR_SYSTICK);

ISR_SYSTICK is excuted after COUNTER_MS reached to zero after excuted the output pin2 in PORTB become HIGH 

Screenshot_49

Screenshot_50

4.void SysTick_Handler (void)

tacking another action when  COUNTER_MS become zero and after excuted the callBack function i   Disable STK Interrupt  and Stop Timer 

Screenshot_52

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published