I'm updating a project that currently uses standard serial port to communicate to an application on the PC. I actually use a USB to serial FTDI breakout board to make connectivity more straight forward as modern PC's seldom come with RS232 serial ports these days. However as part of my "revamp" I want to replace this connection with a blue tooth option, and have purchased a couple og the HC-06 modules with back board attached and a decent Belkin BT dongle.

Rather than swap out the USB board and then hope for the best that it works and is a direct replacement I thought I would do some simple testing.

Code:
ASM 
 
  __CONFIG    _CONFIG1H, _OSC_HSPLL_1H
  __CONFIG    _CONFIG2L, _PWRT_ON_2L  
  __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
  __CONFIG    _CONFIG3H, _PBADEN_OFF_3H
  __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L

ENDASM

DEFINE  OSC 40
ADCON1 = $0F
clear

;----[Hardware USART defines]---------------------------------------------------

DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
DEFINE HSER_SPBRG 86  ' 115200 Baud @ SPBRGH = 0
BAUDCON.3 = 1         ' Enable 16 bit baudrate generator

RCSTA = $90   ' Enable serial port & continuous receive
TXSTA = $24   ' Enable transmit, BRGH = 1
SPBRG = 86    ' 115200 Baud @ -0.22%
SPBRGH = 0
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator


main:
HSEROUT ["Hello"]
Pause 1000
goto main
Nothing taxing, just a simple "hello world" example. Compiled and loaded the code to the PIC (18f4580) - and tetsed using the existing USB and a windows terminal program... sure enough "Hello" was repeatedly displayed line by line with 1 second intervals. OK over the the BT device. Installed the drivers, and then searched and found the HC-06, connected and paired successfully. Opened the windows terminal program and selected the com port and settings - I get a listing, but it's just a 1 in the ascii dump and FB in the hex window.

I know i've got the correct port as I can remove the connection wire between the PIC and the HC-06 and it stops scrolling. This would also suggest that data of some kind is being sent wireless over the dongle.. but why does it not display "hello" in the ascii dump