Difference between revisions of "BLK IO"

From ElectroDragon
Jump to: navigation, search
(Control APP)
(Control Commands)
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Control Commands ==
 
== Control Commands ==
 
+
[[File:2018-05-11 134040.png|400px|right]]
 
* Pin Definition
 
* Pin Definition
 
* All pins connect to ground pin of LED
 
* All pins connect to ground pin of LED
Line 6: Line 6:
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
! Pin !! MCU PIN !! v1.1 Command !! v1.0 Command !! Note
+
! Pin !! MCU PIN !! v1.1 Command !! v1.0 Command !! Note !! V1.1 Custom
 
|-
 
|-
 
| 1 || PB5 || 1N - 1F || N1 - F1 ||  
 
| 1 || PB5 || 1N - 1F || N1 - F1 ||  
Line 22: Line 22:
 
| 7 || PC7 || 7N - 7F ||  N7 - F7 ||  
 
| 7 || PC7 || 7N - 7F ||  N7 - F7 ||  
 
|-
 
|-
| 8 || PD3 || 8N - 8F ||  N8 - F8 || Also connected to Bluetooth status LED pin (1)
+
| 8 || PD3 || 8N - 8F ||  N8 - F8 || Also BL status LED pin (1)
 
|-
 
|-
| 9 || PD2 || 9N - 9F ||  N9 - F9 ||  
+
| 9 || PD2 || 9N - 9F ||  N9 - F9 || || Set as input, connect to GND trigger send message
 
|-
 
|-
| 0 || PD4 || 0N - 0F ||  N0 - F0 ||  
+
| 0 || PD4 || 0N - 0F ||  N0 - F0 || || Set as input, connect to GND trigger send message
 
|-
 
|-
 
| A || PA1 || AN - AF ||  NA - FA ||  
 
| A || PA1 || AN - AF ||  NA - FA ||  
Line 35: Line 35:
 
|}
 
|}
 
# 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 ==
 
=== Bluetooth connect to serial debugger ===
 
* board TX to cable RX, board RX to cable TX:
 
{| class="wikitable sortable"
 
|-
 
! 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 connect to serial debugger ===
 
* vice verse connection
 
{| class="wikitable sortable"
 
|-
 
! 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 ..."
 
|}
 
  
== Control APP ==
+
== Serial Debuging ==
Recommanded android SPP APP:
+
* To receive MCU Debug Info, so USB-TTL <> MCU
{| class="wikitable sortable"
+
* Use USB-TTL Debug tool, for example PL2303 TX (Green Color), RX (White Color)
|-
+
* TX/G to right top pin, RX/W to right top second pin
! APP !! Status !! Function
+
* To receive phone bluetooth end message, vice verse connection.
|-
+
=== Debug Note ===
| BlueSPP || not working well || support to use as "switch" or "button"
+
* Do not connect serial cable when send commands remote from phone, will block message.
|-
+
* Some module baudrate is 9600, 115200, 38400.
| Bluetooth SPP Pro || good || support to use as "button", press or hold
+
 
|-
+
* [[:Category:Bluetooth|Recommanded control phone APP see on this page.]]
| Bluetooth Serial Terminal || good || few buttons suppported
+
* [[:File:BLIO.zip|IAR for STM8 demo code available here.]]
|-
+
 
| bluetooth terminal HC-05 || good || few buttons suppported
+
== Code Update ==
|}
+
 
 +
* V1.12 get here [[File:BLKIOV1.1.hex.zip]]
 +
* V1.12 fixed button delay bug
 +
* V1.1 Custom Support PD2 PD4 as input, send message to bluetooth phone
 +
 
 +
== Schematic ==
 +
<gallery>
 +
File:Blk_io_sch.png | BLK IO SCH
 +
</gallery>
 +
 
 +
== On Board Bluetooth Module ED-30 ==
 +
* to change name -> AT+NAME<Param>
 +
* to change pin -> AT+PIN<Param>
 +
* to change baudrate -> AT+BAUD<Param>; <Param> from 1~C, 1: 1200, C: 1382400, 4: 9600, 8: 115200, 6: 38400
  
  
 
[[category: Bluetooth]]
 
[[category: Bluetooth]]

Latest revision as of 01:41, 11 May 2018

Control Commands

2018-05-11 134040.png
  • 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 V1.1 Custom
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 BL status LED pin (1)
9 PD2 9N - 9F N9 - F9 Set as input, connect to GND trigger send message
0 PD4 0N - 0F N0 - F0 Set as input, connect to GND trigger send message
A PA1 AN - AF NA - FA
B PA2 BN - BF NB - FB
C PA3 CN - CF NC - FC
  1. 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 Debuging

  • To receive MCU Debug Info, so USB-TTL <> MCU
  • Use USB-TTL Debug tool, for example PL2303 TX (Green Color), RX (White Color)
  • TX/G to right top pin, RX/W to right top second pin
  • To receive phone bluetooth end message, vice verse connection.

Debug Note

  • Do not connect serial cable when send commands remote from phone, will block message.
  • Some module baudrate is 9600, 115200, 38400.

Code Update

  • V1.12 get here File:BLKIOV1.1.hex.zip
  • V1.12 fixed button delay bug
  • V1.1 Custom Support PD2 PD4 as input, send message to bluetooth phone

Schematic

On Board Bluetooth Module ED-30

  • to change name -> AT+NAME<Param>
  • to change pin -> AT+PIN<Param>
  • to change baudrate -> AT+BAUD<Param>; <Param> from 1~C, 1: 1200, C: 1382400, 4: 9600, 8: 115200, 6: 38400