Skip to content

Commit f9db6e0

Browse files
author
Alexey Matveev
committed
Translate readme
1 parent e8612d8 commit f9db6e0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Description
2+
3+
Reacts to switching the joystick stick switch.
4+
5+
## Principle of work
6+
7+
The input receives a PWM signal from an RC receiver. For different stick positions there will be different duty cycle. By measuring its duration, you can determine the position of the stick and send a signal to the MC output.
8+
9+
# Hardware
10+
11+
Since my option was needed to turn on the LED backlight, I do not use external power and a powerful transistor. I also needed only one position.
12+
13+
# Firwmware
14+
15+
SDCC is used for compilation. You also need STM8S_SPL from ST - a library for working with peripherals.
16+
17+
## How to flash
18+
19+
I use stm8flash for flash.
20+
21+
First of all, you need to configure Option bytes for hardware. For capturing, the 1st channel of the 1st timer is used (Channel 1 TIM1).
22+
23+
```bash
24+
echo -ne '\x00\x00\xff\x01\xfe\x00\xff\x00\xff\x00\xff' > opt.bin
25+
stm8flash -c stlinkv2 -p stm8s103f3 -s opt -w opt.bin
26+
```
27+
28+
This line activates alternative functions of the leg we need: Port C5 alternate function = TIM2_CH1; port C6 alternate function =TIM1_CH1; port C7 alternate function = TIM1_CH2.
29+
30+
Then we are already flashing the firmware itself (firmware.bin). Here you can already use: make upload, or manually download stm8flash.
31+
32+
```bash
33+
./stm8flash -c stlinkv2 -p stm8s003f3 -w firmware.ihx
34+
```

0 commit comments

Comments
 (0)