Professional Documents
Culture Documents
Fio Board and Rapidstm32 Beginners Workshop Compress
Fio Board and Rapidstm32 Beginners Workshop Compress
Beginners Workshop
www.aimagin.com
Objective:
Use digital
output to
Log data to microSD
drive LEDs
Display status on a
character LCD
Vin = 3.3V
as follows:
R 2.2KOhm
Vsense = Vin * Rphotocell / (Rphotocell+2200)
Target Host PC
Plot Graphs
ADC CH13
= Pin C3
USB (HID)
Analog
Sensors
Voltage (0-
(Pressure, 3.3V)
Temperature
, Distances,
etc.)
3.3VDC
GND
Vsense
help rapidstm32_blockset
Night
Threshold
2VDC
Day
threshold = 2; %volts
LEDON = 1;
LEDOFF = 0;
if (vin>threshold)
cmd = LEDON;
else
cmd = LEDOFF;
end
Testing Algorithm
Target Host PC
ADC CH13
= Pin C3
USB (HID)
Threshold
Vin 2VDC
cmd
Source Files
Compiler
(*.c, *.h)
Assembly Files
(*.s)
Assembly Files
Assembler Compile
(*.s)
Object Files
(*.o)
Load/
Burn
Keil FiO /
RVMDK RapidSTM32
Assembly Files
(*.s)
Assembly Files
Assembler Compile
(*.s)
Object Files
(*.o)
Load/
Burn
Plot Graphs
Algorithm + ON/OFF
ADC CH13 = Pin C3
ADC
USB (HID)
LED
ON/OFF
cmd
Target Host
Poor Real-Time
Very Accurate Timing
Performance
Target Host
RX RX
5 2
DO DO
6 3
TX 1 4 TX
Target Host
RX RX
5 2
DO DO
6 3
TX 1 4 TX
Target Host
RX RX
5 2
DO DO
6 3
TX 1 4 TX
Target Host
RX RX
DO DO
TX TX
Force Output
Maximum 1,000
packets per second
Time Frequency
Domain Domain
+ Low frequency
Slow changing
(low frequency) component
signal component
Low Pass
Filter
High frequency
component
Plot Graphs
+ ON/OFF
ADC CH13 = Pin C3
ADC
USB (HID)
2 LEDs
ON/OFF
cmd Lowpass ON/OFF
Algorithm
FIlter
Any one???
ADC
Lowpass Lowpass
FIlter FIlter
Why do we need to
reset the target
before running
every time?
Answer on the
following slide.
Toggle LED
Display
string
Select Action
before output
characters to "Do
nothing" for none
first line display.
Do Something
No
Correct
time?
Yes
Do Something
Driving an RC Servo
Target Host PC
Drive Servo
Motor
Add a Real-Time
Block
USB (HID)
%Duty
Cycle
Display %
Duty Cycle
10deg
80deg
www.aimagin.com/learn/index.php/Advanced_"How_to
"
model_rapidstm32 folder
header1.h
source1.c
stm32f10x_hwdrvlib.c
model.h
Algorithms
model.c
www.aimagin.com/learn/index.php/Advanced_"How_to"
No Blocks
Mass Products
Rapid prototyping
http://www.aimagin.com/forum/
https://www.facebook.com/groups/fiousers/
http://www.youtube.com/rapidstm32
https://www.facebook.com/fioboard
help@aimagin.com
www.aimagin.com