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

RTOS / CC2530ZDK-ZLL:On the ZLL of the PWM problem. The The anxious!

$
0
0

Part Number:CC2530ZDK-ZLL

Tool/software:TI-RTOS

void halTimer1SetChannelDuty (uint8 channel, uint16 promill)
{
#define MIN_PROMILL 20
uint16 count;

if (promill < MIN_PROMILL)
promill = 0;

count = (uint16)( ((uint32)(Timer1MaxCount) * promill + 500)/ 1000 );
count = ( (count >= Timer1MaxCount) ? Timer1MaxCount-1 : (count == 0 ? 1 : count) );

halTimer1SetChannelCount(channel, count);
}

In the above function, why in that formula to add 500? Why divided by 1000? The theory is not divided by 100 right?


Viewing all articles
Browse latest Browse all 262198

Trending Articles



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