Difference between revisions of "BLK IO"
From ElectroDragon
(→Serial Debugging) |
|||
(11 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
* Pin Definition | * Pin Definition | ||
* All pins connect to ground pin of LED | * All pins connect to ground pin of LED | ||
+ | * All commands should be end up with \r\n | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
− | ! Pin !! MCU PIN !! | + | ! Pin !! MCU PIN !! v1.1 Command !! v1.0 Command !! Note |
|- | |- | ||
− | | 1 || PB5 || 1N - 1F || | + | | 1 || PB5 || 1N - 1F || N1 - F1 || |
|- | |- | ||
− | | 2 || PB4 || 2N - 2F || | + | | 2 || PB4 || 2N - 2F || N2 - F2 || |
|- | |- | ||
− | | 3 || PC3 || 3N - 3F || | + | | 3 || PC3 || 3N - 3F || N3 - F3 || |
|- | |- | ||
− | | 4 || PC4 || 4N - 4F || | + | | 4 || PC4 || 4N - 4F || N4 - F4 || |
|- | |- | ||
− | | 5 || PC5 || 5N - 5F || | + | | 5 || PC5 || 5N - 5F || N5 - F5 || |
|- | |- | ||
− | | 6 || PC6 || 6N - 6F || | + | | 6 || PC6 || 6N - 6F || N6 - F6 || |
|- | |- | ||
− | | 7 || PC7 || 7N - 7F || | + | | 7 || PC7 || 7N - 7F || N7 - F7 || |
|- | |- | ||
− | | 8 || PD3 || 8N - 8F || Also connected to Bluetooth status LED pin (1) | + | | 8 || PD3 || 8N - 8F || N8 - F8 || Also connected to Bluetooth status LED pin (1) |
|- | |- | ||
− | | 9 || PD2 || 9N - 9F || | + | | 9 || PD2 || 9N - 9F || N9 - F9 || |
|- | |- | ||
− | | 0 || PD4 || 0N - 0F || | + | | 0 || PD4 || 0N - 0F || N0 - F0 || |
|- | |- | ||
− | | A || PA1 || AN - AF || | + | | A || PA1 || AN - AF || NA - FA || |
|- | |- | ||
− | | B || PA2 || BN - BF || | + | | B || PA2 || BN - BF || NB - FB || |
|- | |- | ||
− | | C || PA3 || CN - CF || | + | | C || PA3 || CN - CF || NC - FC || |
|} | |} | ||
# When Bluetooth made connection, BT status LED will keep constant high, you can not write it low, notice. But you can read the BT status via this pin. | # When Bluetooth made connection, BT status LED will keep constant high, you can not write it low, notice. But you can read the BT status via this pin. | ||
== Serial Debugging == | == Serial Debugging == | ||
− | === Bluetooth connect to serial debugger === | + | === Bluetooth UART connect to serial UART debugger === |
* board TX to cable RX, board RX to cable TX: | * board TX to cable RX, board RX to cable TX: | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
Line 45: | Line 46: | ||
| Serial monitor || NOT response < || Serial monitor CMD || "N1" | | Serial monitor || NOT response < || Serial monitor CMD || "N1" | ||
|- | |- | ||
− | | Phone || get < || MCU feedback || " | + | | Phone || get < || MCU feedback || "mssage is ..." |
|- | |- | ||
− | | Serial monitor || NOT get < || MCU feedback || " | + | | Serial monitor || NOT get < || MCU feedback || "message is ..." |
|} | |} | ||
− | === MCU connect to serial debugger === | + | === MCU UART connect to serial UART debugger === |
* vice verse connection | * vice verse connection | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
Line 59: | Line 60: | ||
| Serial monitor || NOT response < || Phone CMD || "N1" | | Serial monitor || NOT response < || Phone CMD || "N1" | ||
|- | |- | ||
− | | Phone || get < || MCU feedback || " | + | | Phone || get < || MCU feedback || "message is ..." |
|- | |- | ||
− | | Serial monitor || get < || MCU feedback || " | + | | Serial monitor || get < || MCU feedback || "message is ..." |
|} | |} | ||
− | + | * [[:Category:Bluetooth|Recommanded control phone APP see on this page.]] | |
− | + | * [[:File:BLIO.zip|IAR for STM8 demo code available here.]] | |
[[category: Bluetooth]] | [[category: Bluetooth]] |
Latest revision as of 03:02, 6 April 2018
Contents
Control Commands
- Pin Definition
- All pins connect to ground pin of LED
- All commands should be end up with \r\n
Pin | MCU PIN | v1.1 Command | v1.0 Command | Note |
---|---|---|---|---|
1 | PB5 | 1N - 1F | N1 - F1 | |
2 | PB4 | 2N - 2F | N2 - F2 | |
3 | PC3 | 3N - 3F | N3 - F3 | |
4 | PC4 | 4N - 4F | N4 - F4 | |
5 | PC5 | 5N - 5F | N5 - F5 | |
6 | PC6 | 6N - 6F | N6 - F6 | |
7 | PC7 | 7N - 7F | N7 - F7 | |
8 | PD3 | 8N - 8F | N8 - F8 | Also connected to Bluetooth status LED pin (1) |
9 | PD2 | 9N - 9F | N9 - F9 | |
0 | PD4 | 0N - 0F | N0 - F0 | |
A | PA1 | AN - AF | NA - FA | |
B | PA2 | BN - BF | NB - FB | |
C | PA3 | CN - CF | NC - FC |
- When Bluetooth made connection, BT status LED will keep constant high, you can not write it low, notice. But you can read the BT status via this pin.
Serial Debugging
Bluetooth UART connect to serial UART debugger
- board TX to cable RX, board RX to cable TX:
Receive | Action | Send from | example |
---|---|---|---|
Serial monitor | only response < | Phone CMD | "N1" |
Serial monitor | NOT response < | Serial monitor CMD | "N1" |
Phone | get < | MCU feedback | "mssage is ..." |
Serial monitor | NOT get < | MCU feedback | "message is ..." |
MCU UART connect to serial UART debugger
- vice verse connection
Receive | Action | Send from | example |
---|---|---|---|
Serial monitor | response < | Serial monitor CMD | "N1" |
Serial monitor | NOT response < | Phone CMD | "N1" |
Phone | get < | MCU feedback | "message is ..." |
Serial monitor | get < | MCU feedback | "message is ..." |