📄 basic.html
字号:
256 values (from 0 to 255). The sampling range is also fixed at 8 KHz. For an
audio signal (from 0 to 4 KHz), the clock divider is therefore 23,43. The PWM
divider supports only an integer value and can be set to 23, then generates an
error of 1,74% only.<o:p></o:p></span></p>
<h2><span lang=EN-US style='mso-ansi-language:EN-US'>Over Sampling
consideration<o:p></o:p></span></h2>
<p><span lang=EN-US style='mso-ansi-language:EN-US'>If the sampling frequency
is fixed at 8 KHz the hardware needs a good integrator to reject the basic
integrator filter frequency, to reduce the hardware implementation this
application example uses the over sampling method.<o:p></o:p></span></p>
<p><span lang=EN-US style='mso-ansi-language:EN-US'>The choice of over sampling
rate can set at the maximum output PWM frequency.<o:p></o:p></span></p>
<p><span lang=EN-US style='mso-ansi-language:EN-US'>For the 8-bit resolution
and the SAM7S is running at 48 MHz with an error which is lower than 2,5%, the
SAM7S PWM can be over sampled at 64 KHz.<o:p></o:p></span></p>
<h2><a name="Hardware_resource">User Manual</a></h2>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>Power on the
board through the USB cable.</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>The different
Push Buttons have been configured as described below:</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>PA19: Push
Button 1, Open the PWM channel and Output a constant middle range.</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>PA20: Push
Button 2, Open the PWM channel and Output a 800 Hz Sinusoidal.</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>PA15: Push
Button 3, Open the PWM channel and Output an Audio file.</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>PA14: Push
Button 4, Close the PWM channel</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>You can use a
hyperterminal application on your PC through the DBGU to have access to a
specific menu:</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>- Connect the
DBGU board port with a RS232 null modem cable (female / female)</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>- Open a
hyperterminal application on your host computer and configure it with: 115200, 8
bits, without Parity and one stop bit.</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>The following
menu should appears:</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>ATMEL PWM</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>0)Info</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>1)MIPS</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>2)Open PWM</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>3)Close PWM</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>4)Const</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>5)Ramp</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>6)Sinus</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>7)Wave</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>The following
commands are then available:</span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2;
tab-stops:list 36.0pt'><span style='mso-bookmark:Hardware_resource'><![if !supportLists]>0)<span
style='font:7.0pt "Times New Roman"'> </span><![endif]>Display
the PWM registers to check the PWM Controller configuration</span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2;
tab-stops:list 36.0pt'><span style='mso-bookmark:Hardware_resource'><![if !supportLists]>1)<span
style='font:7.0pt "Times New Roman"'> </span><![endif]>Measure
the number of MIPS available (Thumb instructions running in flash).<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2;
tab-stops:list 36.0pt'><!-- ******* Contents ********** !--><span
style='mso-bookmark:Hardware_resource'><![if !supportLists]>2)<span
style='font:7.0pt "Times New Roman"'> </span><![endif]>Open
the PWM channel<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2;
tab-stops:list 36.0pt'><!-- ******* Contents ********** !--><span
style='mso-bookmark:Hardware_resource'><![if !supportLists]>3)<span
style='font:7.0pt "Times New Roman"'> </span><![endif]>Close
the PWM channel<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2;
tab-stops:list 36.0pt'><!-- ******* Contents ********** !--><span
style='mso-bookmark:Hardware_resource'><![if !supportLists]>4)<span
style='font:7.0pt "Times New Roman"'> </span><![endif]>Set
the value to output a constant (requires a DC value)<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2;
tab-stops:list 36.0pt'><!-- ******* Contents ********** !--><span
style='mso-bookmark:Hardware_resource'><![if !supportLists]>5)<span
style='font:7.0pt "Times New Roman"'> </span><![endif]>Set
the value to output a ramp (requires the ramp frequency).<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2;
tab-stops:list 36.0pt'><!-- ******* Contents ********** !--><span
style='mso-bookmark:Hardware_resource'><![if !supportLists]>6)<span
style='font:7.0pt "Times New Roman"'> </span><![endif]>Set
the value to output a Sinus (requires the Sinusoidal frequency)<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2;
tab-stops:list 36.0pt'><!-- ******* Contents ********** !--><span
style='mso-bookmark:Hardware_resource'><![if !supportLists]>7)<span
style='font:7.0pt "Times New Roman"'> </span><![endif]>Set
the value to output an audio file loaded in on-chip Flash at 0x104000. This
file must be an Audio file coded in 8-bit at 8 KHz.<o:p></o:p></span></p>
<p class=MsoNormal><!-- ******* Contents ********** !--><span
style='mso-bookmark:Hardware_resource'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<h2><span style='mso-bookmark:Hardware_resource'>Requirement</span><span
style='mso-bookmark:Hardware_resource'><span style='font-weight:normal'><o:p></o:p></span></span></h2>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'>In this project
example, we are assuming to have the master clock MCK at 47.9232 MHz on the
AT91SAM7S64-IAR</span></p>
<p class=MsoNormal><span style='mso-bookmark:Hardware_resource'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><!-- ******* Contents ********** !--><span
style='mso-bookmark:Hardware_resource'><b><span lang=EN-US style='mso-ansi-language:
EN-US'>Hardware requirements:</span></b></span><b><span lang=EN-US
style='mso-ansi-language:EN-US'><o:p></o:p></span></b></p>
<p class=MsoNormal style='text-indent:36.0pt'><a name=AT91><b><span lang=EN-US
style='mso-ansi-language:EN-US'>AT91SAM7S64 Product</span></b></a><b><span
lang=EN-US style='mso-ansi-language:EN-US'><o:p></o:p></span></b></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=FR style='mso-ansi-language:FR'>- DBGU :</span></b><span lang=FR
style='mso-ansi-language:FR'> DBGU Configuration<b> (115200, 8, N, 1)</b><span
class=MsoHyperlink><o:p></o:p></span></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=FR style='mso-ansi-language:FR'>- Timer :</span></b><span lang=FR
style='mso-ansi-language:FR'> Timer 0 & Timer 1<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=EN-US style='mso-ansi-language:EN-US'>- PWM :</span></b><span lang=EN-US
style='mso-ansi-language:EN-US'><span style="mso-spacerun: yes">
</span>PWM0 Channel <o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=EN-US style='mso-ansi-language:EN-US'>- PIO :</span></b><span lang=EN-US
style='mso-ansi-language:EN-US'> PIOA Controller<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=EN-US style='mso-ansi-language:EN-US'>- PMC :</span></b><span lang=EN-US
style='mso-ansi-language:EN-US'> Power Management Controller (PA11 outputs the
PWM Channnel 0)<o:p></o:p></span></p>
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;
margin-left:36.0pt;text-indent:36.0pt'><b><span lang=EN-US style='mso-ansi-language:
EN-US'>- AIC :</span></b><span lang=EN-US style='mso-ansi-language:EN-US'>
Advanced Interrupt Controller<o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:36.0pt'><a name=EBxx><b><span lang=EN-US
style='mso-ansi-language:EN-US'>AT91SAM7S-EK </span></b></a><span
style='mso-bookmark:EBxx'><span lang=EN-US style='mso-ansi-language:EN-US'>Evaluation
Koard</span></span><span lang=EN-US style='mso-ansi-language:EN-US'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span lang=EN-US>Push Buttons and LEDs: The FIQ,
IRQ0, TIOA0 and TIOB switches are debounced and buffered. <br>
Please note that the jumper CB6 must be open (SW1-4 inputs to the AT91 are
valid). By default, this jumper is not equipped (open) </span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=EN-US style='mso-ansi-language:EN-US'>- SW1 :</span></b><span lang=EN-US
style='mso-ansi-language:EN-US'> (AT91C_PA19_FIQ) Used in peripheral mode for
the FIQ input<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=EN-US style='mso-ansi-language:EN-US'>- SW2 :</span></b><span lang=EN-US
style='mso-ansi-language:EN-US'> (AT91C_PA20_IRQ0) Used in peripheral mode for
the IRQ0 interrupt<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=EN-US style='mso-ansi-language:EN-US'>- SW3 :</span></b><span lang=EN-US
style='mso-ansi-language:EN-US'> (AT91C_PIO_PA15) Used in standard PIO mode for
the PIO input <o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
lang=EN-US style='mso-ansi-language:EN-US'>- SW4 :</span></b><span lang=EN-US
style='mso-ansi-language:EN-US'> (AT91C_PIO_PA16) Used in standard PIO for the
PIO interrupt<o:p></o:p></span></p>
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;
margin-left:90.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo4;tab-stops:list 90.0pt'><![if !supportLists]><span
lang=EN-US style='mso-ansi-language:EN-US'>-<span style='font:7.0pt "Times New Roman"'>
</span></span><![endif]><b><span lang=EN-US style='mso-ansi-language:EN-US'>LED1
to LED4 :</span></b><span lang=EN-US style='mso-ansi-language:EN-US'> Used in
standard PIO output <o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><span lang=EN-US
style='mso-ansi-language:EN-US'>Audio file:</span></b><span lang=EN-US
style='mso-ansi-language:EN-US'><o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US
style='mso-ansi-language:EN-US'><span style='mso-tab-count:1'> </span>An
audio file including the wave standard format<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt;text-indent:36.0pt'><span
lang=EN-US style='mso-ansi-language:EN-US'>Mono 8 bits at 8 KHz <o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt;text-indent:36.0pt'><span
lang=EN-US style='mso-ansi-language:EN-US'>This file must be loaded at 0x104000
<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt;text-indent:36.0pt'><span
lang=EN-US style='mso-ansi-language:EN-US'>One example it’s available in the
src folder (check file 5400_8_1.*).<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US
style='mso-ansi-language:EN-US'>Hardware filtering<o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US
style='mso-ansi-language:EN-US'>A basic analog filter it used for integrator
filtering.<o:p></o:p></span></p>
<p class=MsoNormal align=center style='margin-bottom:12.0pt;text-align:center'><span
lang=EN-US style='mso-ansi-language:EN-US'><!--[if gte vml 1]><v:shape id="_x0000_i1042"
type="#_x0000_t75" style='width:246pt;height:89.25pt' o:ole="">
<v:imagedata src="./basic_files/image005.wmz" o:title=""/>
</v:shape><![endif]--><![if !vml]><img width=328 height=119
src="./basic_files/image006.gif" v:shapes="_x0000_i1042"><![endif]><!--[if gte mso 9]><xml>
<o:OLEObject Type="Embed" ProgID="Word.Picture.8" ShapeID="_x0000_i1042"
DrawAspect="Content" ObjectID="_1176123294">
</o:OLEObject>
</xml><![endif]--><o:p></o:p></span></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US
style='mso-ansi-language:EN-US'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
</div>
<!-- ******* FILE ********** !-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -