Bluetooth

Created: 21/Mar/2004
Last update: 15/May/2004

This page documents some Bluetooth boards developed within the CSE.

As at 15/May/04 it is improving fast.

CONTENTS


General Discussion

Bluetooth is a short range, low power wireless communication standard. It can support a wide range of appliances from simple RS232 to voice headsets.

Cambridge Silicon Research (CSR) make a very nice Bluetooth controller/chipset. A company in Taiwan, Yasing Technology, make small modules using CSR's chip set that allow easy fabrication of custom bluetooth devices. And it's these modules that are the focus of this page.

This is a picture of the module (it's quite small 15 x 25 mm):

A copy of this module's manual in PDF can be found here

NOTE

CSE does not possess a full CSR chipset development environment, and so are using what might be called 'vanilla' Yasing modules configured as serial peripheral profile devices. Much more might be done with these modules, but the expertise to do this is not present within CSE as at May 2004. The equipment that is documented within these pages is still very useful and capable.


The main Bluetooth web site is at http://www.bluetooth.com/
CSR's home page is at http://www.csr.com/home.htm
Yasing's home page is at http://www.yasingtech.com/

Other links:
BT Designer - Bluetooth Designers' Resource Center http://www.btdesigner.com/
BlueZ - Official Linux Bluetooth protocol stack http://www.bluez.org/documentation.html

AVR/Bluetooth Microcontroller Board

The Yasing module has been mounted on a small PCB with an AVR microprocessor. The board has these features:
  • ATmega32 AVR microcontroller at 8MHz
  • 32K flash, 2K ram, 1K EEPROM
  • 8 x 10-bit ADC, counter timers, PWM, UART, SPI
  • Yasing Bluetooth module
  • The board is configured to use a serial port at 115200 baud 8 data bits 1 stop bit with hardware handshaking. This matches the Yasing module.

    The circuit diagram of the board can be found in this file - bluetooth-avr-circuit.ps

    This is a picture of the board:

    This is a diagram of the board's layout

    To operate this board you need a USB Bluetooth Dongle or similar. When plugged into a desktop Windows machine and the initial setup completed and the Bluetooth modules have 'connected' to each other, the Windows machine will present with a new COM port - typically COM3. using a serial comms program to connect to this COM port will allow you to communicate to the AVR board as though it were attached to the machine via a serial cable.

    (It is also possible that the Yasing module could be made up to connect to one of the new Philips LPC21xx boards that has just been built. The LPC21xx is an ARM7 thumb device, a single chip microcontroller with 64K of flash and 32K of ram, running at up to 60MHz.)


    Setup/Operation

    In typical operation, the BT-AVR board sits remotely from some host computer. This diagram indicates the setup

    To setup and be able to use the BT-AVR board, you will need the following:

    	BT-AVR board
    	Power supply - either batteries or plug pack 
                           (suitable plug packs include
                                   Jaycar MP-3140 - 5V regulated
                                   Jaycar MP-3130 - 3,4.5,5,6,9,12 regulated)
    	Bluetooth USB adapter for host computer
    	             - most will probably work fine under Windows
                         - if using Linux, check for support
    
    	A terminal program for the host computer, or a custom application
    
    For developing programs for the BT-AVR board then the AVR-GCC tool chain is recommended. See elsewhere on the ~pcb web pages for versions of the tool chain for both Windows and Linux


    Test Code

    WARNING - I am rapidly changing the code in this test program on the weekend of the 15/16th May. It will be radically improved from this initial version by Monday 17th May. What is here does work, but is poorly documented at this instant.

    I have written a small test program for the BT-AVR board. It provides some general utilities for use with the Mega32 and aims to be a generic test program more than some wonderful does-everything program. A tar'ed gzipped version of the program can be found here Mega32-BT.tgz

    Un-tar the file and you will have a directory called "Mega32-BT". Inside is all the code for the sample program.

    See the 'NOTES' file for a description of the program code and the commands that it accepts

    A 'make clean" then 'make' will create the Intel HEX file that is loaded on to the micro. Use your programmer of choice. I use SP12, and a small script called 'prg4' does my programming for me.

    I do my development for AVR's under Linux using the AVR-GCC tool-chain. Oddly, I am actually using the the USB-Bluetooth dongle that communicates to the board under Windows-XP (don't ask why).

    All the code that I write should work fine under the WinAVR-GCC tool chain, I just don't use that much.

    All the AVR tools you need can be found on the general CSE AVR page at http://www.cse.unsw.edu.au/~pcb/avr/avr.html