Friday, September 26, 2008

Data Logger Test Code

CON
_clkmode= XTAL1 + PLL16X
_xinfreq= 5_000_000
'*********** Runnning at 80MHZ *************
'

OBJ
logg: "Paul_USBdrive" 'Datalogger Object
text: "TV_Text"
delay: "delays"

Var
byte buffer [6]
byte s
PUB main
text.start(12)
logg.start(0,1)
delay.delaySec(1)
if logg.checkErrorCode==0
logg.OpenForWrite(string("text.txt"))
logg.WriteLine(string("ABCDE"))
logg.Close(string("text.txt"))


This code is the working version of our datalogger test. We started programming using the object DataLoggerSPI.spin, this object used SPI interface to communicated between the Prop board and the datalogger. We tried to get the datalogger to initilize using SPI it would not initilize. We found an object in the object exchange that works with the datalogger in UART. After a rewire of the breadboard to utilize UART we modified the code in the DataTest_UART file, the test program now writes a .TXT file to the flash drive and stores ABCDE in that text file.

No comments: