One can buy the BlueNiceCom4 bluetooth module from http://www.roundsolutions.com/ for €31.50 each + €21 p&p + 19% VAT (19/10/2008).
This little widget seems to be pretty cool. It essentially wraps the National Semiconductor LMX9830 with the relevant support hardware (crystal, flash, antenna), exposing the important interfaces. All packaged in a pretty small device. Its possible to solder single core wires on the underside fairly neatly and without too much hassle.
(I think!) The manufacturers site is http://www.amber-wireless.de/produkte/bluetooth/default.php?fnum=115286694851 which has a link to the device data sheet. The data sheet itself just describes the module as a whole. For detailed implementation details you'll need to refer to the LMX9830 data sheet at http://www.national.com/pf/LM/LMX9830.html .
The data sheet from amber wireless is pretty poorly written. The essential points to realise are that of the pins OP3, OP4 and OP5, it is necessary to tie OP3 high. Setting OP5 low (through a 1k resistor) explicitly sets the UART baud rate to be 9600, which is what I did. I initially tried to use the auto negotiation mode, but didn't set OP3 high, which meant it didn't work. When I added the flying lead for the OP3 I also added it for OP5 and so didn't need to try the auto negotiation - I have no idea if it will work.
The wording for the UART link is poor, but it does the intuitive thing - the TX on the NC4 connects to RX on the mbed board and vice-versa. CTS (clear to sent) and RTS (ready to send) pins are provided on the NC4 board. It is possible to ignore these (with potential implications) by setting CTS low and leaving RTS floating.
All the above points are documented properly in the data sheets.
The 2 photos below show the NC4 module wired up to the mbed board. Red wires go to the 3.3v regulated supply provided by the mbed board. Blue wires go to 0v. Yellow wires are other stuff (including signals). The potentiometer is because I didn't have a 1k resistor to hand (and is used as such)! The wires going to pins 20, 21 on the mbed board are just for monitoring and aren't necessary. The wire going to pin 22 is triggering the reset. This keeps the state of the module sane and should be connected.
National semiconductor have a neat tool for talking to the bluetooth module called "Simply Blue Commander". This can be downloaded from http://www.national.com/analog/wireless/lmx9830 along with some other interesting looking stuff I haven't had chance to explore yet. The program is a windows program, but runs happily under Wine under Linux. In this case, if you are using the mbed board to interface with the module, you will need to point the com port to the serial port (/dev/ttyACM0 or whatever). This is done by creating a symlink in ~/.wine/dosdevices/ to /dev/ttyACM0 called com1 - "ln -s /dev/ttyACM0 com1".
You will prob need to set the baud rate to be 9600 in Simply Blue Commander, which is prob the default.
The simple code below (written by Simon F) pushes the data sent to the mbed board straight onto the NC4 board over UART and vice-versa (assuming the NC4 UART is connected to pins 27 and 28 on the mbed board).
#include "mbed.h"
Serial pc(USBTX, USBRX);
Serial uart(28, 27);
DigitalOut reset_bt(22);
int main() {
reset_bt = 0;
reset_bt = 1;
while(1) {
if(pc.readable()) {
uart.putc(pc.getc());
}
if(uart.readable()) {
pc.putc(uart.getc());
}
}
}
The basic commands are pretty easy to get the hang of.
The default pin is 0000.
It really simple to connect to a phone using Simply Blue Commander. "Establish SPP Connection" followed by "Enter Transparent Mode" sets the phone to receive AT commands. At this point, it is possible to exit Simply Blue Commander and take control of the serial link directly (e.g. with screen) and pass AT commands directly to the phone. We successfully had the phone dialling out, hanging up, sending texts etc all through the bluetooth link we created.
Cool stuff! :)
Attachments
- whole_image.jpg (111.0 kB) - added by whg21@… 23 months ago.
-
nc4_zoom.jpg
(118.8 kB) - added by whg21@…
23 months ago.
Basic wiring of the NC4 module


