SPLogger: Programming the SPLat board

Programming the SPLat board to work with SPLogger can range from no extra effort, through to a few basic provisions up to creating a moderately sophisticated program.

The minimum consideration you should give to "SPLogging" is to concentrate the data you wish to log into a tight group of RAM locations. The SPLatLink protocol can only extract 16 bytes of contiguous RAM in one message, so the more spread out the RAM locations you are monitoring, the slower it will become.

Here's the quick and dirty SPLat program I used for testing SPLogger in an MMi99 with LCD. It tags all of RAM with its own address. Then it maintains an integer in 1 and a floating point number in 2-5, allowing both to be modified from the MMi99 front panel. Location 0 is used as a trigger by being incremented every second.

      LoadI	128		;Fill all RAM with its own address
Fill
      DecI
      ItoX
      Push
      iStore	
      GoIfNZ      Fill
      fLoadW      3.1415926    ;Set a floating point number
      fStore      2	

Display
      OBLCD_SetCur  0,0
      Recall      1
      OBLCD_HexDispX          ;Display RAM(1)
      fRecallW    2
      OBLCD_fDispW  9,5       ;Display RAM(2) floating point

Loop
      GoIfInK     12,Up       ;Count up integer?
      GoIfInK     11,Dn       ;Count down integer?
      GoIfInK     9,UpFP      ;Increment FP?
      GoIfInK     8,DnFP      ;Decrement FP?
      Test        0           ;Time for a trigger?
      GoIfT       Loop        ;No

;Trigger
      IncM        0           ;Trigger SPLogger
      SetTimer    0,10
      GoTo        Loop

;Increase FP
UpFP
      fRecallW    2
      fLoadQ      1.1111111
      fMul
      fStore      2
      GoTo        Display

;Decrease FP
DnFP
      fRecallW    2
      fLoadQ      0.9
      fMul
      fStore        2
      GoTo        Display

;Count up integer
Up
      IncM        1
      GoTo        Display

;Count down integer
Dn
      DecM        1
      GoTo        Display