Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RM48L952ZWT HalCoGen 4.03.00 het.c pwm functions and math precision for float calculations

$
0
0

Hello. We are using your TI Hercules RM48L942ZWT processor with HalCoGen 4.03.00.  for the autogenerated het.c functions -- we had needed the pwmSetSignal and pwmGetSignal - we needed the duty cycle to allow for float (the default autogenerated from HalCoGen had the dutyCycle as uint and period as float). We changed the dutyCycle in both functions to be float32.  When we call the setSignal routine and pass it i.e., 62.0% duty cycle and period of 10000.00 for example. When we call the pwmGetSignal function immediately after calling the pwmSetSignal routine, dutyCycle is returned as =61.999... and period = 9999.36....

Why are the values not the same? Isn't the math the same, even when we change the uint type to float type?  Thank you.


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>