BlueSmirf headache

Hi,

I have got some issues sending data from my pc to the BotBoard with ATOM 28 pro. I’m fighting with this for over a couple of days and I just don’t get it to work properly. I’m hoping that somebody has got some good ideas.

I’m trying to send a frame with 10 bytes of data which contains the data of my Wii Remote. I’ve added a start byte, a checksum and a prefix “$” because the data is.
The frame looks like this: $FF$wiix$wiiy$wiiz$nunx$nuny$nunz$joyx$joyy$buttons1$buttons2$Checksum

The setup is like this:
The Wii Remote is connected to my pc using Bluetooth. I’ve got a custom made C#, .net application which converts the data from the Wii Remote to the frame. The data is send to the BotBoard using a BlueSmirf. The BlueSmirf is connected to pin 14 and 15 and uses a baute rate of 38.4k.

The BotBoard does the calculations and sends his data to the SSC-32. The SSC-32 is connected to pin 12 and 13 and also uses a baute rate of 38.4k.

The first thing I tried was receiving data from the BlueSmirf using serin/serout

[code]All Variables are bytes…

‘Checking for frame start
WaitForFrame:
Serin P14, i38400, [ihex2 Checksum]
IF(Checksum <> 255)THEN
GOTO WaitForFrame
ENDIF

Serin P14, i38400, [ihex2 wiix, ihex2 wiiy, ihex2 wiiz, ihex2 nunx, ihex2 nuny, ihex2 nunz, ihex2 joyx, ihex2 joyy, ihex2 buttons1, ihex2 buttons2, ihex2 Checksum]

‘Check data
IF(Checksum = (wiix + wiiy + wiiz + nunx + nuny + nunz + joyx + joyy + buttons1 + buttons2)//255)THEN
‘Correct data received!
ENDIF

Serout P14, i38400, [hex Wiix\2, hex wiiy\2, hex wiiz\2, hex nunx\2, hex nuny\2, hex nunz, hex2 joyx\2, hex joyy\2, hex buttons1\2, hex buttons2\2, hex Checksum\2]
[/code]

If I send a frame and compare this to the received frame, the first 2 bytes are always identical. The third byte is one on ten wrong and the end of the frame is never right! The data of the last bytes just doesn’t make any sense at all! :confused:

So what I did was changing the serin/serout to Hserin/Hserout.

This works perfect! I’ve got my whole set of bytes without any problem! 8)

But when I included this in my main program the I found another problem. :blush: When I’m sending data from my pc to the BlueSmirf AND I’m sending data to the SSC. All my servos are starting to jump to different positions! Even if I don’t read the Hserin the servos are just moving around to a random place. But when I stop sending data to the BlueSmirf or SSC the motors will stop. And when I remove the ENABLEHSERIAL command, the servos are working normal again. It looks like the SSC is picking up some noise from the BlueSmirf data.

I’ve tried changing the SSC pins. But the problem is still there. I’ve tried using the normal serin/serout. The problem with my servos is gone but then I’m missing some data again!

The only things that I can think of to try next is changing the baute rate from the BlueSmirf. I hope that there will be minder interference then.

Sorry for the long story but I hope that somebody can help me find out what is going on because I’m running out of options that I could think of…
Did somebody had this problem before?
Am I doing something wrong?
Does somebody has got another (better) idea of sending 10 bytes from my pc to the BotBoard?
Thanks, Xan

One week after and no reaction at all :frowning:

I guess my story was to long so lets give it another try! 8)

I need some help receiving data from my BlueSmirf and at the same time send other data to the SSC.
Did somebody tried the same thing?
Should i use hserin or just serin for both sending and receiving?
What baud should i use?
I hope that somebody can help me out…

Thanks, Xan