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.
Dear Sir / Madam
i have TM4c1290NCPDT TIVA ware uC which i want to use to generate the Square wave signal with Desired Freq but with Fine Accuracy i.e. i want to use it with 50 Khz and Also with 5Khz too but with accruacy of +/- 0.1Hz.
I have used the PWM Generator Block for the same.
But it will not work properly.
Suppose i want to Generate the PWM with 4KHz signal then i should write the as per formula in uPWMload is:
My system clock is 60MHz now divisor is 64 so 60000000/64 = 937500 now in order to make 4kHz signal i have do : 937500/4000 = 234.375
Now i have to load in ROM_PWMGenPeriodSet(PWM0_BASE, PWM_GEN_2, 234.375);but the API wants the unsigned int so it will be truncated to 234 so it will give me e
altered from 4KHz to 3.963 KHz now what should i want to do? for the correct 4KHz.
Thanks and regards
Pradhan
Hi,
As you already observed, it is not possible to have the required accuracy with actual PWM module. This is due also to the nature of digital dividers implemented. For more specific needs like your it is better to use a specialised chip. The suggested one is cheap enough to be used; but of coarse, you know better other undisclosed requirements to decide for or against its use.
Hi,
You claim this: "i want to use to generate the Square wave signal with Desired Freq but with Fine Accuracy " in your first post on this thread - if so, then use the suggested chip instead the PWM to get the signal. If you still need a PWM, then you should ask for "generate a pulse signal" with specified duty factor.
cb1_mobile said:This appears to be the "second of N" identical, posted requirements - most likely a school assignment. Should not such questions be addressed to the teacher - or his/her assistants?
Also perhaps the two can get together, sometimes it's easier to deal deal with the instructor as a group rather than fearing exposing yourself as ill-prepared.
cb1_mobile said:
In particular - I'd ask the teacher, "How might a simple MCU achieve so tight (0.1Hz) a tolerance when multiple variables - some outside of the MCU's control/domain - surely will impact results?
Somehow. I suspect that's not quite what the instructor requested. But you never know.
Robert
And sometimes the instructor is looking for pupils to find why something is impossible
Robert Adsett said:Somehow. I suspect that's not quite what the instructor requested
While "in the realm" the fact that "now" two have made the identical (unreasonable) request strongly suggests that posters are simply repeating what they've been told.
The spectacular "imbalance" between poster understanding and requirement's presentation signals (immediately) that NOT, "All is well."