Let's Make Robots!

Picaxe board CHI035A, and L6 Bluetooth module issues SOLVED

 

Hey guys, 

 

I wonder if someone here could enlighten me a little bit with an issue I'm having with a Picaxe project with a CHI035A board wired to a motor,a buzzer, a led and a L6 (or BC4) bluetooth module which I'm trying to control and communicate with an Android cellphone.

 

 CHI035A -> http://www.picaxe.com/docs/chi035a.pdf

  L6 ->http://www.elechouse.com/elechouse/images/product/Serial%20Port%20Bluetooth%20Module/BC4_Blue2.0.pdf

 

I have made a little Android program with the AppInventor (appinventor.mit.edu) to control the picaxe chip which contacts with the L6 bluetooth module and establishes a connection between both of them. I programmed the Picaxe chip with the following commands:

 

--------------------------------------------------------------------------------------------------------------

 

#picaxe18m2

setfreq m8

hsersetup B9600_8, %00

 

main:

 

hserin b1

 

serin 0,N9600_8,b1

serin 2,N9600_8,b1  

serin 0,T9600_8,b1

serin 2,T9600_8,b1  ' I used all the commands to receive data that are available with the picaxe and tested all the                                           

                               'possible pins, but any of those tests worked,       

 

 

 

if b1 ="A" then call motor_adelante

if b1 ="B" then call motor_atras

if b1 = 1 then call motor_gizquierda

if b1 = 2 then call motor_gderecha

goto main

motor_adelante:

forward A

forward B

return

 

motor_atras: 

backward A

backward B

return

 

motor_gizquierda: 

forward A

backward B

return

 

motor_gderecha:

backward A

forward B

return

 

---------------------------------------------------------------------------------------

 

I have programmed the Android app to send a value or a string ( like 1,2 or A,B ) to the bluetooth module when a button is pressed and then the picaxe receives the value and it moves accordingly with what it received ( or does the required

function).

 

However, when I open up the android app and I establish a connection with the bluetooth module and send a value to the picaxe, it does not seem to receive anything although the connection is working.

 

The photos attached to the post show where the bluetooth module is connected, the TxD pin in the PORTB.2 hole, and the RxD pin in the PORTB.0 hole. Sorry for the bad quality, I don't have a good camera 

 

I think that the possible problem may be that the TxD and RxD wires are not connected where they belong, or some programming error. But after trying and trying possible solutions to solve the problem I haven't found any fix.

 

So here I am ,to see if anyone can give me any hint to solve this.

 

 

 

 

Any help is highly appreciated.

 

Many thanks to anybody who helps me.

 

 

 

AttachmentSize
DSC00014.jpg309.92 KB
DSC00013.jpg360.31 KB
DSC00010.jpg344.34 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I have done many debug tests, but in any of them I get any value or interaction between the mobile and the picaxe although the bluetooth module is successfully paired and connected to the phone. That makes me think that the problem is related to the physical configuration of wires.

I have two kind of PORT.B ports (outputs) as the datasheet of the board indicates, non-buffered and buffered, and those are distributed in two columns that have to B.0 to B.7 each, and then I have PORT.C (inputs). The buffered ports have positive and negative connections, while the non-buffered have only one hole to connect the wire to.

So I have this configuration in the image below, which I think is wrong, and I have thought of another config which is shown in the next image:

First config

 

Second config

Which one of those is the correct one?

 

of the BT module do you have connected to the TX pin on the PICAXE board?

The RxD pin of the bluetooth goes to the TxD of the PICAXE, and the TxD of the bluetooth module to the RxD pin of the PICAXE.

Okay I switched the RxD cable with the TxD in the bluetooth module and now the PICAXE is receiving the values, because I have done a debug test and the values change as I send them. All this accomplished with the command: 

hserin b1 and hsersetup B_9600, %00

I can use the robot through bluetooth.

 

SOLVED

your seting the value of b1 5 times , try difrent bite numbers for each read like this

hserin b0

serin 0,N9600_8,b1

serin 2,N9600_8,b2

serin 0,T9600_8,b3

serin 2,T9600_8,b4 

maybe writing a debug code just to test the what input you are getting

is to just test to make sure you can send and receive characters. In other words, use BT to send a character to your PICAXE, and, have the PICAXE return the same character via BT. If that works, then you can move on to trying to control things.

Have I done something wrong in the post?