0% found this document useful (0 votes)
13 views2 pages

STM7SEG

The document is a C program for the STM32F407 microcontroller that initializes GPIO ports A and C for output. It continuously displays a series of hexadecimal values on the GPIO pins using a display function, with a delay implemented to control the timing. The program sets up the necessary registers for the GPIO configuration and enters an infinite loop to repeatedly call the display function.

Uploaded by

23112196
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

STM7SEG

The document is a C program for the STM32F407 microcontroller that initializes GPIO ports A and C for output. It continuously displays a series of hexadecimal values on the GPIO pins using a display function, with a delay implemented to control the timing. The program sets up the necessary registers for the GPIO configuration and enters an infinite loop to repeatedly call the display function.

Uploaded by

23112196
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

#include <stm32f407xx.

h>

void Delay(unsigned int i);

void display(unsigned char byte);

int main(void)

RCC->AHB1ENR|= 0x05;

GPIOA-> MODER |= 0x00005555;

GPIOA->OTYPER |= 0;

GPIOA->OSPEEDR |= 0;

GPIOA->PUPDR |= 0;

GPIOC-> MODER |= 0x00000055;

GPIOC->OTYPER |= 0;

GPIOC->OSPEEDR |= 0;

GPIOC->PUPDR |= 0;

GPIOC->BSRR =(1<<0)|(1<<1)|(1<<2)|(1<<3);

while(1)

display(0xC0);

display(0xF9);

display(0xA4);

display(0xB0);

display(0x99);

display(0x92);

display(0x82);

display(0xF8);

display(0x80);
display(0x90);

display(0x88);

display(0x83);

display(0xC6);

display(0xA1);

display(0x86);

display(0x8E);

void display(unsigned char byte)

GPIOA->ODR = byte;

Delay(1000);

void Delay(unsigned int t)

unsigned int i,j;

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

for(j=0;j<2000;j++);

You might also like