PDA

View Full Version : Bluetooth Serial Module



Jamesx
12-10-2009, 09:06 PM
I am working with a Parallax RoboTech Bluetooth Serial Module, and I am having trouble figuring the interface out. In fact, I am completely stumped.

Using a propeller going to the Tx,Rx lines, I've been able to reliably establish a serial link to a pc. This 'transparent mode' seems to work quite nicely. However, I cannot figure out how to get out of the transparent serial port mode into "command mode". This command mode is needed to change eeprom parameters, query details about the connection, etc.

I've tried everything I can think of: turning it on without connecting via bluetooth; turning off bluetooth; sending a UART break from the propeller. But I cannot seem to get it into command mode. It's either unresponsive or in serial port mode. According to the manual on the Parallax site, it looks like the main part on the unit is a LMX9830 by National Semiconductor. According to documentation for the LMX9830, the part should be in command mode when it's turned on, before bluetooth connects. But I get no response back to the propeller when sending commands.

Anyone out there with some experience with this one?

Thanks

Jim

blittled
12-11-2009, 06:26 AM
I've been looking at this issue too. I wanted to connect the RoboTech Bluetooth transparently to an EB500 but couldn't figure out how to do the UART break. I ended up connecting the EB500 to the RoboTech since it is very easy to put in command mode. How did you generate the UART break? I may take another look at it. The Robotech is a great product but Parallax should have had an example on how to get it in command mode in its documentation.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Will work for Propeller parts!

Jamesx
12-11-2009, 09:35 AM
Bittled

I think the UART break comes from the RoboTech, and is sent to the 'host' (in my case a propeller). As I understand the datasheets, this UART break is to be sent when a bluetooth link is lost/broken. However, as far as I can tell, this break doesn't happen (I scoped the parts during a bluetooth disconnect). It may be because of a filter setting on the RoboTech.

I can understand not seeing a UART break, if a filter is set up that way, but what I don't understand is why the RoboTech won't respond when it's supposed to be in 'command mode'.

Jim

blittled
12-11-2009, 10:08 AM
RBT-001 Manual (page 13) said...
Leaving transparent mode
As the RBT-001 does not listen to commands, UART Break has to be used to tell the
device to leave the transparent mode.


It appears to me that the host processor has to send the UART Break to tell the RBT-001 to go into command mode. This is also mentioned on page 52.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Will work for Propeller parts!

Mike Green
12-11-2009, 10:52 AM
The host processor (the Propeller) has to send the break. The easiest way to do this is to use Simple_Serial and just set the transmit I/O pin (to the RBT-001) to zero (low) for at least one character time. If you're using 9600 Baud, that'd be 2 to 3 milliseconds. You could use "WAITCNT(CLKFREQ/300+CNT)" for the delay.

Jamesx
12-11-2009, 11:39 AM
This is indeed confusing. The following is from the datasheet, pg 14 which describes "settings or parameters influencing the operational state"

Parameter 18: EventFilter: Configures the level of events reported to the host.
0x00: No filter, all events reported
0x01: ACL events filtered, only API events reported
0x02: All events filtered, only UART breaks indicated
0x03: All events filtered, including UART break

To me, that looks like these events, including the UART break, are reported to the host, or propeller in the case. If the host were creating the UART break, why would the RBT need to send the host notification of a break?

Also, a little additional digging into the datasheet for the Nat. Semi. LMX9838 revealed the following:
(the RBT has a Nat. Semi part on it, a LMX9830, which has the same command set as the LMX9838)

If the link is dropped, the LMX9838 will empty its buffers and
• send a UART break to the host
• send “Transparent Mode” Indicator (Section 7.2.4.1 Transparent Mode Command) — Indicates on protocol level to the host that transparent mode has been left.
• send “SPP Release Link” Indicator (Section 7.2.3.5 SPP Release Link) — Indicates that link has been released.


Maybe both the host and dropping the link can put the RBT into command mode?

In any case, it looks like dropping the link should cause a UART break. But as far as I can determine, the RBT does not send a UART break when a bluetooth link is dropped. So, maybe it's because all event notifications are filtered out.

But I still cannot get it into command mode, after a link is dropped....

Jim

blittled
12-11-2009, 11:48 AM
Thanks Mike for the info. I was thinking of modifying the fullduplexserial object but it sounds much easier to use the Simple Serial object. I'll give it a try after the holidays when things slow down.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Will work for Propeller parts!

barjaktar
10-19-2010, 01:58 AM
So, this should be enough to create a break, thus setting rbt001 to command mode?

void sendBreak(void)
{
//set to low
USARTWriteChar(0x00);

//pause 5 ms
delay_ms(5);
}

Well... it's not...

Heater.
10-19-2010, 06:01 AM
barjaktar:

Mike Green said,


just set the transmit I/O pin (to the RBT-001) to zero (low) for at least one character time. If you're using 9600 Baud, that'd be 2 to 3 milliseconds.

I'm not sure that transmitting a 0x00 byte does that. That will transmit a start bit, 8 bits of zero and a stop bit or two. Perhaps the line is never low long enough.

Better to just arrange that the IO pin is set to zero directly.

barjaktar
10-19-2010, 09:20 AM
Ok, thank you Heater.

So, do I need to do this every time? For example, if I want to change the local name and set rbt001 not to use any pin, I'd have to do it like this:

sendBreak();
setName(); //a function given in my last post at: http://forums.parallax.com/showthread.php?t=125139&highlight=connecting

sendBreak();
setSecurityMode(); //a function that sets rbt001 into security mode 1, where there is no authentication (that is the right way to lose the pin, right?)

Also, SET_EVENT_FILTER must be set to 0x00, right? Or no?

Thank you.

Heater.
10-19-2010, 09:55 AM
To be honest I have never played with bluetooth serial modules. I was just speculating.