This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • Resolved

[FAQ] LMH1297: Programming RAW command syntax explained

Mastermind 45275 points

Replies: 1

Views: 112

Part Number: LMH1297

Different devices programming guide use RAW command syntax to modify registers. What is the detailed explanation of this command syntax and its parameters?

 

  • Programming guide command syntax uses a specific format to change a device register. Description below goes into
    details as to how this is done.

    Essentially there are two methods to change device register settings:

    A). Read/Modify write operation
    B). Write only operation

    A). Let's first discuss Read/Modify write operation:

    For example, below register settings selects certain section of the device registers 0xFF and 0x69 and then modifies
    bits within these two registers. To make this clear, let's review a couple of examples:

    RAW FF 05 07 //change 0xFF[2:0]=101’b
    RAW 69 10 30 //change 0x69[5:4]=01'b

    RAW: Identifies a register operation
    0xFF or 0x69: Indicate register addresses which need to be changed
    0x05 or 0x01: Indicates register content change using mask of next operand.
    0x07 or 0x30: Indicates mask or register bits that need to be changed.
    For example, mask = 0x07 shows bits 2 through 0 of register 0xFF need to be changed. By the same reasoning,
    mask of 0x30 indicates bits 5 through 4 of register 0x69 is going to be changed.

    Now that we have a good understanding of the command syntax, let's look deeper to see how this would get implemented.
    RAW command syntax uses read/modify format. This command performs three difference operations:
    1). First we read contents of registers 0xFF or 0x69.
    2). Use mask to change register setting as needed.
    3). Finally, write back the changed value.
    For example, RAW FF 05 07 means we have to do the followings:
    1). Read content of register 0xFF. As an example, let's say we read back a value of 0x04
    2). Because of mask 0x07, FPGA or micro-controller preserves bits 7 through 3 and concatenate with changed bits 2 through 0.
    In our example, since we read back 0x04 it means after bit operation we would have 0x05.
    3). Write back the value. In this example we would write back 0x05 into register 0xFF. The same procedure is used for register 0x69 or other registers.

    B). Write only operation:
    Next let's discuss changing register settings using write only operation.
    Unlike previous method, we use a single write command to update register with our changes. However, given there are certain
    bits within register which are reserved bits we must preserve these bits and update only register bit with changes we need
    to make. To be clear, let's use the above two examples that we used earlier:

    RAW FF 05 07 //change 0xFF[2:0]=101’b
    RAW 69 10 30 //change 0x69[5:4]=01'b

    The same syntax/meaning applies as it was mentioned earlier. Since we need to change reg 0xFF[2:0] and
    reg 0x69[5:4] only, we should preserve bits 0xFF[7:3], 0x69[7:6], and 0x69[3:0]. Now the question is
    how do know what are default or register settings for these bits? There are two ways:
    1). During development process, read content of register and then change register bits that are needed only.
    2). Refer to the programming guide and note default settings and then change bits as needed.
    For example, reading LMH1297 programming guide specifies values of 0x00 and 0x10 for reg 0xFF and 0x69 respectively.
    Therefor we can do a single write and directly set reg 0xFF = 0x05 and 0x69=0x10.

    Note: Direct write operation can be performed if there is no reserved or dynamic bit within the register.

    In summary, there are two ways to modify register content:

    Read/Modify write:
    In this case, for each RAW operation we need to execute three operations:
    1). Use FPGA or micro-controller to read register value from the device
    2). Use FPGA or micro-controller to change register value based on mask settings
    3). Finally write back the value into the device register

    Direct write operation:
    This method reads register content directly from the device or programming guide. Then we modify only register bits
    as needed on FPGA or micro-controller side and write back the value. Please note this method can be used if the
    register does not have a dynamic or reserved bit. Please refer to the programming guide device register table
    for details about each register and bit definitions.

     

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.