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.

AM263P4-Q1: AM263P4-eCAP Module integration

Part Number: AM263P4-Q1
Other Parts Discussed in Thread: AM263P4

H iteam,
     Could you please provide a following detail on eCAP integration. Consider a two MCU A and B.
MCU A generating a PWM for driver and MCU B should monitor a PWM generated by MCU A .Can i do with this use of eCAP and how can be it done.Consider if eCAP is monitoring , if any fail/fault or PWM is mismatch occurs can i raise a flag to MCU A through SPI ?

  • Hi Jayakeerthana,

    The eCAP module can accurately capture PWM characteristics. If a mismatch or fault is detected, MCU B can notify MCU A via SPI.

    Refer to the information in the example at the link below:

    EXAMPLES_DRIVERS_ECAP_CAPTURE_PWM.html

    Implementation:

    1. Signal Routing: Connect MCU A’s PWM output to an eCAP input pin on MCU B. Route the signal through the Input X-BAR to the eCAP module's CAP_IN input, configuring the 256:1 input multiplexer (ECCTL0.INPUTSEL).

    2. eCAP Configuration: Configure the eCAP module in capture mode:

      • Use the 32-bit time base counter for timestamping PWM edges.
      • Capture both rising and falling edges for precise timing.
      • Utilize the four event time-stamp registers.
      • Enable signal monitoring for fault detection.
    3. Fault Detection: The eCAP module's signal monitoring functionality detects PWM mismatches. Configure it to define what constitutes a fault.

    4. Fault Reporting via SPI:

      • Trigger: Use the eCAP’s TRIP_OUT signal or CAP_INT interrupt when a fault is detected.
      • SPI Communication: In the ISR (triggered by interrupt or TRIP_OUT), initiate an SPI transaction. MCU B acts as the controller initiating communication with MCU A (the peripheral).
      • Data Transmission: Send a fault flag or status code to MCU A through SPI. For example: SPI_Send_Fault_Flag(FAULT_CODE).
      • Error Handling: Implement SPI error checks to ensure successful transmission.

    Component Summary:

    Component
    Function
    Configuration
    MCU A
    PWM Generation
    Standard PWM output
    MCU B - eCAP Input
    Signal Reception
    GPIO configured for eCAP via Input X-BAR
    MCU B - eCAP Module
    PWM Monitoring
    Capture mode, signal monitoring enabled
    MCU B - SPI
    Fault Reporting
    Initiates SPI transaction to MCU A

    Key Considerations:

    • Timing: Ensure the PWM signal meets the eCAP’s timing requirements for reliable capture.
    • Synchronization: Synchronize eCAP capture events with SPI transmission.
    • SPI Latency: Account for SPI latency in the fault response time.
    • Input Line State: Consider pull-up/pull-down resistors on the eCAP input pin.

    Best Regards,

    Zackary Fleenor

  • Hi Zackary,
           Thanks for your response.

    1. Signal Routing: Connect MCU A’s PWM output to an eCAP input pin on MCU B. Route the signal through the Input X-BAR to the eCAP module's CAP_IN input, configuring the 256:1 input multiplexer (ECCTL0.INPUTSEL).
         

      We have three PWM pairs (total 6 signals). Currently, they are mapped to ePWM A[0:2] and B[0:2] on MCU B.And how many signals can be monitored on eCAP?

    2. For routing these signals through the Input XBAR, is any additional hardware configuration required?

      Also, is the Input XBAR configurable on all GPIO pins


      Regards
      Jayakeerthana P

  • Hi Jayakeerthana,

    I am looking into this for you and will provide an update tomorrow.

    Best Regards,

    Zackary Fleenor

  • Hi Jayakeerthana,

    Each ECAP only hosts a single counter so support capturing a single CAP_IN signal.

    Hardware Configuration: No additional hardware like jumpers or physical connections (beyond the trace between the MCU A PWM output and the MCU B eCAP input pin) are needed. The connections are made through software configuration of the Input XBAR.

    The Input XBAR is configurable, but not all GPIO pins are available for routing. The specific pins suitable for routing through the XBAR to the eCAP module are defined in the chip's Technical Reference Manual (TRM) – specifically, look for the eCAP module’s input multiplexing description. You'll need to identify which GPIO pins can be bound to the eCAP CAP_IN inputs. The TRM dictates exactly which pins are available for this purpose.

    Best Regards,

    Zackary Fleenor

  • Hi  Fleenor,

    In the TRM, on page 917, it is mentioned that the Input XBAR can be configured to all GPIOx pins. However, I am unable to find the specific pin attributes that indicate which pins are suitable for eCAP routing.

    Could you please confirm this or share the relevant reference page in the TRM where these details are described?

  • Hi Jayakeerthana,

    The AM263P4 documentation separates primary pin multiplexing information from secondary peripheral routing details. The Pin Attributes table in the datasheet defines the SoC pin multiplexed signal function implemented at the pin but does not define secondary multiplexing of signal functions implemented in device subsystems. For secondary multiplexed signal functions like eCAP routing, you must refer to the respective peripheral chapter of the device TRM.

    eCAP Input Configuration via Input XBAR

    The eCAP module's capture inputs are connected using the Input XBAR, as mentioned on page 917 of the TRM [2]. The eCAP module uses a 256:1 input multiplexer for its input selection.

    Specific Reference Location: The detailed information about eCAP input selection can be found on page 783 of the TRM (SPRUJ55D). This section provides the complete mapping of how eCAP inputs connect through the Input XBAR.

    eCAP Input Selection Mapping

    The following table shows the available INPUTXBAR outputs that can be routed to eCAP inputs:

    Selection of eCAP Input
    Select Index
    INPUTXBAR.OUT1
    203
    INPUTXBAR.OUT2
    204
    INPUTXBAR.OUT3
    205
    INPUTXBAR.OUT4
    206
    INPUTXBAR.OUT5
    207
    INPUTXBAR.OUT6
    208
    INPUTXBAR.OUT7
    209
    INPUTXBAR.OUT8
    210
    INPUTXBAR.OUT9
    211
    INPUTXBAR.OUT10
    212
    INPUTXBAR.OUT11
    213
    INPUTXBAR.OUT12
    214
    INPUTXBAR.OUT13
    215
    INPUTXBAR.OUT14
    216
    INPUTXBAR.OUT15
    217
    INPUTXBAR.OUT16
    218
    INPUTXBAR.OUT17
    219
    INPUTXBAR.OUT18
    220
    INPUTXBAR.OUT19
    221
    INPUTXBAR.OUT20
    222
    INPUTXBAR.OUT21
    223
    INPUTXBAR.OUT22
    224
    INPUTXBAR.OUT23
    225
    INPUTXBAR.OUT24
    226
    INPUTXBAR.OUT25
    227
    INPUTXBAR.OUT26
    228
    INPUTXBAR.OUT27
    229
    INPUTXBAR.OUT28
    230
    INPUTXBAR.OUT29
    231
    INPUTXBAR.OUT30
    232
    INPUTXBAR.OUT31
    233

    Configuration Approach

    To configure eCAP routing for your application:

    1. First, configure the desired GPIO pin's primary multiplexing using the Pin Attributes table in the datasheet
    2. Then, use the Input XBAR to route that GPIO signal to one of the INPUTXBAR.OUT1-31 outputs
    3. Finally, select the appropriate INPUTXBAR output (using the select index 203-233) as the eCAP input source

    The Input XBAR chapter (page 917) will provide details on how to configure GPIO pins as inputs to the XBAR, while the eCAP chapter (page 783) shows how to select the XBAR output as the eCAP capture input.

    Citations

    1. AM263P4 Datasheet - Pin Attributes Documentation Structure
    2. AM263P4 Technical Reference Manual - eCAP Input Selection from INPUTXBAR

    Best Regards,

    Zackary Fleenor

  • Hi Fleenor , 
       In pin attributes below signals only mentioned , the output xbar mentioned in TRM ecap destination is not present.Could you please confirm in datasheet for the dedicated pins of input x bar or eCAP

  • Hi Jayakeerthana,

    The tables you have shown in your previous response are all related to the OUTPUTXBAR which is a completely different entity/mux than the INPUTXBAR.

    Please review all of section 7.5.11 (X-Bar) for clarity on the difference.

    This information isn't mentioned in the datasheet, as any GPIO can be used as an input signal to the INPUTXBAR, and then any INPUTXBAR output signal can be configured as the input the ECAP.

    This is shown in the TRM diagram at the following link (https://www.ti.com/lit/ug/spruj55d/spruj55d.pdf#page=917)

    Apologies as I am currently unable to insert screenshots into the response. Please review the diagram in the link above for reference.

    Best Regards,

    Zackary Fleenor

  • Hi Fleenor,
          Please confirm me whether the all GPIOs can be be mapped to the input XBAR to the eCAP as mentioned i TRM.

  • Yes, this is correct. Any GPIO can be mapped to any INPUTXBAR input and all INPUTXBAR outputs are connected to the ECAP input mux.

    Best Regards,

    Zackary Fleenor