PDA

View Full Version : Bluetooth wireless with PIC / HSERIN / DAC



rpatel
- 19th December 2004, 17:20
'Wireless sensor using Bluetooth communication'
This is the project that my last thread on DAC (digital to analog converter) construction and use of HSERIN issues are about:
..
I have built mini-modules (1"dia. x 0.5"thick) with:
1. ADXL190 accelerometer sensor
2. PIC18F252
3. Smart M ASY90147
4. Li-polymer coin cell rechargable battery (3.7v x 90mAh)
The sensor feeds analog to PIC18F252 feeding into a ASY90147 Smart Modular Bluetooth module. This module transmits the sensor's data via Bluetooth. To any paired Bluetooth reciever. The baud rate is hardware locked to 115200 from the PIC18F252 and Bluetooth module.
..
I need to build a receiver that expells a -10v to +10v analog output.
..
The completely standalone Bluetooth reciever(master) I have has a RS232 output. (most Bluetooth units perform protocol calculations on the host's cpu) This Bluetooth reciever has the complete protocol stack computation built-inside itself.
..
This RS232 output needs to be translated to the -10v to +10v analog output,(DAC), the data is only 8bit samples, but at 115200bps or 11,520samples/second...
..
My current design for this DAC (digital to analog converter) is:
1. MAX3243 (high speed RS232 transceiver, 120kbps capable)
2. PIC18F252
4. PWM low pass filter (simple R-C circuit)
3. Op-amp
..The RS232 feeds the MAX3243 (RS232 logic levels), the MAX3243 feeds the PIC18F252 (TTL/CMOS logic levels), The PIC18F252 has a PWM output to a low pass R-C filter circuit to give a 0v to 5v analog output, the 5v analog output feeds into a scaling op-amp circuit to give the -10v to +10v output...
..
I have done the following to make DAC (rs232 to -10v to +10v):
* Viewed the data out of the MAX3243 on o-scope, looks correct.
* CANNOT GET THE HSERIN ON PIC18F252 TO WORK
* Tested and verified the HPWM output of PIC18F252 into 0-5v analog output (works nicely).
* performed PSPICE simulation and hand calcs of Op-amp circuit design for scaling 0v to 5v into -10 to +10v .
..
!!pls help me with hserin issue!!
,
regards,

Bruce
- 20th December 2004, 22:13
I'm not sure you'll get the hardware USART to work at 115200 bps, but you can work with this data rate using DEBUG & DEBUGIN.

I've tested this on a 16F876A with max232/PC connection.


DEFINE OSC 20
DEFINE DEBUG_REG PORTC
DEFINE DEBUG_BIT 6 ' USART TX pin
DEFINE DEBUG_MODE 0 ' 0 = true for max232 inversion

DEFINE DEBUGIN_REG PORTC
DEFINE DEBUGIN_BIT 7 ' USART RX pin
DEFINE DEBUGIN_MODE 0

DEFINE DEBUG_BAUD 115200

X VAR BYTE
Y VAR BYTE
Z VAR BYTE

MAIN:
DEBUGIN [WAIT("A"),X,Y,Z]
DEBUG X,Y,Z,13,10
GOTO MAIN

END