'************************************************* '* Download this program and pull the Commit Pin * '* Data downloads at inverted 2400 baud * '* through pgm header * '************************************************* ' {$STAMP BS2pe} ' {$PBASIC 2.5} ' {$PORT COM5} '************************************** '* BalloonSat Extreme Pin Definitions * '************************************** CLK CON 0 CS CON 1 Dat CON 2 Commit CON 3 Servo1 CON 4 Servo2 CON 5 Servo3 CON 6 GPS CON 7 Camera2 CON 8 Camera3 CON 9 Camera1 CON 10 Digital5 CON 11 Digital4 CON 12 Digital3 CON 13 Digital2 CON 14 Digital1 CON 15 '************************************** '* BalloonSat Extreme Variables * '************************************** Record VAR Word WordVariable VAR Word Index VAR Nib MaxAnalog VAR Nib I2400 CON 16780 ' 2400 baud inverted logic DownloadPin CON 15 Flights VAR Word StoredData VAR Byte MaxRecord VAR Word MemoryBank VAR Nib ' keep track of which memory bank is being read Altitude VAR Word MemoryBanks CON 6 ' maximum memory banks being used Begin: IF IN3 = 0 THEN Begin Read_Data: FOR Record = 0 TO 2047 DEBUG "R-", DEC3 Record FOR index = 1 TO MemoryBanks ' SEROUT DownloadPin,I2400,["R-", DEC3 Record] STORE index READ Record,WordVariable.BYTE1 index = index + 1 STORE index READ Record,WordVariable.BYTE0 DEBUG ",", DEC WordVariable ' SEROUT DownloadPin,I2400,[",", DEC WordVariable] NEXT DEBUG CR ' SEROUT DownloadPin,I2400,[CR] NEXT END