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.

TMDXICE3359 : Using Sync 1 event in EtherCAT Application

Hi.

I'm analyzing EtherCAT sample code.

I'm trying to modify the sync0task which is run when sync 0 event is occurred.

I want to run it when sync 1 event is occurred.

I found sync 0 event handler (HOST_SYNC0_EVENT), but couldn't find sync 1 event hadler anywhere.

Can I try this modification at ICE Board?

I'll wait for your answer.

Regards,

WOONGGY KIM.

  • So far we are following what the Beckhoff/ETG SSC stack provides. This does not support Sync1 ISR at the moment I believe. However in latest ESC firmware we have the capability for also using Sync1 and you can measure the output signal on ICE. For application side processing I suggest you contact ETG for this and/or modify the stack on your own.

    Regards.

  • Dear Frank.

    Thanks for your answer.

    But I think need your help more about that.

    I think you can approach ETG more efficient to gather information about activation of Sync-1 signal from host.

    If you don't mind, please give me some detailed tip about source files or event handler which are handling Sync1 signal event from host.

    Regards,

    WOONGGY KIM.

  • Yes, we can ask ETG/Beckhoff to add Sync1 support in the SSC. But we don't have a lot more influence on them than any other ETG member. So I suggest you also raise that question.

    Now as I said there are no files to handle Sync1 on the ARM side so far. You may enable Sync1 on the master side (e.g. usign TwinCAT) and you should get the TI ESC hardware signal for Sync1 (make sure you have the pin-mux right if you want to measure with a scope).

    Regards.

  • Hi,

    Can you please try following changes in bold in respective source files

    In tiesc_pruss_intc_mapping.h

     

    #define                HOST_AL_EVENT                             (20-CHANNEL2)+CHANNEL3

    #define                HOST_SYNC0_EVENT     (20-CHANNEL2)+CHANNEL2

    #define                HOST_CMD_HIGH_ACK_EVENT                (20-CHANNEL2)+CHANNEL4

    #define                HOST_CMD_LOW_ACK_EVENT (20-CHANNEL2)+CHANNEL5

    #define                HOST_SYNC1_EVENT     (20-CHANNEL2)+CHANNEL6

     

    {SYNC0_OUT_EVENT, CHANNEL2,SYS_EVT_POLARITY_HIGH ,SYS_EVT_TYPE_EDGE },  {SYNC1_OUT_EVENT, CHANNEL6,SYS_EVT_POLARITY_HIGH ,SYS_EVT_TYPE_EDGE },\

     

    { {CHANNEL0,PRU0}, {CHANNEL1, PRU1}, {CHANNEL2, PRU_EVTOUT0}, {CHANNEL3, PRU_EVTOUT1}, {CHANNEL4, PRU_EVTOUT2}, {CHANNEL5, PRU_EVTOUT3}, {CHANNEL6, PRU_EVTOUT4},  {0xFF,0xFF} },\

    (PRU0_HOSTEN_MASK | PRU1_HOSTEN_MASK | PRU_EVTOUT0_HOSTEN_MASK | PRU_EVTOUT1_HOSTEN_MASK | PRU_EVTOUT2_HOSTEN_MASK | PRU_EVTOUT3_HOSTEN_MASK | PRU_EVTOUT4_HOSTEN_MASK)\

     

    In tiescbsp.c

     

    Function void bsp_start_esc_isr(void) add following line

     

    PRUSSDRVRegisterIrqHandler(HOST_SYNC1_EVENT, 0, &Sync1Isr);

    Add a new function

    void Sync1Isr(void)

    {

        ENABLE_PRUSS_ACCESS_FROM_HOST

        prussdrv_pru_clear_event(SYNC1_OUT_EVENT);

    }

     

  • To support the Sync1 signal by the SSC you have to do the following steps:

    - create an DC.OpMode element in your device description which enables the DC Out Unit, Sync0 and Sycn1 signal (see ETG.2000,http://www.ethercat.org/download/ESI/default.asp)

    - update the DC register checking in StartInputHandler() (ecatslv.c)

    - Create a watchdog for the Sync1 signal (similar to the already existing Sync0 watchdog)

    If you have any further questions you can also contact me directly (r.hoffmann@ethercat.org).

  • Thanks, everyone.

    I apologize for the delay in checking replies.

    I'll try every solution.

    Regards,

    WOONGGY.