<html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>AVRPWM1SetDuty</title> <style type="text/css" media="all"> @import url("scilab_code.css"); @import url("xml_code.css"); @import url("c_code.css"); @import url("style.css"); </style> </head> <body> <div class="manualnavbar"> <table width="100%"><tr> <td width="30%"> <span class="previous"><a href="AVRPWM0Setup.html"><< AVRPWM0Setup</a></span> </td> <td width="40%" class="center"> <span class="top"><a href="section_de1a1188d71074f6718f9b3e65179365.html">Scilab 2 C Converter</a></span> </td> <td width="30%" class="next"> <span class="next"><a href="AVRPWM1Setup.html">AVRPWM1Setup >></a></span> </td> </tr></table> <hr /> </div> <span class="path"><a href="index.html">Scilab 2 C Converter</a> >> <a href="section_de1a1188d71074f6718f9b3e65179365.html">Scilab 2 C Converter</a> > AVRPWM1SetDuty</span> <br /><br /> <div class="refnamediv"><h1 class="refname">AVRPWM1SetDuty</h1> <p class="refpurpose">Function to Set Duty cycle of PWM Output generated by Timer1 at OC1A or OC1B pin.</p></div> <div class="refsection"><h3 class="title">Parameters</h3> <dl><dt><span class="term">ouput_pin:</span> <dd><p class="para">integer, 0 (for OC1A) or 1 (for OC1B)</p></dd></dt> <dt><span class="term">duty:</span> <dd><p class="para">It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.</p></dd></dt> <dt><span class="term">Top_Value:</span> <dd><p class="para">It holds an integer value from 0 to 65535.This value sets the Top value of the counter TCNT1 i.e ICR.(for more info refer datasheet)</p></dd></dt></dl></div> <div class="refsection"><h3 class="title">Description</h3> <p class="para">Each Micro controller has PWM output pins which can generate varying voltage from 0V-5V.This function Sets the duty cycle of output PWM signal.Also this function decides the Top Vale of TCNT1 and the output pin to output PWM signal.</p> <p class="para">This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR.</p> <p class="para">Example AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty cycle on OC1A pin and TCNT1 will reset at 40000 instead at 65535.</p></div> <div class="refsection"><h3 class="title">See also</h3> <ul class="itemizedlist"><li class="member"><a href="AVRPWM1Setup.html" class="link">AVRPWM1Setup</a></li></ul></div> <div class="refsection"><h3 class="title">Authors</h3> <ul class="itemizedlist"><li class="member">Ashish Kamble</li></ul></div> <br /> <div class="manualnavbar"> <table width="100%"> <tr><td colspan="3" class="next"><a href="http://bugzilla.scilab.org/enter_bug.cgi?product=Scilab%20software&component=Documentation%20pages" class="ulink">Report an issue</a></td></tr> <tr> <td width="30%"> <span class="previous"><a href="AVRPWM0Setup.html"><< AVRPWM0Setup</a></span> </td> <td width="40%" class="center"> <span class="top"><a href="section_de1a1188d71074f6718f9b3e65179365.html">Scilab 2 C Converter</a></span> </td> <td width="30%" class="next"> <span class="next"><a href="AVRPWM1Setup.html">AVRPWM1Setup >></a></span> </td> </tr></table> <hr /> </div> </body> </html>