STM32 USART Receive Binary Number

by cath001   Last Updated October 03, 2018 10:25 AM

I'm new to embedded systems so apologies if this is a stupid question.

I am trying to implement a binary counter in the form of 8 LED's. I want to send an 8-bit binary number through USART and have the 8 LED's display the number (led off if bit is 0, led on when bit is 1).

What would be the best method to do this?

Thanks in advance :)

Tags : stm32 c uart

Answers 1

The component you need for this is an shift register. Most shift registers work with SPI communication instead of USART. I'm not familiar with USART shift registers. A popular model shift register is the 74hc595. There are a lot of examples online for this shift register for different microcontrollers available.

Another method you could use is to use just 8 GPIO pins to control your LEDS. If you use this method, be sure that you're not drawing to much current from the GPIO pins. To prevent drawing to much current use a transistor as switch for example the bc547. There are also many examples online for this.

Matthijs Huisman
Matthijs Huisman
October 03, 2018 10:15 AM

Related Questions

STM32 USART Rx Interrupts

Updated April 19, 2017 15:25 PM

Restart Rx USART + DMA in STM32L1

Updated July 27, 2015 13:10 PM

STM32F107 SPI -> UART maximal transfer rate

Updated June 08, 2016 08:10 AM

STM32 USART Protocol

Updated November 03, 2018 21:25 PM