Hi,

I'm a student learning my way around PICBasic Pro (using a copy
licensed to my school), and I'm having some problems accessing data
via HyperTerminal. Specifically I'm trying to read data from two
AXDL202 accelerometers and one MSI Sensors Accustar Serial Clinometer
being sent to a PIC16F876A. The three sensors send information to one
876A, which transmits the data serially via RF to another 876A, which
I would like to read via Hyperterminal. Unfortunately though, when I
connect to HyperTerminal, I'm not receiving any data, and I have
tested my RF so I know that it is working properly. In addition, I'm
using pins C6 and C7 to connect to the RS232 connectior without a MAX
chip since I seem to recall reading somewhere that those pins can be
used as an internal RS232 buffer to switch the voltage logic.

My code is as follows (I didn't include the initials/variable sections for brevity sake):

First 876A)

accelmeasX1:
pulse_a1x_T2 = 0 'find T2
pulsin xout_a1, 1, pulse_a1x_t1
pulsin xout_a1, 0, temp_x1
pulse_a1x_t2 = pulse_a1x_t2 + temp_x1
pulse_a1x_t2 = pulse_a1x_t2 + pulse_a1x_t1
pulse_a1x_t2 = pulse_a1x_t2 / 10

pulsin xout_a1, 1, pulse_a1x_t1 'read T1

accel1x = (pulse_a1x_t1 / pulse_a1x_t2)
accel1x = accel1x - half_duty
accel1x = accel1x / duty_div
pause 10
goto accelmeasx1

accelmeasY1:
pulse_a1y_T2 = 0 'find T2
pulsin yout_a1, 1, pulse_a1y_t1
pulsin yout_a1, 0, temp_y1
pulse_a1y_t2 = pulse_a1y_t2 + temp_y1
pulse_a1y_t2 = pulse_a1y_t2 + pulse_a1y_t1
pulse_a1y_t2 = pulse_a1y_t2 / 10

pulsin yout_a1, 1, pulse_a1y_t1 'read T1

accel1y = (pulse_a1y_t1 / pulse_a1y_t2)
accel1y = accel1y - half_duty
accel1y = accel1y / duty_div
pause 15
goto accelmeasy1

accelmeasX2:
pulse_a2x_T2 = 0 'find T2
pulsin xout_a2, 1, pulse_a2x_t1
pulsin xout_a2, 0, temp_x2
pulse_a2x_t2 = pulse_a2x_t2 + temp_x2
pulse_a2x_t2 = pulse_a2x_t2 + pulse_a2x_t1
pulse_a2x_t2 = pulse_a2x_t2 / 10

pulsin xout_a2, 1, pulse_a2x_t1 'read T1

accel2x = (pulse_a2x_t1 / pulse_a2x_t2)
accel2x = accel2x - half_duty
accel2x = accel2x / duty_div
pause 20
goto accelmeasx2

accelmeasY2:
pulse_a2y_T2 = 0 'find T2
pulsin yout_a2, 1, pulse_a2y_t1
pulsin yout_a2, 0, temp_y2
pulse_a2y_t2 = pulse_a2y_t2 + temp_y2
pulse_a2y_t2 = pulse_a2y_t2 + pulse_a2y_t1
pulse_a2y_t2 = pulse_a2y_t2 / 10

pulsin yout_a2, 1, pulse_a2y_t1 'read T1

accel2y = (pulse_a2y_t1 / pulse_a2y_t2)
accel2y = accel2y - half_duty
accel2y = accel2y / duty_div
pause 25
goto accelmeasy2


'for tilt #1
init_clin1:
Low TiltReady1
low TiltReq1
If TiltReady1 = 1 then
goto req_clin1
else
goto init_clin1
endif
pause 25

req_clin1:
'while cnt < 17

high TiltReq1
if TiltReady1 = 1 then
goto clin1_prep
else
goto req_clin1
endif

clin1_prep:
if TiltReady1 = 0 then
goto clin1_work
else
goto clin1_prep
endif

clin1_work:
If tiltReady1 = 0 then
tiltreq1 = 0
else
if tiltready1 = 1 then
goto clin1_data
else
goto clin1_work
endif
endif

clin1_data:
high Tiltready1
goto clin1_send

clin1_send:
if tiltready1 = 1 then
Tiltdata1 = clin_data1
goto req_clin1
endif
' cnt = cnt + 1
'wend
goto init_clin1

'for tilt #2
init_clin2:
Low TiltReady2
low TiltReq2
If TiltReady2 = 1 then
goto req_clin2
else
goto init_clin2
endif
pause 25

req_clin2:
'while cnt2 = 17

high TiltReq2
if TiltReady2 = 1 then
goto clin2_prep
else
goto req_clin2
endif

clin2_prep:
if TiltReady2 = 0 then
goto clin2_work
else
goto clin2_prep
endif

clin2_work:
If tiltReady2 = 0 then
tiltreq2 = 0
else
if tiltready2 = 1 then
goto clin2_data
else
goto clin2_work
endif
endif

clin2_data:
high Tiltready2
goto clin2_send

clin2_send:
if tiltready2 = 1 then
Tiltdata2 = clin_data2
goto req_clin2
endif
' cnt2 = cnt2 + 1
' wend
goto init_clin2

btnclk:
'for buttons
Clk_str1 = 0
clk_str2 = 0

if click1 = 1 then
clk_str1 = 1
else
clk_str1 = 0
endif

if click2 = 1 then
clk_str2 = 1
else
clk_str2 = 0
endif
goto btnclk

Send_Data:
'for sending to tx
serout porta.0, n9600, ["ATJHSD"]
serout porta.0, n9600, [accel1x]
pause 5
serout porta.0, n9600, ["BSDFGF"]
serout porta.0, n9600, [accel1y]
pause 5
serout porta.0, n9600, ["CTERT"]
serout porta.0, n9600, [accel2x]
pause 5
serout porta.0, n9600, ["DDFGHT"]
serout porta.0, n9600, [accel2y]
pause 5
serout porta.0, n9600, ["EVBNRG"]
serout porta.0, n9600, [clin_data1]
pause 5
serout porta.0, n9600, ["FPOEQUY"]
serout porta.0, n9600, [clin_data2]
pause 5
serout porta.0, n9600, ["GGHBDG"]
serout porta.0, n9600, [clk_str1]
pause 5
serout porta.0, n9600, ["HDFYEB"]
serout porta.0, n9600, [clk_str2]
pause 5
goto send_data

end


Second 876A)

incoming:
serin portb.0, n9600, 1000, ser_error, ["ATJHSD"], Accel1x
pause 5
serin portb.0, n9600, 1000, ser_error, ["BSDFGF"], Accel1y
pause 5
serin portb.0, n9600, 1000, ser_error, ["CTERT"], Accel2x
pause 5
serin portb.0, n9600, 1000, ser_error, ["DDFGHT"], Accel2y
pause 5
serin portb.0, n9600, 1000, ser_error, ["EVBNRG"], Clin_data1
pause 5
serin portb.0, n9600, 1000, ser_error, ["FPOEQUY"], Clin_data2
pause 5
serin portb.0, n9600, 1000, ser_error, ["GGHBDG"], Clk_str1
pause 5
serin portb.0, n9600, 1000, ser_error, ["HDFYEB"], Clk_str2
pause 5

ser_error:
pause 1000
goto incoming

calc_accel1: 'using pyth triangle
Accel1x = Accel1x * accel1x
accel1y = accel1y * accel1y
accel_1 = accel1x + accel1y
accel_1 = sqr(accel_1)

calc_accel2: 'using pyth triangle
accel2x = accel2x * accel2x
accel2y = accel2y * accel2y
accel_2 = accel2x + accel2y
accel_2 = sqr(accel_2)

calc_pos1: 'x=(1/2)at^2
time = 5
time = time * time
half = 1 / 2
pos1 = half * Accel_1
pos1 = pos1 * time

'if pos > ? then



calc_pos2:
time = 5
time = time * time
pos2 = half * Accel_2
pos2 = pos2 * time


send_data:
serout portc.7, n9600, ["M"]
serout portc.7, n9600, [Accel_1]
pause 5
serout portc.7, n9600, [Accel_2]
pause 5
serout portc.7, n9600, [Clin_data1]
pause 5
serout portc.7, n9600, [clin_data2]
pause 5
serout portc.7, n9600, [pos1]
pause 5
serout portc.7, n9600, [pos2]
pause 5
goto send_data

end



As I said, I'm still learning PBP, so I'm sure that my problem of not
reading any data in HyperTerminal could very well be a gross error
I'm making (I'm using Hellebuyck's PIC Microcontrollers book as a reference). I
was hoping that someone here could point me in the right direction
please? Sorry if this is a simple problem, but I just can't seem to
figure it out.

Thanks!