Hello, I'm having some issues with baudrate problems when sending serial data from my PC to my PIC using bluetooth. Any help is much appreciated.
Basically, I have a PIC dev board with the TX and RX lines tied to a bluetooth module. I can connect to the module through a USB module on my computer. Here is the example program that came with the board.
The bluetooth module has a command interface. The default baudrate is 115200, and I set that to 9600. Using PuTTY as a terminal, I also set the serial settings to 9600. Everything is set the same: 8 bits, 1 stop bit, no parity, no flow control.
On output, instead of getting "A"'s and "B"'s, I get stuff like:
If anyone can help, that'd be great.
Basically, I have a PIC dev board with the TX and RX lines tied to a bluetooth module. I can connect to the module through a USB module on my computer. Here is the example program that came with the board.
Rich (BB code):
/*
Code Support : Board ET-USBPIC/4550
Compiler : PIC C Compiler Version 3.249
Micro Controller : PIC18F4550
OSC : 48MHz
*/
#include <18F4550.h>
#fuses HSPLL,USBDIV,PLL5,CPUDIV1,VREGEN,NOWDT,NOPROTECT,NOLVP,NODEBUG
#use delay(clock=48000000)
#define TX1 PIN_C6
#define RX1 PIN_C7
#use rs232(baud = 9600, xmit = TX1, rcv = RX1)
#use fast_io(C)
void main() {
char Dat;
set_tris_c(0B10000000);
While (1)
{
delay_ms(2);
putc('B');
delay_ms(2);
putc('A');
}
}
The bluetooth module has a command interface. The default baudrate is 115200, and I set that to 9600. Using PuTTY as a terminal, I also set the serial settings to 9600. Everything is set the same: 8 bits, 1 stop bit, no parity, no flow control.
On output, instead of getting "A"'s and "B"'s, I get stuff like:
Rich (BB code):
¿ñ×ö¿¿ñ×ö¿¿ñ×ö¿¿ñ×ö