Code:
include "modedefs.bas"
DEFINE OSC 48
rx var porta.3
tx var porta.4
data_in var porta.5
data_out var porte.0
CLOCK var porte.1
cs var porte.2
adxl_data_x0 var word
adxl_data_x1 var word
pause 100
high CS
SEROUT tx,T9600,["ADXL 312 Test...",10]
high CLOCK
low cs
shiftout data_out, CLOCK, 2, [%0011000100100000]
high cs
high CLOCK
low cs
shiftout data_out, CLOCK, 2, [%0010111010000000]
high cs
high CLOCK
low cs
shiftout data_out, CLOCK, 2, [%0010111100000000]
high cs
high CLOCK
low cs
shiftout data_out, CLOCK, 2, [%0010110000001010]
high cs
high CLOCK
low cs
shiftout data_out, CLOCK, 2, [%0010110100001000]
high cs
main:
pause 10
high CLOCK
low cs
shiftout data_out, CLOCK, 2, [%10110011]
shiftin data_in, CLOCK, 6, [adxl_data_x1\13]
high CS
high CLOCK
low cs
shiftout data_out, CLOCK, 2, [%10110010]
shiftin data_in, CLOCK, 6, [adxl_data_x0\13]
high CS
SEROUT tx,T9600,["START",10]
SEROUT tx,T9600,[#adxl_data_x0,10]
SEROUT tx,T9600,[#adxl_data_x1,10]
SEROUT tx,T9600,["END",10]
goto main
Bookmarks