'Decade Engineering makes no warranty of any kind with respect ' to the usefulness or correctness of the information supplied ' herein. The user must accept all associated risks. ' 'This file by Michael McCarty, KB8YHV, kb8yhv@amsat.org ' 'The following Pbasic code is for the Parallax Basic Stamp II. 'This file may renamed to anyname.bs2 and used directly with 'the BSII programming software. All text after the ' will be 'ignored when programming the BSII. ' 'The following code allows the BSII to receive NMEA formatted 'serial data from a GPS receiver and write the data as text 'overlay on any video source using the BOB-II board from Decade 'Engineering. My video source is to be a mobile ATV setup in my 'car. ATV is amateur television transmitted by licensed amateur 'radio operators. ' 'The data input was taken as individual strings of text. I tried 'to have the BSII save the numeric strings as single bytes to save 'on variable space. The BSII only has 26 bytes available for 'variables, but there is a tremendous amount of data that can be 'received from a GPS receiver. The conversion from text to a decimal 'equivalent took too much processor time and it ended up missing 'input data. My GPS receiver sends a string every second so for 'the on screen clock to run smoothly with an update every second 'I had to catch all the variables with one command line. The only 'way I found to do it without missing data was to take it as raw 'text with no conversions. I was able to define the data I wanted '(time, latitude, longitude, and which hemisphere for each) in '22 bytes. ' 'id: clears the screen, pauses 100ms (required by BOBII after screen 'clear) and writes my call to upper left of screen ' 'get_data: receives serial data on pin 7 at 4800baud 8N1 (NMEA 'standard for GPS receivers), 2000ms timeout takes it to no_data 'subroutine, otherwise it waits for GPRMC (beginning of NMEA 'sentence) and begins parsing data. Time is then written to upper 'right of screen and receiver status is checked ' 'bad_fix: sends serial data to BOBII on pin 1 at 9600 baud 8N1 'which writes all position data to lower screen and flashes '"last fix" to indicate old data ' 'good_fix: sends serial data to BOBII on pin 1 at 9600 baud 8N1 'which writes all position data to lower screen and writes '"good fix" to indicate the receiver is currently tracking ' 'no_data: if input isn't recieved after 2000ms this sub is called 'which sends data to BOBII to overwrite all position data and 'flash "no serial data" at bottom of screen time var byte(6) latA var byte(4) latB var byte(2) lonA var byte(5) lonB var byte(2) lat_hemi var byte lon_hemi var byte status var byte id: serout 1,85, ["{A"] pause 100 serout 1,85, ["{C0000KB8YHV"] get_data: serin 7,16572,2000,no_data,[wait("GPRMC,"),str time\6,skip 1,status,skip 1,str latA\4,skip 1,str latB\2,skip 3,lat_hemi,skip 1,str lonA\5,skip 1,str lonB\2,skip 3,lon_hemi] serout 1,85, ["{C1600", time(0),time(1), ":",time(2),time(3), ":",time(4),time(5), " UTC"] if status="A"then good_fix if status="V"then bad_fix goto get_data bad_fix: serout 1,85, ["{C0009LAT ", latA(0),latA(1)," ",latA(2),latA(3),".",latB(0),latB(1)," ",lat_hemi," {GELAST FIX{GDLON ",lonA(0),lonA(1),lonA(3)," ",lonA(4),lonA(5),".",lonB(0),lonB(1)," ",lon_hemi," "] goto get_data good_fix: serout 1,85, ["{C0009LAT ", latA(0),latA(1)," ",latA(2),latA(3),".",latB(0),latB(1)," ",lat_hemi," GOOD FIXLON ",lonA(0),lonA(1),lonA(3)," ",lonA(4),lonA(5),".",lonB(0),lonB(1)," ",lon_hemi," "] goto get_data no_data: serout 1,85,["{GE{C0009 NO SERIAL DATA{GD"] goto get_data