micrometal
New Member
I have been trying for some time to communicate with an 08M2 using Bluetooth. I am using a AXE091 board. I have an HC-05 and an HC-06 module. I know that the modules are good because if I wrap Rx and Tx on the board everything that I send comes back. What I am trying to do is a wrap test through the 08M2. Here is my code ...
Two remarks that I need to make here ...
1. I am using 1200 baud because when I ran the Rx/Tx wrap test and looked at the signal on an oscilloscope it appeared to be 1.2khz. But using 9600 baud gives the same results anyway.
2. I use Txxxx for serin and Nxxxx for serout because I am using a common emitter transistor to buffer the 5v/3.3v levels, which inverts the signal.
To test the circuit I send single bytes. The LED illuminates, but what is received at the 08M2 is not the byte that I transmitted; it is a repeatable but otherwise random value. And nothing is transmitted back.
It would be helpful if anyone can suggest how I can verify the baud rate that the BT modules are expecting. Even better, tell me that there is something wrong with my code.
Code:
; HC-05/06 testbed
; C.0 is output to Rx of Bluetooth module
; C.1 is input from Tx of Bluetooth module
; C.2 is indicator output to LED
setfreq m8
main: b0 = 0 ' clear data
debug b0
serin [2000],C.1,T9600_8,b0
if b0 = 0 then goto main
high C.2
debug b0
pause 2000
serout C.0,N9600_8,(b0)
pause 2000
low C.2
goto main
end
1. I am using 1200 baud because when I ran the Rx/Tx wrap test and looked at the signal on an oscilloscope it appeared to be 1.2khz. But using 9600 baud gives the same results anyway.
2. I use Txxxx for serin and Nxxxx for serout because I am using a common emitter transistor to buffer the 5v/3.3v levels, which inverts the signal.
To test the circuit I send single bytes. The LED illuminates, but what is received at the 08M2 is not the byte that I transmitted; it is a repeatable but otherwise random value. And nothing is transmitted back.
It would be helpful if anyone can suggest how I can verify the baud rate that the BT modules are expecting. Even better, tell me that there is something wrong with my code.