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.

Frequency in Rm48L952

Other Parts Discussed in Thread: RM48L952, HALCOGEN

I have few doubts in RM48 PWM generation.

The system Clock of RM48 is 220 MHz. and what is the maximum PWM frequency generated by the controller (RM48L952). How to calculate the PWM output frequency.

  • Manjunathan,

    At 220MHz, you can run N2HET at 110MHz on the RM48L952.
    This means a 9.09ns clock.

    Let's say you only want one PWM. You could probably implement this with an 8 cycle loop resolution period, it takes one count and one ECMP instruction and then you'll probably want a buffer instruction for updating the duty cycle. And you need to leave 1 cycle to spare (8 cycle loop means max 8-1 = 7 cycle program).

    Ok then you would need at least two loop resolution periods - one to set the pin high and one low. That means 16 cycles at 9.09ns or 145ns period which is about 6.8MHz.

    That much said - this would use a whole N2HET for one PWM and the resolution is 1 part in 16 or basically 4 bits. That's a bit on the extreme side of speed v.s. usefulness - so you can scale accordingly.

    If you need addtional PWMs out of the same N2HET then figure about 5 cycles for each at least - and figure at least 2 loop resolution periods are needed. Then also consider the resolution you need. At the end of the day- you're always going to be working in 9.09ns minimum steps so once you are using the minimum time step of 9.09ns if you want more resolution for the duty cycle you have to slow down the period.

    -Anthony
  • Thank you Mr.Anthony F. Seely
  • Sir, i need to generate totally 8 PWM outputs each of them with output signal frequency of 10 KHz each from the NHET or through GPIO. As you explained above i have calculated for 8 PWM outputs (510ns which is about 1.69MHz and i dint considered the resolution at all). whether the calculations that is made are correct?
  • Manjunathan,

    You won't have any with a 10KHz PWM period on this device.   I wouldn't worry about counting cycles for the PWM program just yet because as long as your program can execute multiple times within the PWM period it will work well and you can execute about 8 loops of a complex PWM program of 128 execution cycles within a 10KHz period.

    If you are running at 9.09ns, (110MHz HET) you'll have just under 13.5 bits of resolution for your duty cycle. 

    -Anthony 

  • Thanks a lot Sir. i need to work with closed loop system of controlling the Pneumatic actuator (the PWM operating frequency of Actuator is 10 KHz) with flow sensor feedback. Can i get some sample codes related to it (bench marking Codes)
  • Hi Manjunathan,

    The HET IDE includes an 'algorithm library' which has both input and output templates.
    There are 8 different kinds of PWMs in the template and of course you can create your own based on these.

    Then you can assembly your HET code and simulate it in the HET IDE to make sure it's what you want.

    After this you should have a header and a "C" file in the HET IDE project folder - these are your HET assembly program converted to "C" functions so that they can be built into your MCU application code.

    If you use HalCoGen, then there is a checkbox in the HET tab 'Enable Advanced Config Mode'.  If you check this box, it asks you to select a header and a C file.   Navigate to the HET Project you create and pick the C and H files from your code.   HalCoGen will make a copy and when call hetInit() it will load *your* program into the HET instead of the blackbox driver.

     

  • Thank you Mr.Anthony F. Seely. i will work on the procedure. 

    Thanks and regards

    K.Manjunathan