Hi,
For one of our customers, Im am trying to implement a PWM Frequency Converter from 400Hz fixed frequency to 2KHz fixed frequency using SLG46826V. However, I couldn't make it.
I have checked the PWM Frequency Conversion example, there is a PWM Block which SLG46826V doesn't have. I have checked other PWM examples. The concept is okay but, I couldn't get the DUTY adjusted. Ideally, I want to read the duty from the 400Hz PWM signal and write it to 2KHz PWM signal. How can I achieve this application using SLG46826V? I have a board with SLG46826V, and we have some in stock. Also the quantity is low, therefore the customer will program them during production. Regards,
Caner Alp Electronix
Thanks for the reply.
Which part would you suggest then? It would be nice if we can have 2 PWM signals in one IC.
My "default" GreenPAK is the SLG46620 and it has three PWM generators, so should be quite suitable for this task.
hanks for the suggestion. I have selected SLG46621V which has dual VDD. I have copied the AN-CM-271 PWM Frequency Converter application. However, I can't get it working. There are some problems when I check with the rule checker. The problems are basically the orange connections shown in the example application below.
In my application, I don't get any of those orange connections although I have configured them exactly the same way as in the example application. Are these connections supposed to be connected automatically when configured or am I missing something? The only difference I see is that the IC I selected has two different matrixes.
PWM Frequency Converter.zipRegards,Caner
This is because the blocks are powered down. Connect the shared PD connection on the PWM1 to GND, and connect nCSB on SPI to GND. The orange lines will then appear.
Thanks! I have the connections now. I still have a problem though. The SPI buffer doesn't take data.
The SPI block takes data on an nCSB pulse. In your example, I have added CNT0 to NCSB. Your CNT2 is clocked using CNT1, which has value 25, so period 26. There are 16 bits to latch, so 26*16=416, to get a period of 416, we need to set CNT0 to 415.
Then it works:
Yes it is working now, however it is a bit inconsistent.
3583.PWM Frequency Converter.zip
I would add a probe at CNT0 and check when the nCSB pulse happens and compare it against the value of CNT2 at that specific moment. Maybe something needs to be tweaked.
I think the problem is the SPI Buffer value which keeps changing.
In the original example it stays as the same value. Can I achieve this behavior?
Also see section 17.3 SPI Clock synchronization of the SLG46621 datasheet.
Enabling the clock synchronization doesn't help either.
Looks to me that the SPI is loaded way too often, the period of the nCSB pulse needs to be adjusted and I think it needs to get the same period as the PWM.