Sie sind nicht angemeldet.

Anmelden
Diese Seite kann nicht editiert werden.
 
 
 

Feature Report Protocol

Von $1

    Inhaltsverzeichnis
    Um zurückzugehen, müssen die aktuelle und die ältere Version mit Hilfe der Historie verglichen werden.

    Kombinierter Revisionsvergleich

    Vergleich der Version vom 18:31, 1 Mar 2015 von stephan mit der Version modifiziert am 22:34, 2 Mar 2015 von stephan.

    ...

    Please do only use this low level protocol, if you know why you're doing it. When codingprogramming on a Windows platform, using the supplied Arcaze DLL is generally preferable, as it simplifies and harmonizes usage and also covers changes in the low level protocol. Changes are not overly common, but be aware that the feature report commands are subject to change (as opposed to the DLL functions).

    The main reason to use thisMain reason to use the low level feature report protocol, would be platform independence, as currently there is no Arcaze DLL implementation for other platforms than MS Windows.

    First experiences with the feature report protocol can be collected on the "Low Level Feature Reports" tab of the Arcaze DLL Demo:

    ...

    Multiple Byte values are transmitted with lowest byte first ("Litte Endian" / "LSB first").

    ...

    Command ID Description
    ReadRamCmdIdReadRam 2  Read TransferRAM contents from Arcaze
    WriteToRamCmdIdWriteToRam 3  Write TransferRAM contents in Arcaze
    CopyFlashToRamCmdIdCopyFlashToRam 4  Copy Flash contents to TransferRAM
    ClearFlashCmdIdClearFlash 5  Erase a flash sector
    ProgRamToFlashCmdIdProgRamToFlash 6  Program Flash sector from TransferRAM
    ClearRamCmdIdClearRam 7  Clear TransferRAM contents

    ...

    Command ID Description
    CmdIdSetPadMode 9 obsolete ValidateConfigCmdIdReadDebugInfo 1210 Validate a configuration after only usable in manufacturing/production environment CmdIdValidateConfig 12  copying it to flash.
    InvalidateConfigCmdIdInvalidateConfig 13   CmdIDEnumerate 14   CmdIdReadBootSerialNumber 15  Invalidate a configuration. Arcaze will not use it anymore.
    ReadStatusCmdIdReadConfigSerialNumber 1716  Reads status of configuration (valid / invalid)
    ReadConfigNumberCmdIdReadStatus 1817  Reads ID of the currently active configuration
    StartMacrosCmdIdReadConfigNumber 2118  Start execution of all macros in configuration
    StopMacrosCmdIdGetPadMode 2220  Stop execution of all macros in configuration
    SetConfigCmdIdStartMacros 2821  Activates a specific configuration
    ResetCmdIdStopMacros 25222  Soft-Resets the whole Arcaze USB-Interface
    ReadBootSerialNumberCmdIdPrintMacros 25323  Reads base serial number of the USB-Interface
    EnumerateCmdIdSetTimerIRQ 25424  Resets the USB bus only / Re-Enumerates
    InvalidateFirmwareCmdIdPrintInReports 25525 Invalidates the firmware. Firmware update will be mandatory after this command!only usable in manufacturing/production environment

    OnboardOnboard Port Commands

    Quadrature Encoder CommandsCommandIDDescription
    Command ID Description
    ReadPortsCmdIdReadPorts 8  
    CmdIdPrintADC 26 only usable in manufacturing/production environment ReadADCCmdIdReadADC 27  
    CmdIdSetConfig 28   SetPinDirectionCmdIdSetPinDirection 29  
    SetPinCmdIdSetPin 30  
    SetPortDirectionCmdIdSetPortDirection 31  
    SetPortCmdIdSetPort 32  
    ReadQuadratureEncodersCmdIdReadQuadratureEncoders 44  
    ReadPortsWithHistoryCmdIdReadPortsWithHistory 45  

    ...

    Note about Leading ZeroAttention: Note that, when

    When using the Microsoft UsbHid implementation, there is a leading zero as the first byte of each feature report. This byte is returned with every in report and is required in every out report. This byte is not part of the payload and can not be used for anything. We did not remove it in the implementation of the Demo, to make you aware of this. But it is not documented in the Command descriptions below, as it is not part of the protocol. In different implementations of UsbHid this will be different.has to be

    So, be aware that when using MS Windows, compared to this documentation, you will additionally be receiving a leading zero in front of each in report and will be required to additionally prefix a leading zero in front of each of your out reports!aprefix zero byte attached to all reports

    Status Return Valuesdefined below

    Many commands return a status value. This can be one of the following values:.Thismay not be required on different platforms

    Name Value
    STATUS_SUCCESS 0
    STATUS_WRITE_OUTSIDE_RAM 1
    STATUS_READ_OUTSIDE_RAM 2
    STATUS_WRONG_SECTOR 3
    STATUS_FLASH_FAILURE 4
    STATUS_COMMAND_NOT_IMPLEMENTED 5
    STATUS_WRONG_HASH 6
    STATUS_INVALID_PORT_NUMBER 7

    {{ simpsol.pagebreak{}. }}

    ...

    READ_RAMCMD_READ_RAM (2)

    ...

    Address Content Value Length
    (Bytes)
    Remarks
    0 Command 20d2 1  CMD_READ_RAM
    1 Address   2  Start address for read. This is the relative address inside the TransferRAM, first byte has address 0.
    3…63  Not used      Not used

    ...

    Address Content Value Length
    (Bytes)
    Remarks
    0 Command 20d2 1 CMD_READ_TRANSFER_RAM
    1 StatusRetVal   1 Status Return Value
    2 Address   2 Base address of Data
    4 Length   12 Number of valid bytes in this report
    56…63 Payload   58 Payload data

    ...

    WRITE_RAMCMD_WRITE_RAM (3)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 30d3 1 CMD_WRITE_RAM
    1 Address   2 Start address for write. This is the relative address inside the Flash RAM, first byte has address 0.
    3 Length   12 Number of bytes to write in this report.
    4…615…63  Payload    58 Payload (maximum size is 58 bytes!)Not used

    ...

    COPY_FLASH_TO_RAMCMD_COPY_FLASH_TO_RAM (4)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 40d4 1 CMD_COPY_FLASH_TO_RAM
    1 SectorID   1 Sector ID to be read. Refer to sector table.
    2…63  Not used     Not used

    ...

    CLEAR_FLASHCMD_CLEAR_FLASH (5)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 50d5 1  CMD_CLEAR_FLASH
    1 SectorID   1  Sector ID to be erasedread. Refer to sector table.
    2…63  Not used      Not used

    ...

    COPY_RAM_TO_FLASHCMD_COPY_RAM_TO_FLASH (6)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 60d6 1  CMD_COPY_RAM_TO_FLASH
    1 Return Value   1  Return Value refer to table of return value tablestatus return values

    ...

    CLEAR_RAMCMD_CLEAR_RAM (7)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 70d7 1  CMD_CLEAR_RAM
    1...63        Not used

    ...

    System Commands

    TBD

    {{ simpsol.pagebreak{} }}

    ...

    READ_PORTSCMD_ID_READ_PORTS (8)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 80d8 1 CMD_ID_READ_PORTS
    1...63       Not used

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 80d 1 CMD_ID_READ_PORTS
    1 StatusReturn 0 1 STATUS_SUCCESS
    2 Reserved x 1 Reserved (was LastChanged, but currently not implemented)Value
     3 Port A1 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    4 Port A2 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    5 Port A3 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    6 Port A4 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    7 Port A5 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    8 Port A6 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    9 Port A7 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    10 Port A8 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    11 Port A9 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    12 Port A10 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    13 Port A11 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    14 Port A12 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    15 Port A13 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    16 Port A14 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    17 Port A15 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    18 Port A16 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    19 Port A17 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    20 Port A18 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    21 Port A19 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    22 Port A20 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    23 Port B1 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    24 Port B2 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    25 Port B3 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    26 Port B4 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    27 Port B5 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    28 Port B6 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    29 Port B7 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    30 Port B8 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    31 Port B9 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    32 Port B10 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    33 Port B11 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    34 Port B12 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    35 Port B13 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    36 Port B14 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    37 Port B15 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    38 Port B16 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    39 Port B17 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    40 Port B18 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    41 Port B19 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    42 Port B20 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    43...63 not used 0   not used

    ...

    CMD_READ_ADC (2710)

    Reads 8 bit representations of ADC values of the 6 internal ADCs. Item size is 16 bits, but in Arcaze USB-Interface V3 only 10 bits are used. In Arcaze USB-Interface V4, 12 bits are used.This will soon be replaced by a 16 bit version.

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 270d10 1 CMD_READ_ADCCMD_
    1...63       Not used

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 270d10 1 CMD_READ_ADC
    1 Status   1  
    2 ADC port 0 (AIN 1) value (LSB first)   21  
    42 ADC port 1 (AIN 2) value (LSB first)   21  
    63 ADC port 2 (AIN 3) value (LSB first)   21  
    84 ADC port 3 (AIN 4) value (LSB first)   21  
    105 ADC port 4 (AIN 5) value (LSB first)   21  
    126 ADC port 5 (AIN 6) value (LSB first)   2  
    14...63 not used      

    {{ simpsol.pagebreak{} }}

    SET_PIN_DIRECTION (29)

    Sets I/O direction of a single onboard I/O pin.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 29 1 CMD_SET_PIN_DIRECTION
    1 NumPin 0...39 1 Number of onboard pin. 0...19=Port A, 20...39=Port B
    2 Direction 0 or 1 1 0=Input / 1=Output
    3...63 not used     Not used

    {{ simpsol.pagebreak{} }}

    SET_PIN (30)

    Sets output level of a single onboard I/O pin.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 30 1 CMD_SET_PIN
    1 NumPin 0...39 1 Number of onboard pin. 0...19=Port A, 20...39=Port B
    2 Value 0 or 1 1 0=Low / 1=High
    3...63 not used     Not used

    Physically 0 means low = 0V and 1 means high = 3.3V.

    {{ simpsol.pagebreak{} }}

    SET_PORT_DIRECTION (31)

    Sets pin directions of all pins of a complete onboard I/O port (A or B). All 20 pins directions of the selected port are being overwritten.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 31 1 CMD_SET_PORT_DIRECTION
    1 NumPort 0...1 1 Number of onboard port 0=Port A, 1=Port B
    2 Directions 0...0xfffff 4 Bitmask:
    Bit 0 = pin 0 of selected port, bit 19= pin 19 of selected port.
    Bit value 0=input / bit value 1=output
    6...63 not used     Not used

    {{ simpsol.pagebreak{} }}

    SET_PORT (32)

    Sets pin output values of all pins of a complete onboard I/O port (A or B). All 20 pins output values of the selected port are being overwritten.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 32 1 CMD_SET_PORT
    1 NumPort 0...1 1 Number of onboard port 0=Port A, 1=Port B
    2 Values 0...0xfffff 4 Bitmask:
    Bit 0 = pin 0 of selected port, bit 19= pin 19 of selected port.
    Bit value 0=output low / bit value 1=output high
    6 Action 0=on
    1=off
    2= set
     

    Selects how the port values are used:
    - On means that for each 1-bit in the port values mask a pin is being set to high and the others are not touched.
    - Off means that for each 1-bit in the port values mask a pin is being set to low and the others are not touched.
    - Set meand that all values are copied 1:1 to the ports. 1's become output highs and 0's become lows. No pins of the addressed port stay untouched.

    7...63 not used     Not used

    {{ simpsol.pagebreak{} }}

    READ_QUADRATURE_ENCODERS (44)

    Read quadrature encoder values.

    Quadrature encoders can be connected to each neighbouring pair of pins like A1/2, A3/4, ... , B37/39, B39/40. So, total of 20 quadrature encoders can be connected. Each of these quadrature encoders is represented by a 16 bit signed integer value in this in report. It counts up when turned to one direction and counts down when turned to the other direction. It overflows from -32768 to 32767 and vice versa.

    The values are not being reset at any time. To follow the rotation of a quadrature encoder, the value has to sampled twice and the difference between the values represents the number of pulses, the encoder has been rotated in the meantime.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 44 1 CMD_READ_QUADRATURE_ENCODERS
    1...63 not used     Not used
    In  Report
    Address Content Value Length (Bytes) Remarks
    0 Command 0d 1 CMD_READ_QUADRATURE_ENCODERS
    1 Status Return Value 0 1 SUCCESS
    2 EncoderValues -32768...32767 40 (2 bytes each) Quadrature encoder counter values 0...19
             

    {{ simpsol.pagebreak{} }}

    READ_PORTS_WITH_HISTORY (45)

    This is a more sophisticated version of the READ_PORTS command.

    In addition to the current state of each onboard I/O pin, it also returns the number of changes each pin has experienced since the last READ_PORTS_WITH_HISTORY command. This can be helpful to find out, if any changes on a port have been missed since reading the port last time. Reasons may be insufficient polling frequency or bouncing of a switch for example.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 45 1 READ_PORTS_WITH_HISTORY
    1...63 not used     Not used
    In  Report
    Address Content Value Length (Bytes) Remarks
    0 Command 45 1 READ_PORTS_WITH_HISTORY
    1 Status Return Value 0 1 SUCCESS
    2 LastChanged 0...40   0: no changes since last call
    1...20: Last change was on Port A1...A20
    21...40: Last change was on Port B1...B20
    3 InputData bitmask 20 (1 byte per pin) Bit 0: Current State of this Pin
    Bit 1..7: Number of changes on this pin since last call of READ_PORTS_WITH_HISTORY
    4...63 not used      

    The last changed value shows, which pin has changed last. In some situations it saves time to know this immediately.

    ...

    Andere Änderungen:

    1. /body/table[23]/tbody/tr[6]/td[5]/@colspan: keine ⇒ "3"

    Version vom 18:31, 1 Mar 2015

    Diese Revision wurde von stephan (Sperren) verändert

    ...

    Please do only use this low level protocol, if you know why you're doing it. When programming on a Windows platform, using the supplied Arcaze DLL is generally preferable, as it simplifies and harmonizes usage and also covers changes in the low level protocol. Changes are not overly common, but be aware that the feature report commands are subject to change (as opposed to the DLL functions).

    Main reason to use the low level feature report protocol, would platform independence, as currently there is no Arcaze DLL implementation for other platforms than MS Windows.

    ...

    Command ID Description
    CmdIdReadRam 2  
    CmdIdWriteToRam 3  
    CmdIdCopyFlashToRam 4  
    CmdIdClearFlash 5  
    CmdIdProgRamToFlash 6  
    CmdIdClearRam 7  

    ...

    Command ID Description
    CmdIdSetPadMode 9 obsolete
    CmdIdReadDebugInfo 10 only usable in manufacturing/production environment
    CmdIdValidateConfig 12  
    CmdIdInvalidateConfig 13  
    CmdIDEnumerate 14  
    CmdIdReadBootSerialNumber 15  
    CmdIdReadConfigSerialNumber 16  
    CmdIdReadStatus 17  
    CmdIdReadConfigNumber 18  
    CmdIdGetPadMode 20  
    CmdIdStartMacros 21  
    CmdIdStopMacros 22  
    CmdIdPrintMacros 23  
    CmdIdSetTimerIRQ 24  
    CmdIdPrintInReports 25 only usable in manufacturing/production environment

    Onboard Port Commands

    Command ID Description
    CmdIdReadPorts 8  
    CmdIdPrintADC 26 only usable in manufacturing/production environment
    CmdIdReadADC 27  
    CmdIdSetConfig 28  
    CmdIdSetPinDirection 29  
    CmdIdSetPin 30  
    CmdIdSetPortDirection 31  
    CmdIdSetPort 32  

    Quadrature Encoder Commands

    Command ID Description
    CmdIdReadQuadratureEncoders 44  
    CmdIdReadPortsWithHistory 45  

    ...

    Attention: Note that, when using the Microsoft UsbHid implementation, there has to be a prefix zero byte attached to all reports defined below. This may not be required on different platforms.

    ...

    CMD_READ_RAM (2)

    ...

    Address Content Value Length
    (Bytes)
    Remarks
    0 Command 0d2 1  CMD_READ_RAM
    1 Address   2  Start address for read. This is the relative address inside the TransferRAM, first byte has address 0.
    3…63        Not used

    ...

    Address Content Value Length
    (Bytes)
    Remarks
    0 Command 0d2 1 CMD_READ_TRANSFER_RAM
    1 RetVal   1 Return Value
    2 Address   2 Base address of Data
    4 Length   2 Number of valid bytes in this report
    6…63 Payload   58 Payload data

    ...

    CMD_WRITE_RAM (3)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d3 1 CMD_WRITE_RAM
    1 Address   2 Start address for write. This is the relative address inside the Flash RAM, first byte has address 0.
    3 Length   2 Number of bytes to write in this report.
    5…63       Not used

    ...

    CMD_COPY_FLASH_TO_RAM (4)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d4 1 CMD_COPY_FLASH_TO_RAM
    1 SectorID   1 Sector ID to be read. Refer to sector table.
    2…63       Not used

    ...

    CMD_CLEAR_FLASH (5)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d5 1  CMD_CLEAR_FLASH
    1 SectorID   1  Sector ID to be read. Refer to sector table.
    2…63        Not used

    ...

    CMD_COPY_RAM_TO_FLASH (6)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d6 1  CMD_COPY_RAM_TO_FLASH
    1 Return Value   1  Return Value refer to return value table

    ...

    CMD_CLEAR_RAM (7)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d7 1  CMD_CLEAR_RAM
    1...63        Not used

    ...

    CMD_ID_READ_PORTS (8)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d8 1 CMD_ID_READ_PORTS
    1...63       Not used

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d 1 CMD_ID_READ_PORTS
    1 Return Value   1  

    ...

    CMD_READ_ADC (10)

    Reads 8 bit representations of ADC values of the 6 internal ADCs. This will soon be replaced by a 16 bit version.

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d10 1 CMD_
    1...63       Not used

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 0d10 1 CMD_READ_ADC
    1 ADC port 0 (AIN 1) value   1  
    2 ADC port 1 (AIN 2) value   1  
    3 ADC port 2 (AIN 3) value   1  
    4 ADC port 3 (AIN 4) value   1  
    5 ADC port 4 (AIN 5) value   1  
    6 ADC port 5 (AIN 6) value   1  
    7...63       not used

    ...

    Version seit 22:34, 2 Mar 2015

    Diese Revision wurde von stephan (Sperren) verändert

    ...

    Please do only use this low level protocol, if you know why you're doing it. When coding on a Windows platform, using the supplied Arcaze DLL is generally preferable, as it simplifies and harmonizes usage and also covers changes in the low level protocol. Changes are not overly common, but be aware that the feature report commands are subject to change (as opposed to the DLL functions).

    The main reason to use this low level feature report protocol, would be platform independence, as currently there is no Arcaze DLL implementation for other platforms than MS Windows.

    First experiences with the feature report protocol can be collected on the "Low Level Feature Reports" tab of the Arcaze DLL Demo:

    ...

    Multiple Byte values are transmitted with lowest byte first ("Litte Endian" / "LSB first").

    ...

    Command ID Description
    ReadRam 2 Read TransferRAM contents from Arcaze
    WriteToRam 3 Write TransferRAM contents in Arcaze
    CopyFlashToRam 4 Copy Flash contents to TransferRAM
    ClearFlash 5 Erase a flash sector
    ProgRamToFlash 6 Program Flash sector from TransferRAM
    ClearRam 7 Clear TransferRAM contents

    ...

    Command ID Description
    ValidateConfig 12 Validate a configuration after copying it to flash.
    InvalidateConfig 13 Invalidate a configuration. Arcaze will not use it anymore.
    ReadStatus 17 Reads status of configuration (valid / invalid)
    ReadConfigNumber 18 Reads ID of the currently active configuration
    StartMacros 21 Start execution of all macros in configuration
    StopMacros 22 Stop execution of all macros in configuration
    SetConfig 28 Activates a specific configuration
    Reset 252 Soft-Resets the whole Arcaze USB-Interface
    ReadBootSerialNumber 253 Reads base serial number of the USB-Interface
    Enumerate 254 Resets the USB bus only / Re-Enumerates
    InvalidateFirmware 255 Invalidates the firmware. Firmware update will be mandatory after this command!

    Onboard Port Commands

    Command ID Description
    ReadPorts 8  
    ReadADC 27  
    SetPinDirection 29  
    SetPin 30  
    SetPortDirection 31  
    SetPort 32  
    ReadQuadratureEncoders 44  
    ReadPortsWithHistory 45  

    ...

    Note about Leading Zero

    When using the Microsoft UsbHid implementation, there is a leading zero as the first byte of each feature report. This byte is returned with every in report and is required in every out report. This byte is not part of the payload and can not be used for anything. We did not remove it in the implementation of the Demo, to make you aware of this. But it is not documented in the Command descriptions below, as it is not part of the protocol. In different implementations of UsbHid this will be different.

    So, be aware that when using MS Windows, compared to this documentation, you will additionally be receiving a leading zero in front of each in report and will be required to additionally prefix a leading zero in front of each of your out reports!

    Status Return Values

    Many commands return a status value. This can be one of the following values:

    Name Value
    STATUS_SUCCESS 0
    STATUS_WRITE_OUTSIDE_RAM 1
    STATUS_READ_OUTSIDE_RAM 2
    STATUS_WRONG_SECTOR 3
    STATUS_FLASH_FAILURE 4
    STATUS_COMMAND_NOT_IMPLEMENTED 5
    STATUS_WRONG_HASH 6
    STATUS_INVALID_PORT_NUMBER 7

    {{ simpsol.pagebreak{} }}

    ...

    READ_RAM (2)

    ...

    Address Content Value Length
    (Bytes)
    Remarks
    0 Command 2 1  CMD_READ_RAM
    1 Address   2  Start address for read. This is the relative address inside the TransferRAM, first byte has address 0.
    3…63 Not used     Not used

    ...

    Address Content Value Length
    (Bytes)
    Remarks
    0 Command 2 1 CMD_READ_TRANSFER_RAM
    1 Status   1 Status Return Value
    2 Address   2 Base address of Data
    4 Length   1 Number of valid bytes in this report
    5…63 Payload   58 Payload data

    ...

    WRITE_RAM (3)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 3 1 CMD_WRITE_RAM
    1 Address   2 Start address for write. This is the relative address inside the Flash RAM, first byte has address 0.
    3 Length   1 Number of bytes to write in this report.
    4…61 Payload   58 Payload (maximum size is 58 bytes!)

    ...

    COPY_FLASH_TO_RAM (4)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 4 1 CMD_COPY_FLASH_TO_RAM
    1 SectorID   1 Sector ID to be read. Refer to sector table.
    2…63 Not used     Not used

    ...

    CLEAR_FLASH (5)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 5 1  CMD_CLEAR_FLASH
    1 SectorID   1  Sector ID to be erased. Refer to sector table.
    2…63 Not used      Not used

    ...

    COPY_RAM_TO_FLASH (6)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 6 1  CMD_COPY_RAM_TO_FLASH
    1 Return Value   1  Return Value refer to table of status return values

    ...

    CLEAR_RAM (7)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 7 1  CMD_CLEAR_RAM
    1...63        Not used

    ...

    System Commands

    TBD

    {{ simpsol.pagebreak{} }}

    ...

    READ_PORTS (8)

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 8 1 CMD_ID_READ_PORTS
    1...63       Not used

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 8 1 CMD_ID_READ_PORTS
    1 Status 0 1 STATUS_SUCCESS
    2 Reserved x 1 Reserved (was LastChanged, but currently not implemented)
    3 Port A1 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    4 Port A2 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    5 Port A3 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    6 Port A4 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    7 Port A5 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    8 Port A6 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    9 Port A7 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    10 Port A8 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    11 Port A9 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    12 Port A10 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    13 Port A11 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    14 Port A12 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    15 Port A13 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    16 Port A14 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    17 Port A15 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    18 Port A16 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    19 Port A17 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    20 Port A18 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    21 Port A19 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    22 Port A20 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    23 Port B1 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    24 Port B2 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    25 Port B3 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    26 Port B4 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    27 Port B5 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    28 Port B6 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    29 Port B7 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    30 Port B8 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    31 Port B9 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    32 Port B10 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    33 Port B11 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    34 Port B12 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    35 Port B13 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    36 Port B14 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    37 Port B15 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    38 Port B16 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    39 Port B17 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    40 Port B18 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    41 Port B19 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    42 Port B20 value 0 or 1 1 Actually only Bit 0 is used. Bits 1...7 are always 1
    43...63 not used 0   not used

    ...

    CMD_READ_ADC (27)

    Reads ADC values of the 6 internal ADCs. Item size is 16 bits, but in Arcaze USB-Interface V3 only 10 bits are used. In Arcaze USB-Interface V4, 12 bits are used.

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 27 1 CMD_READ_ADC
    1...63       Not used

    ...

    Address Content Value Length (Bytes) Remarks
    0 Command 27 1 CMD_READ_ADC
    1 Status   1  
    2 ADC port 0 (AIN 1) value (LSB first)   2  
    4 ADC port 1 (AIN 2) value (LSB first)   2  
    6 ADC port 2 (AIN 3) value (LSB first)   2  
    8 ADC port 3 (AIN 4) value (LSB first)   2  
    10 ADC port 4 (AIN 5) value (LSB first)   2  
    12 ADC port 5 (AIN 6) value (LSB first)   2  
    14...63 not used      

    {{ simpsol.pagebreak{} }}

    SET_PIN_DIRECTION (29)

    Sets I/O direction of a single onboard I/O pin.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 29 1 CMD_SET_PIN_DIRECTION
    1 NumPin 0...39 1 Number of onboard pin. 0...19=Port A, 20...39=Port B
    2 Direction 0 or 1 1 0=Input / 1=Output
    3...63 not used     Not used

    {{ simpsol.pagebreak{} }}

    SET_PIN (30)

    Sets output level of a single onboard I/O pin.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 30 1 CMD_SET_PIN
    1 NumPin 0...39 1 Number of onboard pin. 0...19=Port A, 20...39=Port B
    2 Value 0 or 1 1 0=Low / 1=High
    3...63 not used     Not used

    Physically 0 means low = 0V and 1 means high = 3.3V.

    {{ simpsol.pagebreak{} }}

    SET_PORT_DIRECTION (31)

    Sets pin directions of all pins of a complete onboard I/O port (A or B). All 20 pins directions of the selected port are being overwritten.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 31 1 CMD_SET_PORT_DIRECTION
    1 NumPort 0...1 1 Number of onboard port 0=Port A, 1=Port B
    2 Directions 0...0xfffff 4 Bitmask:
    Bit 0 = pin 0 of selected port, bit 19= pin 19 of selected port.
    Bit value 0=input / bit value 1=output
    6...63 not used     Not used

    {{ simpsol.pagebreak{} }}

    SET_PORT (32)

    Sets pin output values of all pins of a complete onboard I/O port (A or B). All 20 pins output values of the selected port are being overwritten.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 32 1 CMD_SET_PORT
    1 NumPort 0...1 1 Number of onboard port 0=Port A, 1=Port B
    2 Values 0...0xfffff 4 Bitmask:
    Bit 0 = pin 0 of selected port, bit 19= pin 19 of selected port.
    Bit value 0=output low / bit value 1=output high
    6 Action 0=on
    1=off
    2= set
     

    Selects how the port values are used:
    - On means that for each 1-bit in the port values mask a pin is being set to high and the others are not touched.
    - Off means that for each 1-bit in the port values mask a pin is being set to low and the others are not touched.
    - Set meand that all values are copied 1:1 to the ports. 1's become output highs and 0's become lows. No pins of the addressed port stay untouched.

    7...63 not used     Not used

    {{ simpsol.pagebreak{} }}

    READ_QUADRATURE_ENCODERS (44)

    Read quadrature encoder values.

    Quadrature encoders can be connected to each neighbouring pair of pins like A1/2, A3/4, ... , B37/39, B39/40. So, total of 20 quadrature encoders can be connected. Each of these quadrature encoders is represented by a 16 bit signed integer value in this in report. It counts up when turned to one direction and counts down when turned to the other direction. It overflows from -32768 to 32767 and vice versa.

    The values are not being reset at any time. To follow the rotation of a quadrature encoder, the value has to sampled twice and the difference between the values represents the number of pulses, the encoder has been rotated in the meantime.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 44 1 CMD_READ_QUADRATURE_ENCODERS
    1...63 not used     Not used
    In  Report
    Address Content Value Length (Bytes) Remarks
    0 Command 0d 1 CMD_READ_QUADRATURE_ENCODERS
    1 Status Return Value 0 1 SUCCESS
    2 EncoderValues -32768...32767 40 (2 bytes each) Quadrature encoder counter values 0...19
             

    {{ simpsol.pagebreak{} }}

    READ_PORTS_WITH_HISTORY (45)

    This is a more sophisticated version of the READ_PORTS command.

    In addition to the current state of each onboard I/O pin, it also returns the number of changes each pin has experienced since the last READ_PORTS_WITH_HISTORY command. This can be helpful to find out, if any changes on a port have been missed since reading the port last time. Reasons may be insufficient polling frequency or bouncing of a switch for example.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 45 1 READ_PORTS_WITH_HISTORY
    1...63 not used     Not used
    In  Report
    Address Content Value Length (Bytes) Remarks
    0 Command 45 1 READ_PORTS_WITH_HISTORY
    1 Status Return Value 0 1 SUCCESS
    2 LastChanged 0...40   0: no changes since last call
    1...20: Last change was on Port A1...A20
    21...40: Last change was on Port B1...B20
    3 InputData bitmask 20 (1 byte per pin) Bit 0: Current State of this Pin
    Bit 1..7: Number of changes on this pin since last call of READ_PORTS_WITH_HISTORY
    4...63 not used      

    The last changed value shows, which pin has changed last. In some situations it saves time to know this immediately.

    ...

     
    © Simple Solutions  •  Impressum  •  Wiki powered by Mindtouch