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.

Hiperface example for C2000?

Other Parts Discussed in Thread: CONTROLSUITE, DESIGNDRIVE

Hey together,

i want to use a Hiperface-encoder with a f28m35x Concerto. I have already a RS485 transceiver which provides a TX, RX, CLK and RW (to switch read/write) wire at the output of the transmitter. In this case i need a UART connection to read and write data from the C2000 of the Concerto to the RS485 transceiver.

Does anyone have an example with the hyperface protocol, which i can use to read the Hiperface encoder by UART?

I found only applications for the Sitara AM4xx, but i didn't find any code examples for hiperface on a C2000.


Thanks!

Regards,

Sebastian

  • Hi Seb,

    Example for hyperface protocol seems very bleak to me. Though you can refer these threads:
    e2e.ti.com/.../218156
    www.ti.com/.../tidub64a.pdf

    Regards,
    Gautam
  • Hi Sebastian,

    I would recommend taking a look at the following TI-Design.  It should provide you with a very good starting point:
    http://www.ti.com/tool/tida-00202

    The firmware built around this design was done for the F28069, which comes from the same C2000 product family as the F28M35x. 

    The firmware on the F28069 utilizes the SCI peripheral for the digital portion of HIPERFACE, so it may be easier to directly leverage the firmware if you utilize the F28M35x's SCI module (which ties into the C28x core).  However, it is certainly possible to modify the code and utilize the M3's UART peripheral and control communication from the M3 side, if you'd prefer.


    Thank you,
    Brett

  • Hey together,

    Finally it was possible to use the SCI pheripheral for a UART communication to a RS485 transceiver. Additionally it was possible to communicate with the hiperface encoder and to read out the status. Thanks Brett for your information.

    To read out the position of the encoder, the controller sends 4 Bytes and receives from the encoder 7 Bytes. Here is the problem, because the SCI pheripheral has only a two 16 Bit Receive-Buffer. This gives 4 Bytes. The code snip looks like:

    while(SciaRegs.SCIFFRX.bit.RXFFST != NumberofHiperfaceBytes) { } // wait for RRDY/RXFFST =1 for 1 data available in FIFO

    ReceiveAdress = SciaRegs.SCIRXBUF.bit.RXDT;
    ReceiveOrder = SciaRegs.SCIRXBUF.bit.RXDT;
    HyperPos_HH = SciaRegs.SCIRXBUF.bit.RXDT;
    HyperPos_HL = SciaRegs.SCIRXBUF.bit.RXDT;
    HyperPos_LH = SciaRegs.SCIRXBUF.bit.RXDT;
    HyperPos_LL = SciaRegs.SCIRXBUF.bit.RXDT;
    ReceiveChecksum = SciaRegs.SCIRXBUF.bit.RXDT;

    If i initialize "NumberofHiperfaceBytes = 4" the controler works, but i miss the last three bytes. If i write "NumberofHiperfaceBytes = 7" the controller stops at the "while(SCia......)" order, because he never reaches the 7 bytes.

    I think this is because the Receive-Buffer is only 4 Bytes. Is there any possibility to increase the buffer size or to read out the full data ?

    Regards
    Sebastian
  • Hi Sebastian,

    Are you running the code on the F2806x or did you successfully port it into the F28M35x?

    The reason I ask is that the SCI FIFO depth is one thing that changes between C2000 family devices.  For instance, the FIFO depth on the F2806x family is 4.  On the F28M35x it is 16.  Therefore, if you use the F28M35x (or several other C2000 devices) you should have fewer issues.

    ===

    If you are using the F2806x (or one of the C2000 families with a SCI FIFO size < 7), you'd need to rely less on the FIFO to fully capture the packet.  For instance, you could architect the code such that the C2000 starts taking some data out of the FIFO before the FIFO gets filled.  Using the FIFO interrupts may help with this, if utilizing interrupts for communication is an option in your system.


    Thank you,
    Brett

  • Hey Brett,

    i run the code on the F28M35x. The porting was successful.

    If i understand you right, i shouldnt have this problems, because the FIFO should be 16 Bytes. If i increase the the variable "NumberofHiperfaceBytes" above 4, the controller stops waiting at the while(...) instruction. If the variable is 4, everything works fine.

    This is my FIFO init:

    void scia_fifo_init()
    {
    SciaRegs.SCIFFTX.all=0xE040;
    SciaRegs.SCIFFRX.all=0x2088; //SW: Default was 0x2044
    SciaRegs.SCIFFCT.all=0x0;

    }

    I think this should be fine or do you have any idea what causes this problem?

    Regards,
    Sebastian
  • Hi Sebastian,

    Thoughts:

    1. You said: "...If i understand you right, i shouldnt have this problems, because the FIFO should be 16 Bytes..." 
      I wouldn't quite say that :).  However, I would say that there should be a relatively easy solution to the problem you are facing - one largely based on making sure you have the SCI registers configured correctly.
    2. The edit you made to SCIFFRX doesn't seem to match with what you say that you are trying to do.  Perhaps, 0x2047 is more applicable? 

    Thank you,
    Brett

  • Hi,

    Hiperface firmware package http://www.ti.com/tool/tida-00202 contains just the .out file but not the .c files.

    How can we get the actual code?

  • Isaac,

    The Hiperface solution included in this TIDesign was limited in scope to basic functions to test signal/EMI performance of the TIDesign of the transmission/conditioning circuits.  It is not a full Hiperface conforming solution and not in a state that would be conducive for any customer to begin a development.

    However, since Hiperface includes a SIN/COS component, you could begin that portion of your development by leveraging our existing Position Manager / SINCOS solution that is available today as part of C2000 controlSUITE.  Please check out: TI.com/C2000Drives and training.TI.com/c2000-designdrive for more background on our solutions.

    We do plan to release Hiperface support as a part of DesignDRIVE Position Manager in 2017.  It will build upon our existing SIN/COS solution.

    Best Regards,

    Brian