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.

TMS320F28386D: Can this MCU be setup (using CLB and existing peripherals) to handle 8 incremental encoder inputs and 4 UVW commutation inputs (4 motors).

Part Number: TMS320F28386D
Other Parts Discussed in Thread: C2000WARE

Can this MCU be setup (using CLB Configurable Logic Block and existing peripherals) to handle 8 incremental encoder inputs and 4 UVW commutation inputs (4 brushless motors)?  

Each UVW (3 signal) group needs to trigger an interrupt if any one of the 3 signals (U or V or W) change so that the MCU can change the commutation on the respective motor.  

Thanks,

Nick

  • Hi,

    Nicholas Layshot4 said:
    Each UVW (3 signal) group needs to trigger an interrupt if any one of the 3 signals (U or V or W) change so that the MCU can change the commutation on the respective motor.  


    If this is the only function you are targeting inside CLB - i.e. detecting an edge on any of the inputs and triggering an interrupt, it seems feasible to me.

    You can try out the CLB, 
    http://www.ti.com/microcontrollers/c2000-real-time-control-mcus/overview.html#clb

    Let us know if you have any issues or specific questions as you try out the implementation.

  • Hi, 

    I actually need more then just the UVW. 

    We need to interface with 8 incremental encoder inputs and 4 UVW groups. The MCU only has 3 QEP (for 3 incremental encoder or quadrature counter inputs).

    1) Is there a way to use the CLB and the peripherals (3 QEP or whatever else) to handle this input requirement? 

    2) How big could we make the quadrature counter (32 bit for example)?

    For Example: There are 8 CLB. So could we program 4 of these to read in 1 incremental encoder and 1 UVW group and 4 of them to read in 1 incremental encoder (for a total of 8 incremental encoders and 4 UVW groups)? The output of 4 of the CLB would be an interrupt if UVW changes state, the UVW values, and the encoder count (quadrature counter count). The other 4 would just be incremental encoder count (quadrature counter count). We would also probably want the ability for the processor to reset the count to 0 or a value.

    Another Example: some how combining CLB with existing peripherals (QEP, eCAP etc.) to read in the 8 incremental encoders (8 quadrature counters) and 4 UVW inputs.

    thanks,

    Nick

  • Hi,

    Nicholas Layshot4 said:

    1) Is there a way to use the CLB and the peripherals (3 QEP or whatever else) to handle this input requirement?


    I'm not sure I understand your question. Did you mean routing of the inputs to the CLB or other peripherals?

    Nicholas Layshot4 said:
    2) How big could we make the quadrature counter (32 bit for example)?


    Again, if you are referring to CLB, there are three 32-bit counters in each CLB.

    But, in the previous email you mentioned that the requirement is "Each UVW (3 signal) group needs to trigger an interrupt if any one of the 3 signals (U or V or W) change so that the MCU can change the commutation on the respective motor.  "

    Just combining the signals and detecting an edge on UVW is pretty straightforward.
    But, If you are planning to implement complete QEP function like direction detection, Quadrature counting etc. that may not be feasible depending on how many features you are implementing inside CLB.

    Best way is to try out your requirements by implementing using CLB as it would be difficult for me to know your implementation needs completely.

  • 1) I mean I need to read in 8 incremental encoders and 4 UVW groups into the MCU. Is there a way to do this in some form or another?

    2) yes, we need to read in a incremental encoder so we need quadrature counting ability i.e. count up if going in one direction and count down if going in other direction. 

  • Hi,

    From what I see, that seems to be a lot of logic handling all these functions for 8 incremental encoders.
    You can do a quick experiment on 1 and check if the logic fits in 1 Tile of CLB. If so, you can replicate the same on 8 tiles.
    It's difficult to give a straight yes or no, it's better to try it out and check the feasibility.

  • Thanks for your help. 

    A couple of follow up questions:

    1) I'm having a hard time finding where it states how many CLB tiles or the # of CLBs per device. I can see CLB1 though CLBX referenced in certain tables but can't find where it explicitly states. Which devices have 8 tiles (or CLBs) and where does it state this?

    2) In reference to question 1.. I haven't found how to start the design with 8 tiles as I only see 4 come up. I am following the CLB Tool Users Guide (SPRUIR8) and it states to start a project by importing the clb_empty project from the examples folder. However, I can't seem to find a version of this that has 8 tiles.

    Thanks,

    Nick

  • Hi,

    Nicholas Layshot4 said:
    1) I'm having a hard time finding where it states how many CLB tiles or the # of CLBs per device. I can see CLB1 though CLBX referenced in certain tables but can't find where it explicitly states. Which devices have 8 tiles (or CLBs) and where does it state this?


    In device data sheet you'll find the following table "Table 3-1. Device Comparison" that says which devices have CLB feature.
    Since you are using F28386 it has CLB and 8-tiles (all F2838x devices with CLB feature have 8 tiles)

    Nicholas Layshot4 said:
    2) In reference to question 1.. I haven't found how to start the design with 8 tiles as I only see 4 come up. I am following the CLB Tool Users Guide (SPRUIR8) and it states to start a project by importing the clb_empty project from the examples folder. However, I can't seem to find a version of this that has 8 tiles.


    Currently the tool supports only 4 tiles. There is a plan to release tool with 8 tile support later half of this year.
    You can have a different configuration (.syscfg) for the tiles and rename the output and configuration files to tiles 5-8 manually.



  • 1)

    Where does it state the # of tiles? I can't find where it states F2838x devices have 8 tiles. I've looked at the website for that MCU (datasheet and TRM)?

     

    2)

    If I need to run in 8 incremental encoders (2 GPIO each so 8 x 2 = 16 GPIO) and 4 UVW (3 GPIO each so 4 x 3 = 12 GPIO). 16 + 12 = 28 GPIO. For 4 Tiles that means 28/4 = 7 inputs per Tile. At a minimum I need to read in the encoders (16 inputs). Since each tile can have 8 inputs this should work. However, when I look at how to get GPIO into the CLB it shows in 2837xD TRM Figure 9-1 or 2838x figure 9-4 that I need to use the Input X-BAR. The Input X-BAR only has 6 outputs that can go to the CLB and the Input-XBAR can only connect 1 GPIO to each of those 6 inputs? So does that mean I can only connect a total of 6 GPIO to the CLB in whole (6 GPIO for all 4 tiles)?

     

    3)

    How do we check a change on an input signal to the CLB and read in the value. For Example: If we set bits 1-0 = 11 on the CLB_INPUT_FILTER what does the CLB tile see for input 0? How do we read in the value of the signal?

     

    4)

    I'm still trying understand how the sub-blocks work in the tile and the timing. Are the outputs of each sub-block latched on the 100Mhz clock? So if I go through 3 LUTs for example would that take 3 clock cycles at 100MHz rate? Does the examples below make sense?

     

    LUT example (Direction = A_current XOR B_past):

    If I need to use both the current and past value of an input (direction = A_current XOR B_past) can I merely run B though an LUT to get B_past.  So for example I could run B into the LUT0 and set out = B (B_past) i.e. put i0 in "eqn" field. Then set LUT1_out = A (A_current) XOR LUT0_out (B_past).  

     

    FSM example (Direction = A_current XOR B_past):

    e0: A

    e1: B

    s0: e0 (s0 = B_past)

    Eqn_out: e0 XOR s0 (direction = A_current XOR B_past)

    thanks,

    Nick

  • Hi,

    1) There isn't a specific mention of number of tiles,  Table 9-13. CLB Base Address Table (C28) provides the tile addresses.
    I'll get this feedback to the documentation and have this updated. But, As I mentioned earlier, currently tool supports only 4 tiles. 

    2) Your understanding is correct. You'll be limited by the number of GPIOs you can take to CLB in your application. I do not see a way around routing so many signals via GPIO to CLB.
    I believe based on our telephone conversation and details of the application you provided, this will be the limiting factor on number of encoders you can implement.

    3) The output of the CLB_INPUT_FILTER will be a 1 CLB clock pulse. This pulse can be fed to counters to count the number of transitions. As I mentioned in the call, you can connect this CLB input (with filter enabled) to the MODE0 input of the counter.

    4) Please watch the 3 short videos to understand the architecture, sub-blocks etc.
    https://training.ti.com/c2000-configurable-logic-block-clb-introduction?context=1137766-1138740-1139892

    https://training.ti.com/c2000-configurable-logic-block-clb-architecture?context=1137766-1138740-1139894      

    https://training.ti.com/c2000-configurable-logic-block-clb-programming-tool?context=1137766-1138740-1139895

    Also, You do not have to do XOR any more, since you are using the edge detect logic at the input of CLB.

    In case you've to implement XOR on 2 signals, please refer to this example
    C:\ti\c2000\C2000Ware_2_01_00_00\driverlib\f2838x\examples\c28x\clb\
    clb_ex8_external_signal_AND_gate

    Instead of AND (&) you can use XOR (^).