2019-07-01 04:19 AM
.i need help with calculating clock and time peroid and waht is other pwm pin if pwm0 has d10 which is complemetary pin in spc56el70l5-disp
Solved! Go to Solution.
2019-11-14 06:04 AM
Hi,
as already explained, when the synchronization is enabled, all the submodules are managed as a unique driver with 8 channels (ch0 = A0, ch1 = B0, ch2 = A1, ch3 = B1, ch4 = A2, ch5 = B2, ch6 = A3, ch7 = B3). So, if you want to enable the outputs A1 and B1, you have to activate in the PWM configuration the channels 2 and 3 (see Sync_Conf.JPG in attachment). In attachment you can find the modified version of your project in which I have enabled the channels A0, B0, A1 and B1 (in particular, I have configured B0 as the complementary of A0 and B1 as the complementary of A1). In the picture Sync_PWM_Waveforms.JPG you can see the output waveforms.
Best Regards,
Luigi
2019-07-01 06:44 AM
Hi,
let me suggest you to download SPC5Studio from ST web site. It is a tool that allows you to easily configure our cores and generate specific applications for them. It also contains a lot of examples. Some of these are specific for the FlexPWM configuration. In attachment you can find an SPC5Studio project in which the FlexPWM0 of the core SPC56EL70L5 is configured to generate 2 complementary PWM signals with a duty cycle of 50% and a frequency of 20KHz, the PWMA0 on the pin D[10] and the PWMB0 on the pin D[11]. The project has been developed for the development board SPC56EL70L5DISP (Discovery Kit for the L Line.) , on which the pin D[10] is connected with the pin B23 on the external connector X6, and the pin D[11] is connected with the pin B3 on the external connector X6.
Best Regards,
Luigi
2019-07-01 11:24 PM
thank you so much .... i have doubt how to vary duty like 0-100.pwm_lld_enable_channel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000)); here i change 5000 but it is not working total frequency u have is 80 Mhz and period of 400. is it like varying value 0-400 to percentage 0-100. that is also not working.
2019-07-02 11:01 PM
Hi,
in the example that I provided you, the third parameter of the function pwm_lld_enable_channel is the duty cycle. The value PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000) means you is setting a duty cycle of 50% of the whole PWM period. For example, if you change it to PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500), you will have a duty cycle of 25% of the whole PWM period. The PWM period is obtained as number of ticks of the Clock Frequency (set to 80MHz in the project that I shared with you). In particular, a period of 400 ticks means the the PWM period is 400 / 80MHz = 5ms, i.e. the PWM frequency is 1 / 5ms = 20KHz. If you want to change the period, you can modify the Clock Frequency or you can modify the number of ticks. But, please, consider that the Clock Frequency is obtained by the Motor Control clock by dividing it for a prescaler, and the value of the prescaler can be 1, 2, 4, 8, 16, 32, 64 or 128. So, it is not possible to set any value for the Clock Frequency. In the project that I shared with you the Motor Control clock frequency is set to 80MHz and alsi the Clock Frequency is also set to 80MHz, so the prescaler is automatically configured to 1.
Best Regards,
Luigi
2019-07-02 11:19 PM
thank you ..you have been very helpful..
2019-07-11 11:02 PM
can you help me to get simple CAN transmission and reception using interrupts
with standard CAN in normal mode ..i find that example in spc studio difficult and hard to understand..
2019-07-12 07:01 AM
Hi,
the best way to proceed is a cross check between the FlexCAN low level driver included in SPC5Studio and the Reference Manual of the core. Then, if you will find a specific topic, please, feel free to contact us on the forum.
Best regards,
Luigi
2019-07-18 01:40 AM
I want a simple CAN transmission of variable using standard mode can..please help..could you provide an example application
2019-07-18 02:06 AM
Hi,
have you given a look to the example SPC56ELxx_RLA CAN Test Application for DiscoveryPlus included in SPC5Studio? This should be aligned with your requirements because it simply uses the FlexCAN0 to send 3 messages in loopback. You can modify the sent message with your variable and everything should work fine.
Best Regards,
Luigi
2019-07-18 02:12 AM
i have seen that i compiled and its working as it should be...in loop back mode ..i need example for configuring time quanta and transmitting in normal mode ...too many new functions in that i cannot able to send simple variable and recieve using interrupt ...can ID also confusing.... please help