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.

LP5562: Not understanding branch instruction bit-field on LP5562

Part Number: LP5562

Hello,

It's probably just a sign that I should give up for the day and go home so my brain can rest, but the branch instruction in the engine control doesn't make sense when I compare the data sheet to the examples and the behavior. Additionally, the bit-fields are defined two different ways.

From Table 14 of SNVS820B:
Branch 1 0 1 Loop count (6-bit) X X X Step number (4-bit)

From Figure 43 of SNVS820B:
Branch 1 0 1 Loop Count (6-bit) X Step number (6-bit)

 

Perhaps the two extra bits specify the engine number to which to jump? (0, 1, 2?)  Am I missing that information in the data sheet?

Regardless, as this is on engine 1, I'd expect the last instruction, 0xA001, to loop infinitely back to the second instruction. I'm not seeing that behavior, so please kindly inform me where my understanding went awry.

  • Hi, Jeff,

    The step number should be a 4 bit data and the value is from 0 to 15 as you can see from Table 15.

    Would you provide your instructions?

    Thanks.
    Regards,
    Kenneth
  • Figure 43 has a different definition. How come? Maybe update the datasheet and compiler to avoid confusion?

    Here's an example of your command compiler's output showing that it stuffs extra bits into the don't-care regions, but I suppose I 'don't-care'.
      1         # engine 1 section start
      2 00        .ENGINE1
      3 00 E080       trigger w1
      4            JUMP1:
      5 01 5A00       wait 400
      6 02 3313       ramp  500, 20
      7 03 1431       ramp  500, 50
      8 04 0831       ramp  200, 50
      9 05 0431       ramp  100, 50
     10 06 0831       ramp  200, 50
     11 07 0C31       ramp  300, 50
     12 08 0CB1       ramp  300, -50
     13 09 E002       trigger s1
     14 0A A001       branch 0, JUMP1
     15 0B A081       branch 1, JUMP1
     16 0C A101       branch 2, JUMP1
     17     
     18     
     19         # engine 2 section start
     20 10        .ENGINE2
     21 10 E080       trigger w1
     22            JUMP2:
     23 11 5A00       wait 400
     24 12 3313       ramp  500, 20
     25 13 1431       ramp  500, 50
     26 14 0831       ramp  200, 50
     27 15 0431       ramp  100, 50
     28 16 0831       ramp  200, 50
     29 17 0C31       ramp  300, 50
     30 18 0CB1       ramp  300, -50
     31 19 E002       trigger s1
     32 1A A011       branch 0, JUMP2
     33 1B A091       branch 1, JUMP2
     34 1C A111       branch 2, JUMP2

    I solved my issue though, a bug in the creation of the command before the branch instruction resulted in it apparently getting treated as an end command.  Sleep is good.

    Thanks!