GS MCU03 GPIO LED Lamp

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

Example GPIO

LED Lamp

1
1 Downloading Design Model ST
USB MCU
Link
BOARD
PC
2 Data Communication STM32F4
MATLAB
Discovery
& Simulink
USB to UART TX TX
USB UART
(TTL) RX RX
ADC PIN
Water-Level
Sensor DC Voltage
Provided
SigGen by Board
Signal Capture
Data Acquisition

2
Case 1: Counter-Controlled Turn ON

Counter Block

2. Double Click

1. Click & Drag it to


Simulink Window

3. Set “3”

4. Set “1”

5. Click

3
4. Set “==”
1. Click 5. Set “0”

6. Click

7. Repeat !!!
3. Double Click
2. Click & Drag (4 times) (All blocks) Set “1”

Set “2”

Set “3”

4
Port(A,B,C,D,E,H)
• Only ports and pins that are
available on the selected target
MCU are shown/enabled.

8. Click
Pin Type(Push-Pull, Open-
Drain)

9. Click & Drag

Pin(1,2,3,…)
11. Check & Select • Only ports and pins that are
available on the selected target
10. Double click
MCU are shown/enabled.

12. Click

5
15. Connect the MCU Board to PC & Build Model

Power

13. Make
Connections

On, but no blink

16. Click for


Build Model

14. Now save and check the file !!!

6
On Compile & Downloading

If no errors in this process, MCU board is working as follows:

4 LEDs are ON
one by one !!!

7
Case 2: Button to Turn ON

4. Click

5. Set “0.001”

1.Click 6. Click

2. Click & Drag

3. Double
Click 7. Double 8. Check
Click

9. Click

8
3. Click to build

1. Make Connection

4. Click
2. Connection of USB Cable to PC

Power
Press Blue Button,
LEDs are ON !!!

On, but no blink

Up to now, no LED ON !!!

You might also like