summaryrefslogtreecommitdiff
path: root/2.3-1/help/en_US/scilab_en_US_help/AVRPWM1SetDuty.html
blob: 03403a84a3ae75a3196d6a57b480749b4c406a28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<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">&lt;&lt; AVRPWM0Setup</a></span>

      </td>
      <td width="40%" class="center">
      	<span class="top"><a href="section_473a2b9e79723ff76a7f243f85d2b6b8.html">Scilab 2 C Converter</a></span>

      </td>
      <td width="30%" class="next">
      	<span class="next"><a href="AVRPWM1Setup.html">AVRPWM1Setup &gt;&gt;</a></span>

      </td>
    </tr></table>
      <hr />
    </div>



    <span class="path"><a href="index.html">Scilab 2 C Converter</a> &gt;&gt; <a href="section_473a2b9e79723ff76a7f243f85d2b6b8.html">Scilab 2 C Converter</a> &gt; 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">&lt;&lt; AVRPWM0Setup</a></span>

      </td>
      <td width="40%" class="center">
      	<span class="top"><a href="section_473a2b9e79723ff76a7f243f85d2b6b8.html">Scilab 2 C Converter</a></span>

      </td>
      <td width="30%" class="next">
      	<span class="next"><a href="AVRPWM1Setup.html">AVRPWM1Setup &gt;&gt;</a></span>

      </td>
    </tr></table>
      <hr />
    </div>
  </body>
</html>