Bluetooth Connectivity
Table 4. UART frequency settings
OP3 OP3 OP3
Baud Rate
Read from NVS 1
9.6 kbps
1
0
0
1
1
1
0
1
1
1
0
1
115.2 kbps
921.6 kbps
1. System parameters in non-volatile storage
When the value is at 1 this means a 1 K pull-up resistor must be placed.
This configuration is with the LMX9838 Bluetooth® Serial Port Module. In the MC9S08LL16 the SCI baud rate must also be
configured in the SCI_Init (void)function.
void SCI_enable(void)
{
SCIBD = BR;
/* SCI baud rate = 10MHz/(16*65) = 9615 bps */
SCIC1_LOOPS=0;
SCIC2_TE=1;
SCIC3_TXDIR=1;
}
*******************************************************************************
#ifndef __SCI_H_
#define __SCI_H_
#include "MyTypes.h"
#define BR
54
/* BAUD RATE = 9600 (Baud rate mismatch = 0.160 %) */
#define ERROR 0x07
void SCI_enable(void);
void SCI_Send_byte(UINT8);
#endif /* __SCI_H_ */
8.3 Bluetooth Software
Bluetooth.h
In the Bluetooth.h file are all the declared necessary functions to implement Bluetooth communication. The functions help to
connect and disconnect the system. It also configures the serial port and when to reset.
Function declarations:
Set_Bluetooth_Communication(void)
BT_SFW_Reset(void)
BT_Send_Data(void)
BT_SDAP_Connect(void)
BT_SDAP_SPP_Service_Browse(void)
BT_SDAP_Disconnect(void)
BT_Create_SPP_Connection(void)
BT_Send_Data(void)
Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010
Freescale Semiconductor, Inc.
19