LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages

opTST (CMD, ....)

  • System test functions entry
  • This set of commands are for test only as they change behaviour in some driver modules. When test is open every command keeps the test byte codes enabled for 10 seconds
    Parameters
    (DATA8)CMD - Specific command parameter

    • CMD = TST_OPEN
      Enables test byte codes for 10 seconds

    • CMD = TST_CLOSE
      Disables test byte codes

    • CMD = TST_READ_PINS
      Read connector pin status
      • Parameters
        (DATA8)PORT - Input connector [0..3], output connector [16..19]
      • Parameters
        (DATA8)LENGTH - Number of pins in returned string
      • Returns
        (DATA8) STRING - String variable start index ('0' = low, '1' = high)


        Input
        -----—
        STRING[0] Pin1 I_ONx current source control output ['0','1']
        STRING[1] Pin2 LEGDETx ['0','1']
        STRING[2] Pin5 DIGIx0 ['0','1']
        STRING[3] Pin6 DIGIx1 ['0','1']
        STRING[4] - TXINx_EN ['0','1']

        Output
        -----—
        STRING[0] Pin1 MxIN0 ['0','1']
        STRING[1] Pin2 MxIN1 ['0','1']
        STRING[2] Pin5 DETx0 ['0','1']
        STRING[3] Pin5 INTx0 ['0','1']
        STRING[4] Pin6 DIRx ['0','1']

    • CMD = TST_WRITE_PINS
      Write to connector pin
      • Parameters
        (DATA8)PORT - Input connector [0..3], output connector [16..19]
      • Parameters
        (DATA8)LENGTH - Number of pins to write
      • Returns
        (DATA8) STRING - String variable start index ('0' = set low, '1' = set high, 'X' = tristate, '-' = don't touch)


        Input
        -----—
        STRING[0] Pin1 I_ONx current source control output ['0','1','X','-']
        STRING[1] Pin2 LEGDETx ['0','1','X','-']
        STRING[2] Pin5 DIGIx0 ['0','1','X','-']
        STRING[3] Pin6 DIGIx1 ['0','1','X','-']
        STRING[4] - TXINx_EN ['0','1','X','-']

        Output
        -----—
        STRING[0] Pin1 MxIN0 ['0','1','X','-']
        STRING[1] Pin2 MxIN1 ['0','1','X','-']
        STRING[2] Pin5 DETx0 Write ['0','1','X','-']
        STRING[3] Pin5 INTx0 Read ['0','1','X','-']
        STRING[4] Pin6 DIRx ['0','1','X','-']

    • CMD = TST_READ_ADC
      Read raw count from ADC
      • Parameters
        (DATA8)INDEX - Input mapped index (see below) [0..15]
      • Returns
        (DATA16) VALUE - Raw count [0..4095]


        INDEX 0..3 Input connector pin 1 ( 0=conn1, 1=conn2, 2=conn3, 3=conn4)
        INDEX 4..7 Input connector pin 6 ( 4=conn1, 5=conn2, 6=conn3, 7=conn4)
        INDEX 8..11 Output connector pin 5 ( 8=conn1, 9=conn2, 10=conn3, 11=conn4)

        INDEX 12 Battery temperature
        INDEX 13 Current flowing to motors
        INDEX 14 Current flowing from the battery
        INDEX 15 Voltage at battery cell 1, 2, 3,4, 5, and 6

    • CMD = TST_ENABLE_UART
      Enable all UARTs
      • Parameters
        (DATA32)BITRATE - Bit rate [2400..115200 b/S]

    • CMD = TST_WRITE_UART
      Write data to port through UART
      • Parameters
        (DATA8)PORT - Input connector [0..3]
      • Parameters
        (DATA8)LENGTH - Length of string to write [0..63]
      • Parameters
        (DATA8)STRING - String of data

    • CMD = TST_READ_UART
      Read data from port through UART
      • Parameters
        (DATA8)PORT - Input connector [0..3]
      • Parameters
        (DATA8)LENGTH - Length of string to read [0..63]
      • Parameters
        (DATA8)STRING - String of data

    • CMD = TST_DISABLE_UART
      Disable all UARTs


  • CMD = TST_ACCU_SWITCH
    Read accu switch state
    • Returns
      (DATA8) ACTIVE - State [0..1]

  • CMD = TST_BOOT_MODE"
    Turn on mode2


  • CMD = TST_POLL_MODE2
    Read mode2 status
    • Returns
      (DATA8) STATUS - State [0..2]

  • CMD = TST_CLOSE_MODE2
    Closes mode2


  • CMD = TST_RAM_CHECK
    Read RAM test status status
    • Returns
      (DATA8) STATUS - State [0,1] 0 = FAIL, 1 = SUCCESS


      Direct test command examples:
      *
      
      --------------------------------------
      Set DIGIBI0, low
      --------------------------------------
                    v
      12000000000000FF0AFF0D0105842D2D302D2D00
      
      0300000002
      
      --------------------------------------
      Set DIGIBI0, high
      --------------------------------------
                    v
      12000000000000FF0AFF0D0105842D2D312D2D00
      
      0300000002
      
      --------------------------------------
      Set DIGIBI0, float
      --------------------------------------
                    v
      12000000000000FF0AFF0D0105842D2D582D2D00
      
      0300000002
      
      --------------------------------------
      Read ADC value, Port 2, Pin 6
      --------------------------------------
                    v
      0B000000000200FF0AFF0E0560
      
      0500000002xxxx
      xxxx  = A/D count [0..4095]
      
      --------------------------------------
      Activate 9V, Input Port 2
      --------------------------------------
                    v
      12000000000000FF0AFF0D010584312D2D2D2D00
      
      0300000002
      
      --------------------------------------
      Read ADC value, Port 2, Pin 1
      --------------------------------------
                    v
      0B000000000200FF0AFF0E0160
      
      0500000002xxxx
      xxxx  = A/D count [0..4095]
      
      --------------------------------------
      Deactivate 9V, Input Port 2
      --------------------------------------
                    v
      12000000000000FF0AFF0D010584302D2D2D2D00
      
      0300000002
      
      --------------------------------------
      Transmit and receive "UUUUU" on Port 2
      --------------------------------------
                    v
      20000000000500FF0AFF118300C20100FF0F010584555555555500FF10010560FF12
      
      0800000002xxxxxxxxxx
      xxxxxxxxxx = 5555555555 = "UUUUU"
      
      --------------------------------------
      Read rechargeable battery availability
      --------------------------------------
                    v
      0A000000000100FF0AFF1360
      
      0400000002xx
      xx    = SW1     xx = 00 not active, xx = 01 active
      
      
      --------------------------------------
      Check for mode2
      --------------------------------------
      
      Initiate mode2:
                    v
      09000000000000FF0AFF14
      
      0300000002
      
      
      Poll mode2 status:
                    v
      0A000000000100FF0AFF1560
      
      0400000002xx
      
      xx = Mode2 status  xx = 00 success, xx = 01 in progress, xx = 02 error
      
      
      Close mode2:
                    v
      09000000000000FF0AFF16
      
      0300000002
      
      --------------------------------------
      RAM Check poll
      --------------------------------------
      
      Poll RAM check:
                    v
      0A000000000100FF0AFF1760
      
      0400000002xx
      
      xx = RAM check  xx = 00 OK, xx = 02 FAIL
      
      
      ****************************************************************
      **** OTHER FUNCTIONS WITH NORMAL BYTE CODES ********************
      ****************************************************************
      
      --------------------------------------
      Read UI Button status
      --------------------------------------
                    v
      1D000000000600830901608309026183090362830904638309056483090665
      
      0900000002uueeddrrllbb
      uu    = up      uu = 00 not active, uu = 01 active
      ee    = enter   ee = 00 not active, ee = 01 active
      dd    = down    dd = 00 not active, dd = 01 active
      rr    = right   rr = 00 not active, rr = 01 active
      ll    = left    ll = 00 not active, ll = 01 active
      bb    = back    bb = 00 not active, bb = 01 active
      
      --------------------------------------
      Tone 1 KHz, forever
      --------------------------------------
                    v
      0D0000000000009401816482E80300
      
      0300000002
      
      --------------------------------------
      Stop Sound output
      --------------------------------------
                    v
      070000000000009400
      
      0300000002
      
      --------------------------------------
      Show Chess pattern 1 (start with black)
      --------------------------------------
                    v
      160000000000008412008413000000841382550000008400
      
      0300000002
      
      --------------------------------------
      Show Chess pattern 1 (start with white)
      --------------------------------------
                    v
      160000000000008412008413000000841382AA0000008400
      
      0300000002
      
      --------------------------------------
      Clear display again
      --------------------------------------
                    v
      0C00000000000084130000008400
      
      0300000002
      
      --------------------------------------
      Check for SD card
      --------------------------------------
                    v
      0A000000000900811E686064
      
      0C00000002ttttttttffffffffpp
      tttttttt = total size
      ffffffff = free space
      pp       = present [00 = no, 01 = yes]
      
      --------------------------------------
      Bluetooth on and visible
      --------------------------------------
                    v
      13000000000000D4010201D00200D4020201D00200
      
      0300000002
      
      --------------------------------------
      Bluetooth off
      --------------------------------------
                    v
      0C000000000000D4010200D00200
      
      0300000002
      
      *