You are not logged in.

Log in
Page last modified 04:43, 8 Mar 2015 by stephan
 
 
 

Feature Report Protocol

From $1

    Table of contents
    1. 1. Introduction
    2. 2. Implementation
      1. 2.1. HIDAPI
    3. 3. Command Reference
      1. 3.1. Memory Access Commands
      2. 3.2. System Commands
      3. 3.3. Onboard Port Commands
      4. 3.4. Display Driver Commands
      5. 3.5. LED Driver 2 Commands
      6. 3.6. LED Driver 3 Commands
    4. 4. Command Descriptions
      1. 4.1. Feature Report Length & Report ID
      2. 4.2. Status Return Values
      3. 4.3. Memory Access Commands
        1. 4.3.1. READ_RAM (2)
          1. 4.3.1.1. Out Report
          2. 4.3.1.2. In Report 
        2. 4.3.2. WRITE_RAM (3)
          1. 4.3.2.1. Out Report
        3. 4.3.3. COPY_FLASH_TO_RAM (4)
          1. 4.3.3.1. Out Report
        4. 4.3.4. CLEAR_FLASH (5)
          1. 4.3.4.1. Out Report
        5. 4.3.5. COPY_RAM_TO_FLASH (6)
          1. 4.3.5.1. Out Report
          2. 4.3.5.2. In  Report
        6. 4.3.6. CLEAR_RAM (7)
          1. 4.3.6.1. Out Report
      4. 4.4. System Commands
      5. 4.5. Onboard Port Commands
        1. 4.5.1. READ_PORTS (8)
          1. 4.5.1.1. Out Report
          2. 4.5.1.2. In  Report
        2. 4.5.2. CMD_READ_ADC (27)
          1. 4.5.2.1. Out Report
          2. 4.5.2.2. In  Report
        3. 4.5.3. SET_PIN_DIRECTION (29)
          1. 4.5.3.1. Out Report
        4. 4.5.4. SET_PIN (30)
          1. 4.5.4.1. Out Report
        5. 4.5.5. SET_PORT_DIRECTION (31)
          1. 4.5.5.1. Out Report
        6. 4.5.6. SET_PORT (32)
          1. 4.5.6.1. Out Report
        7. 4.5.7. READ_QUADRATURE_ENCODERS (44)
          1. 4.5.7.1. Out Report
          2. 4.5.7.2. In  Report
        8. 4.5.8. READ_PORTS_WITH_HISTORY (45)
          1. 4.5.8.1. Out Report
          2. 4.5.8.2. In  Report
      6. 4.6. Display Driver Commands
        1. 4.6.1. Display Driver Basics
          1. 4.6.1.1. Display Driver Types
            1. 4.6.1.1.1. Display Driver 1
            2. 4.6.1.1.2. Display Driver 32
          2. 4.6.1.2. Decode Mode
            1. 4.6.1.2.1. Decode Mode = 0 / Bitmapped Mode
            2. 4.6.1.2.2. Decode Mode = 1 / Code B Decoding
        2. 4.6.2. MAX7219_DISPLAY_INIT (33)
          1. 4.6.2.1. Out Report
        3. 4.6.3. MAX7219_WRITE_DIGITS (36)
          1. 4.6.3.1. Out Report
          2. 4.6.3.2. Example Command

    Introduction

    This is the documentation of the low level feature report protocol of the Arcaze USB-Interface.

    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:

    2015-03-02_08h00_12.png

     

    Implementation

    There are various libraries simplifiying the transfer of USB feature reports on different operating systems. Some of them will be shown here. Feel free to contribute your favorite API.

    HIDAPI

    The HIDAPI library is available for Windows, Linux, and Mac OS X based platforms. Documentation and download are available here: http://www.signal11.us/oss/hidapi/

    Basic communication can be as simple as this (minus all error checking):

    // Establish USB connection
    handle = hid_open(0x1690, 0xfe13, NULL);
    
    // Prepare out report data ("Read Ports" command)
    buf[0] = 0x00;  
    buf[1] = 0x08;
    
    // Send out report
    res = hid_send_feature_report(handle, buf, 65);
    
    // Receive in report
    res = hid_get_feature_report(handle, buf, sizeof(buf));
    

    Command Reference

    All command IDs are noted in decimal.

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

    Memory Access Commands

    These commands are used to write a new configuration to the Arcaze USB-Interface.
     

    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

    System Commands

    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  

    Display Driver Commands

    Command ID Description
    CmdIdMax7219DisplayInit 33  
    CmdIdMax7219WriteReg 34  
    CmdIdMax7219ReadReg 35  
    CmdIdMax7219WriteDigits 36  

    LED Driver 2 Commands

    Command ID Description
    CmdIdTlc5926Init 37  
    CmdIdTlc5926WriteLeds 38  
    CmdIdTlc5926StrobeEnable 39  

    LED Driver 3 Commands

    Command ID Description
    CmdIdTlc5943Init 40  
    CmdIdTlc5943WriteLeds1Bit 41  
    CmdIdTlc5943WriteLeds8Bit 42  
    CmdIdTlc5943Strobe 43  

     

     

    Command Descriptions

    Feature Report Length & Report ID

    All in and out feature reports are 64 bytes long, without any exception. Do not send a different number of bytes.

    But be aware of the Feature Report ID. On MS Windows based systems, this ID normally is simply prefixed to the actual feature report data. Therefore the feature report data actually sent/received is one byte longer than described in the command descriptions below, which don't include it, as it's not part of the protocol.

    Currently we are not using the USB Feature Report IDs, therefore this byte is always 0x00.

    To conclude:

    • If your USB stack requires the Report ID to be included with the report data, always send 65 bytes. First byte is 0x00 and Command starts at second byte.
    • Otherwise send and receive 64 bytes.

    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

    Memory Access Commands

    READ_RAM (2)

    Read Data from the TransferRAM. This is mainly used together with CMD_COPY_FLASH_TO_RAM.

    The Out Feature Report sets the base address of the data to be read. With every In Feature Report the base address is incremented by the number of received bytes. Therefore it's also possible to do "burst reads" with one Out Report, setting the start address and multiple In Reports to read the data continuously.

    Out Report
    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

    No length is submitted. The In report is always completely filled until the end of the RAM block is reached or the internal number of valid bytes is reached.

    In Report 
    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

    In reports can be polled until end of RAM block is reached (address 0x0fff). Continued reads supply all zeros.

    Additionally note that the firmware also respects the number of valid bytes in RAM. So, if by a previous command only the first 256 bytes have been written, it's not possible to read above address 0x00ff. When reading above, the data is all zero.

    WRITE_RAM (3)

    Write Data to TransferRAM.

    This Out Feature Report can write a maximum of 58 bytes into TransferRAM. Every Out Feature Report sets the destination address, therefore there is no burst mode here.

    Important: Note that you have to issue a CMD_CLEAR_FLASH_RAM before being able to write to Flash RAM for security reasons!

    Out Report
    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!)

    It's possible to write to any address between 0x0000 and 0x0fff. All other writes are ignored and an RETVAL_WRITE_OUTSIDE_RAM error is issued.

    COPY_FLASH_TO_RAM (4)

    Copies addressed data from a flash sector to the TransferRAM.

    Out Report
    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)

    Erase a flash sector.

    Access restrictions apply. If a user is not entitled to erase this sector it is denied. Refer to flash sector table to see which sectors allow erasing.

    Out Report
    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)

    Programs Transfer RAM contents into Flash Memory.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 0d6 1 CMD_COPY_RAM_TO_FLASH
    1 SectorID   1 SectorID 
    3...63       Not used
    In  Report
    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)

    Clears the complete TransferRAM (4kBytes total) by overwriting all bytes with 0xFF.

    Important: Note that you have to issue a CMD_CLEAR_RAM before being allowed to write to TransferRAM for security reasons! The number of valid data bytes in TransferRAM is set to 0x1000 by this command, so all data bytes can be read and overwritten afterwards.

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

    System Commands

    TBD

    Onboard Port Commands

    READ_PORTS (8)

    Reads states of internal digital ports.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 8 1 CMD_ID_READ_PORTS
    1...63       Not used
    In  Report
    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.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 27 1 CMD_READ_ADC
    1...63       Not used
    In  Report
    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      

    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

    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.

    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

    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...0x000fffff 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
    1

    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

    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
             

    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.

    Display Driver Commands

    Display Driver Basics

    The Display Driver modules are extension modules, connected to the extension port of the Arcaze-USB Interface.

    Display Driver Types

    Currently 2 different Display Driver Modules exist:

    Display Driver 1
    • This module contains only one display driver chip and therefore can drive 8 digits in total.
    • The bus address can be set by a rotary switch to values 0 to 15.
    • Theoretically up to 16 Display Driver 1 modules could be connected to an Arcaze USB-Interface.
    • The Display Driver 1 is obsolete.
    Display Driver 32
    • This module contains 4 display driver chips and therefore can drive 32 digits in total.
    • The bus address can be set by solder bridge SB101. When set to "1" or open, the bus addresses of the display driver chips are 0...3. When set to "2", the bus addresses of the display driver chips are 4...7.
    • 1 or 2 Display Driver 32 modules can be connected to an Arcaze USB-Interface.
    Decode Mode

    There are 2 different ways to display data sent to a display driver. The "Decode Mode" can be set up on a per-digit basis.

    Decode Mode = 0 / Bitmapped Mode

    If a digit is set up for deocde mode 0, the data is displayed as a bitmap exactly as it has been received. So each bit of a byte stands for one segment of a digit as shown here:

    2015-03-03_17h28_10.png

    Decode Mode = 1 / Code B Decoding

    If decode mode 1 is selected for a digit, a small character generator is used and only bits 0...3 of display data are interpreted and displayed as shown in the table below. Additionally bit 7 represents the DP point.

    2015-03-03_17h31_04.png

    MAX7219_DISPLAY_INIT (33)

    Initializes a display driver chip of a Display Driver Module connected to the extension port of the Arcaze USB-Interface.

    A Display Driver 1 module contains only one display driver. Therefore, only one Init command is required per module. The Display Driver 32 module contains 4 display drivers, each with its own address. Therefore it's necessary to send the init command 4 times, once to each address. This has not been combined into one command to allow for setting brightness or other settings different for each chip if desired.

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 33 1 MAX7219_DISPLAY_INIT
    1 Device Address 0...7 1 Bus address of the display driver chip.
    On a Display Driver 32 this can be 0..3 for the first module and 4...7 for the second module connected to the Arcaze USB-Interface.
    On a Display Driver 1 this can be 0...15, which is the address to be set by the rotary switch on each Display Driver 1 module.
    2 Decode Mode Bitmask 1 Each bit reflects one digit.
    If a bit is set to 0, display data is not decoded, but simply displayed as a bitmap for all segments of this digit.
    If a bit is set to 1, display data is decoded and displayed as Code B font, as shown in the Code B font table earlier.
    3 Intensity 0...15 1 0 = darkest, 15 = brightest
    4 ScanLimit 4...8 1 Selects the number of digits to actually be updated from a display driver. This can generally be left at value 8.
    The only reason to alter this value, would be to achieve a higher frame update rate on a display smaller than 8 digits, as scanning becomes the faster, the less digits are to be updated. But this will only be relevant in very specific applications (like moving displays).
    5...63 not used     not used

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

    MAX7219_WRITE_DIGITS (36)

    Out Report
    Address Content Value Length (Bytes) Remarks
    0 Command 36 1 MAX7219_WRITE_DIGITS
    1 Device Address 0...7 1 Bus address of the display driver chip.
    On a Display Driver 32 this can be 0..3 for the first module and 4...7 for the second module connected to the Arcaze USB-Interface.
    On a Display Driver 1 this can be 0...15, which is the address to be set by the rotary switch on each Display Driver 1 module.
    2 Digit 0 Data 0x00...0xff 1 Display Data goes here. Can be bitmapped or Code B.
    Digit 0 is on the right side for displays attached to connector A and on the left side for displays attached to connector B
    3 Digit 1 Data 0x00...0xff 1 Display Data for digit 1 goes here. Can be bitmapped or Code B.
    4 Digit 2 Data 0x00...0xff 1 Display Data for digit 2 goes here. Can be bitmapped or Code B.
    5 Digit 3 Data 0x00...0xff 1 Display Data for digit 3 goes here. Can be bitmapped or Code B.
    6 Digit 4 Data 0x00...0xff 1 Display Data for digit 4 goes here. Can be bitmapped or Code B.
    7 Digit 5 Data 0x00...0xff 1 Display Data for digit 5 goes here. Can be bitmapped or Code B.
    8 Digit 6 Data 0x00...0xff 1 Display Data for digit 6 goes here. Can be bitmapped or Code B.
    9 Digit 7 Data 0x00...0xff 1 Display Data for digit 7 goes here. Can be bitmapped or Code B.
    Digit 7 is on the left side for displays attached to connector A and on the right side for displays attached to connector B
    10 DigitsMask 0x00...0xff 1 Bit 0 = Digit 0 ... Bit 7 = Digit 7
    11...63 not used     not used
    Example Command
    00
    24 00 01 02 03 04 05 06 07 08 0f 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    Results:

    • Accesses display driver on bus address 0
    • Writes 1 to digit 0
    • Writes 2 to digit 1
    • Writes 3 to digit 2
    • Writes 4 to digit 3
    • Does not change contents of digits 4 to 7, because their bits are set to 0 in the DigitsMask register!

     
    © Simple Solutions  •  Impressum  •  Wiki powered by Mindtouch