Driving LEDs using GPIO and interrupt controller on STM8 Nucleo-64 development board

Publisher:VelvetSoulLatest update time:2021-11-04 Source: eefocusKeywords:STM8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The NUCLEO-8S208RB (based on STM8S208RBT6) and NUCLEO-8L152R8 (based on STM8L152R8T6) development boards can be used to evaluate the main features of all STM8S series and STM8L series microcontrollers.


This application note briefly describes how to drive a set of LED indicators using the GPIO and interrupt controller on the NUCLEO-8S208RB and NUCLEO-8L152R8 development boards.


When the microcontroller (STM8S208RBT6 or STM8L152R8T6 in this case) is powered using the USB cable connected to the host computer, the LD2 and LD5 indicators (not the onboard LEDs) start blinking. Each time the "push" button is pressed, the interrupt controller generates an interrupt for controlling the I/O, which then changes the LED display.


1. Application Description

This section describes the hardware requirements, application schematics and operating principle of driving a set of LED indicators using the GPIO and interrupt controller on the NUCLEO-8S208RB or NUCLEO-8L152R8 development board.


1.1 Hardware Requirements

Apart from the user buttons, no other on-board components are required.

The external components required by the application are listed in the following table.

Table 2. Required external hardware components

External Component
Value
Description
LD2, LD3, LD4, LD5
Standard LED
R2, R3, R4, R5
510Ω
Protection Resistor


1.2 Application Schematic

The following figure shows how to connect the LED light and button using the NUCLEO-8S208RB or NUCLEO-8S208RB development board. For a detailed description of the NUCLEO-8S208RB or NUCLEO-8L152R8 development board, please refer to the board schematics provided in the corresponding user manual (UM2351 or UM2364).


Protection resistors R2, R3, R4, and R5 must be used to limit the current to a value that does not damage the LED indicator. The push button requires a debounce filter (RC) and a pull-up resistor (R1) to avoid triggering an interrupt due to mechanical bounce of the button.

insert image description here


Keywords:STM8 Reference address:Driving LEDs using GPIO and interrupt controller on STM8 Nucleo-64 development board

Previous article:Using the STM8 Nucleo-64 development board to communicate with the terminal via RS232
Next article:Displaying variable voltage on an LED strip using the STM8 Nucleo-64 development board

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号