I want interface the PIC16f with Bluetooth Module through UART. I want send a heart rate as real time to mobile or PC. I found many posts some said you have to ported the stack to host(pic) some said just connect Rx,Tx of pic to Tx,Rx.
is the pic need stack or just as physical connection. the Bluetooth support SPP,HCI
another question the communication between the module and pic via AT command or what because I found a code which did not use AT command.
Code:
unsigned short temp_res;
void main() {
USART_Init(115200); // Initalize USART (115200 baud rate, 1 stop bit, ...
// Select Vref and analog inputs, in order to useADC_Read
ADCON1 = 0;// All porta pins as analog, VDD as Vref
TRISA = 0xFF; // PORTA is input
do {
// Read ADC results and send the upper byte via USART61
temp_res = ADC_Read(2) >> 2;
USART_Write(temp_res);}
while (1); // endless loop}
Depends on which Bluetooth module you are using. For example, the Roving Networks' RN-41 has a built-in stack and supports SPP/DUN Master and Slave, or HCI (different versions). It doesn't use the AT command format, but is still very easy to configure over the serial (UART) interface. http://www.rovingnetworks.com/products/Bluetooth_Modules
hi GSM Man!
Thank you very much.
So, if the Bluetooth module support SPP or HCI then we do not need to use AT command. just physical connection between Tx,Rx of pic and Rx,Tx of bluetooth module and use code application as UART. is there any example.
AT Commands have nothing to do with SSP or HCI. The AT Command set defines a protocol for sending commands and data between 2 devices, defined by Hayes Microcomputer Products back in the 1970's. It's a popular protocol for communications devices, and is the basis for several standards including ITU-T V.25 TER, ETSI GSM 07.05 and ETSI GSM 07.07.
Your Bluetooth device either uses the AT protocol or it doesn't. You need to refer to the Bluetooth device's manual to understand how to communicate with it. BTW - which Bluetooth device are you using?
I have found a small module (FC04UAB) which is really fit with my design; however; I am not sure is it possible to connect with PIC16 or not.
It has UART pins connection and support HCI.
if it is OK! can we communicate with enable mobile Bluetooth, someone said no because the mobile support SPP not HCI. is it right or not.
please heeeeeeeeeeeeeeeeeelp!
Cheers!