Subscribe

Serial to Bluetooth

Posted by Circuit Labs on Wednesday, November 19, 2008

When computer makers switched from RS232 to USB, one of the collateral benefits was TTL compatibility with regard to the supply voltage as well as signal levels. Unfortunately, there was also collateral damage, primarily in the form of an enormous increase in the complexity of the data transmission process. All you need for connection to an RS232 serial port is a level converter, but USB requires an extra IC (such as the Cypress CY7C68000 or a special-purpose microcontroller, such as the PIC18F4550) to make data transmission possible. That sounds like a zero-sum game, which raises the question: if you already have to use an extra IC, why not go directly to Bluetooth? And in fact, there are already several Bluetooth modules available, complete with an integrated antenna and simple serial inputs and outputs. However, many of them have the disadvantage that they are controlled using AT commands, which makes it necessary to use an additional controller.

060077

However, there are also autonomous models available, such as the new LinkMatik module (www.flexipanel.com). If its Mst/Slv pin is held low, it waits until something wants to connect to it. If the pin is high, the module actively searches for devices that are ready to establish a connection. That means you can set up a shortrange radio link without using a computer by simply coupling two modules together. However, generally speaking you will probably want to control an external device from a PC. In that case, you can let your PC search for devices that are ready to establish a connection. When the PC finds a module, it lists its available services. The service known as ‘Serial Port Profile’ (SPP) is the appropriate service of the LinkMatik module. If the security function is enabled, you will have to enter the PIN code of the module (set to ‘0000’ when first delivered). Once a connection has been established, the Status pin of the module goes to a high level to indicate that it is ready for bidirectional data transmission.

Now you can simply use the familiar TxD and RxD lines to transmit serial data. The RTS and CTS lines are also available for controlling the data flow. If you do not need that function, you
can simply connect these two lines together. However, this wireless serial interface does not allow you to use these lines for purposes other than their intended use, as is often done with ‘normal’ serial interfaces. As the data is buffered in the module before and after wireless transmission, RTS and CTS are generated locally. These two signals only control data flow to or from the module, but not over the wireless link.

It is generally not possible to have more than one serial link via Bluetooth per PC. However, Bluetooth-2.0 compatible modules have recently become available, and they allow up to four serial links to be used concurrently along with other functions.

Author: Richard Hoptroff

 (Elektor Electronics Magazine – 7-8/2006)



Download this article (direct link #060077-uk.pdf)

0 comments:

Subscribe to: Post Comments (Atom)