HI all,
After overworking the few functional brain cells that I have left. I was able to come up with a formula in Excel that accomplishes getting measurement numbers from a 16 bit timer into a value from 1 to 1000 for use in a Power Control PWM module.
The 16 bit upper and lower limits can be changed to adjust the PWM to different situations.
Now, I'm at a bit of a blank stare about how to convert it into code. Anyone think of search terms that might get me started on my homework?
formula: ((Echo-Min)/(Max-Min))*1000
Echo= captured value from 16 bit TMR1
Min= low setting for "0" PWM, (can be changed ) 16 bit
Max= high setting for 100% PWM (can also be changed) 16 bit
Thanks
Bo
Bookmarks