I would like to generate a real-time PWM with several C2000 controllers.
Is there a good way to do this with the TMDSCNCD28379D using serial communication?
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.
I would like to generate a real-time PWM with several C2000 controllers.
Is there a good way to do this with the TMDSCNCD28379D using serial communication?
Hi David!
Could you help expand a bit on what you are trying to do? What is the reasoning for using SCI here?
Do you mean that you are trying to send data from one C2000 to another and have the other device(s) update the EPWM signals based upon what is being sent via SCI?
Best Regards,
Allison
Hi Allison!
I want to send data containing calculated PWM signals to a C2000, which sends the data to another C2000 and so on. The microcontrollers should output the PWM from the data.
It is important that the PWM signals output by the controllers are synchronised with each other.
Best Regards,
David
Hi David,
Do you mean that you want to use the SCI data lines as PWM signals? Or need to communicate information to be used by the PWMs? Just wanting to be sure I'm interpreting the wording here correctly!
Does this past post describe a similar situation to yours at all? https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/844385/tms320f28379d-use-output-of-epwm-and-synchronize-them
You'll need to leverage the external sync source (EXTSYNCIN) options to sync PWMs across devices.
Best Regards,
Allison
Hello Allision,
thanks for your message. Yes, as David already said, we want to communicate information to be used by the PWMs. Moreover, due to the high voltage isolation between each controller, the communication is done via fiber optical lines. Therefore, the synchronization should be done also with the communication lines and not with an extra fiber line on the EXTSYNCIN signal.
We are also planning to use the F28388 and have the option of using Ethercat.
Do you have a solution to synchronize with the communication line?
Best regards,
Patrick
Hi Patrick,
One idea is to leverage the XBARs and CLB. You can have INPUT XBAR read the communications line reading idle by default and se this as the initial CLB state machine (e.g. state 0). As soon as the idle communications line becomes active, the CLB can detect this and go to another state (e.g. state 1) where the EPWM is starts up. If the communication transmission is sent to all the devices at the same time, the EPWMs would be synced.
You could also look into changing the GPIO settings of the fiber optic GPIOs to use OUTPUT XBAR (EXTSYNCOUT).
Best Regards,
Allison
Hello Allison,
thanks Allison for your quick reply.
Normally, one sync at the beginning should be fine but I think that due to the long operating time a synchronization after a predefined time is necessary.
We would like to use a daisy chain to reduce the number of wires. A small delay between each module is acceptable. We are not committed to a specific communication protocol. We plan to use something similar to UART.
Thanks for your solution. We will evaluate it soon.
Best Regards,
Patrick
Hi Patrick,
Syncing once in the beginning should be fine if you are starting them at the same time by communicating to all devices at the same time. Issuing a sync later would likely need to be implemented in another way though - could be in hardware if you can spare the extra connection. Otherwise through software.
By daisy chaining are you implying you send it through one device at a time? Or would the communication reach each device essentially simultaneously?
And yes let me know if you have thoughts on the proposal.
Best Regards,
Allison
Hello Allison,
Ideally, each device will communicate simultaneously, but due to hardware, there is a delay between each controller that should be corrected by the controller.
Best regards,
Patrick
Hi Patrick,
I don't think there should be an issue in terms of using data that is serially communicated to the devices to influence the PWM outputs of each device. My only questions are still of the syncing of PWMs - below are my thoughts in terms of syncing the PWMs across multiple devices:
1. What is typically done in a case like this where you have multiple devices, is you connect the devices together and issue sync pulses via the hardware (external sync source), but it sounds like this is not possible for your situation. If you start the PWMs up at the same time, they should remain in sync, but if there is delay between the start times across the devices, this delay would remain if you cannot utilize hardware syncs.
2. Another idea would be if you are able to measure the delay or have some way of knowing the amount of delay/shift between the PWMs. If you know what the delay is, this can be corrected for each individual device by phase shifting the PWM in software.
Do you know the length of delay and if it will remain fixed?
Best Regards,
Allison
Hi Allison,
We know the length of the delay because it depends on the hardware. I think the phase shift correction should be a good solution.
I marked your previous reply as a solution.
We will try both solutions. 1) Sync at the beginning without external sync; 2) Sync from external source and correct the delays with the phase shift.
Thanks for your help.
Best regards,
Patrick