📄 上海齐济电子-应用技巧-pic单片机开发的若干问题.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0042)http://www.chipgem.com.cn/refer/yyjq80.htm -->
<HTML><HEAD><TITLE>上海齐济电子-应用技巧-PIC单片机开发的若干问题</TITLE><!-- InstanceBegin template="/Templates/temp1.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<META content="text/html; charset=gb2312" http-equiv=Content-Type><LINK
href="<%=webstylefile%>" rel=stylesheet type=text/css>
<META
content="齐济电子,元器件代理,元器件经销,芯片销售,单片机销售,电子元器件,国外器件,偏冷门器件,存储器,外围器件,运放,模拟转换,电子产品方案,单片机设计方案,MCU,EEPROM, A/D, OP, PWM ,microchip ,ATMEL, HOLTEK ,catalyst, csi ,24wc ,PIC ,24LC ,24C, HT48, HT49 ,HT46, HT7 ,HT16 ,AT ,89C, 87C,P87 ,PCF ,LPC ,25LC, 25C, 红外线 ,感应洁具, 圣洁力, 冲水设备, 感应器, 感应水龙头 ,感应小便 ,感应大便, 给皂器 ,干手机 ,干手器 ,烘手器 ,给皂机,皂液机 ,节水设备, 自动冲水 ,冲洗阀, PIC16C5X,PIC16C7X,PIC16F87X,PIC12C508A , pic16f72,pic16f73,pic16c74b,pic17c44 , pic16f870,pic16f871,pic16f872,pic16f873a , pic16f874a,pic16f876a,pic16f877a,pic18f242 , pic18f252,rfpic12f675,pic18f8720,pic18f6720 , 24lc01,24lc02,24lc16,24lc128 , PIC12C508,pic12c509a,pic16c54c,pic16c505 , pic16c56a,pic16c57c,pic12f629,pic12f675 , pic12c671,pic12c672,pic12ce673,pic16c622a , pic16c62b,pic16c63a,pic16c65b,pic16ce624 , pic16ce625,pic16f627a,pic16f628a,pic16f630 , pic16f676,PIC16C711,PIC16C712,pic16c716 , pic16c717,pic16c72a,pic16c73b,pic16f84a , pic16c77,pic16c,pic16f74,pic16f7x , 24lc256,24lc04,HT48R05A,HT48R06A,HT48R10A,HT48R50A , HT49R50A,HT46R47,HT7033A,HT7044A , HT1621,HT7130A,ht48r30,ht48r50 , ht48r70,ht49r30,ht49r70,ht46r22 , ht46r23,ht46r24,ht46r63,ht46r64 , ht46r65,ht9170,ht9200,ht7050 , ht7150,ht24lc02,ht24lc04,ht24lc16 , ht24lc08,HT1622, 单片机,单片机开发,方案开发,PIC , HOLTEK,microchip,太阳能热水器,太阳能应用 , 感应器,自动感应洁具,自动水龙头,自动冲水器 , MPLAB,开发工具,ic卡燃气表,上海盛扬, 微芯,合泰,电子元器件,太阳能热水器控制器, 芯片,仿真器,烧录器,烧写器, IDE3000,编程器,Holtek代理,Holtek芯片销售, Microchip代理,Microchip销售,IC,IC销售 , MCU销售,单片机论坛,pic单片机论坛, 感应洁具,感应器,干手器,冲水阀,圣洁力,龙头,感应龙头,皂液器,烘手器,自动洗手器,自动阀,给皂机,干发器,医用洗手器,干肤器,感应小便器,手术室洗手器,冲水设备,小便斗冲水器,智能龙头,医洗,小便冲水器,红外线感应洁具,一体感应龙头,小便斗冲水阀, 感应器,自动感应洁具,自动水龙头,自动冲水器 , 感应洁具,医洗,干手器,冲水阀 , 龙头,感应龙头,皂液器,烘手器 , 自动洗手器,自动阀,干发器,给皂机 , 医用洗手器,干肤器,感应小便器,手术室洗手器 , 冲水设备,小便斗冲水器,智能龙头,小便冲水器 , 一体感应龙头,感应电子洁具,感应式洁具,小便斗冲水阀 , 暖手器,感应式烘手器,烘手器价格,感应冲水器 , 自动冲水,感应卫生洁具,自动皂液器,感应皂液器 , 皂液机,自动洗手机,红外线自动洗手机,给皂器 , 红外线冲水器,一体化水龙头,一体化小便斗,红外线感应洁具,ht7033 ,直流放大,pic16f87x,太阳能热水器,ht48r,pic,pic16f630,sst89c54 在线可编程,spce061a,小功率变压器,高频变压器设计,12c508+编程电压,单片机 论坛,单片机,microchip,ds1302原理图,温度测量,晶闸管触发电路,温度测量,16f628 复位电路,报警电路设计,浮点数运算程序,电话拨号报警器电路,电话拨号报警器电路,QuickStart开发包,aduc812"
name=keywords>
<META
content=上海齐济集成电子有限公司的网站是一个专业性的电子咨询类网站,网站分为产品资料中心、应用实例与技巧、资料下载、方案介绍、单片机论坛、网上销售商城六个栏目,我们尽最大努力为单片机使用者与爱好者提供尽可能多的资料及咨询,你可以在我们的单片机论坛畅所欲言,交流各种使用经验,同时在我们的的商城中,可以很方便地采购各种样片及满足你批量生产的需要。
name=description>
<SCRIPT src="上海齐济电子-应用技巧-PIC单片机开发的若干问题.files/mystat.htm"></SCRIPT>
<!-- InstanceBeginEditable name="doctitle" --><!-- InstanceEndEditable --><!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<SCRIPT language="JavaScript ">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</SCRIPT>
<SCRIPT
src="D:\Documents and Settings\jb\桌面\PIC文章\上海齐济电子-应用技巧-PIC单片机开发的若干问题.files\mystat(1).htm"></SCRIPT>
<LINK href="上海齐济电子-应用技巧-PIC单片机开发的若干问题.files/green.css" rel=stylesheet
type=text/css>
<META content="MSHTML 5.00.3700.6699" name=GENERATOR></HEAD>
<BODY>
<TABLE align=center border=0 borderColor=#0099ff width=768>
<TBODY>
<TR>
<TD colSpan=3></TD></TR>
<TR>
<TD align=middle rowSpan=3 width=120><IMG height=75
src="上海齐济电子-应用技巧-PIC单片机开发的若干问题.files/logo.gif" width=120></TD>
<TD align=middle rowSpan=3><IMG height=60
src="上海齐济电子-应用技巧-PIC单片机开发的若干问题.files/chipgem.gif"></TD>
<TD width=25><IMG src="上海齐济电子-应用技巧-PIC单片机开发的若干问题.files/home.gif"></TD>
<TD width=60><A href="http://www.chipgem.com.cn/refer/yyjq80.htm#"
onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.chipgem.com.cn');">设为主页</A></TD></TR>
<TR>
<TD width=25><IMG src="上海齐济电子-应用技巧-PIC单片机开发的若干问题.files/email.gif"></TD>
<TD width=60><A
href="http://www.chipgem.com.cn/refer/contact.asp">联系我们</A></TD></TR>
<TR>
<TD width=25><IMG src="上海齐济电子-应用技巧-PIC单片机开发的若干问题.files/bookmark.gif"></TD>
<TD width=60><A href="http://www.chipgem.com.cn/refer/yyjq80.htm#"
onclick="javascript:window.external.addFavorite('http://www.chipgem.com.cn','上海齐济电子有限公司')">加入收藏</A></TD></TR>
<TR>
<TD colSpan=4>
<HR align=center class=hr SIZE=1 width="100%">
</TD></TR></TBODY></TABLE>
<STYLE>.button1 {
BORDER-BOTTOM: white 1pt; BORDER-LEFT: white 1pt; BORDER-RIGHT: white 1pt; BORDER-TOP: white 1pt; COLOR: menutext; FONT: menu
}
.button2 {
BORDER-BOTTOM: white 1pt; BORDER-LEFT: white 1pt; BORDER-RIGHT: white 1pt; BORDER-TOP: white 1pt; COLOR: menutext; FONT: menu
}
.button3 {
BORDER-BOTTOM: white 1pt; BORDER-LEFT: white 1pt; BORDER-RIGHT: white 1pt; BORDER-TOP: white 1pt; COLOR: menutext; FONT: menu
}
</STYLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=768>
<TBODY>
<TR>
<TD align=middle class=button2 onmousedown="this.className='button3'"
onmouseout="this.className='button2'" onmouseover="this.className='button1'"
onmouseup="this.className='button1'" vAlign=center><A
href="http://www.chipgem.com.cn/refer/index.asp"
target=""><B>本站首页</B></A></TD>
<TD align=middle class=button2 onmousedown="this.className='button3'"
onmouseout="this.className='button2'" onmouseover="this.className='button1'"
onmouseup="this.className='button1'" vAlign=center><A
href="http://www.chipgem.com.cn/refer/company.asp"
target=""><B>企业资讯</B></A></TD>
<TD align=middle class=button2 onmousedown="this.className='button3'"
onmouseout="this.className='button2'" onmouseover="this.className='button1'"
onmouseup="this.className='button1'" vAlign=center><A
href="http://www.chipgem.com.cn/refer/product.asp"
target=""><B>产品信息</B></A></TD>
<TD align=middle class=button2 onmousedown="this.className='button3'"
onmouseout="this.className='button2'" onmouseover="this.className='button1'"
onmouseup="this.className='button1'" vAlign=center><A
href="http://www.chipgem.com.cn/refer/project.asp"
target=""><B>方案介绍</B></A></TD>
<TD align=middle class=button2 onmousedown="this.className='button3'"
onmouseout="this.className='button2'" onmouseover="this.className='button1'"
onmouseup="this.className='button1'" vAlign=center><A
href="http://www.chipgem.com.cn/refer/application.asp"
target=""><B>应用技巧与实例</B></A></TD>
<TD align=middle class=button2 onmousedown="this.className='button3'"
onmouseout="this.className='button2'" onmouseover="this.className='button1'"
onmouseup="this.className='button1'" vAlign=center><A
href="http://www.chipgem.com.cn/refer/download.asp"
target=""><B>资料下载中心</B></A></TD>
<TD align=middle class=button2 onmousedown="this.className='button3'"
onmouseout="this.className='button2'" onmouseover="this.className='button1'"
onmouseup="this.className='button1'" vAlign=center><A
href="http://www.chipgem.com.cn/refer/bbs.asp"
target=""><B>单片机论坛</B></A></TD>
<TD align=middle class=button2 onmousedown="this.className='button3'"
onmouseout="this.className='button2'" onmouseover="this.className='button1'"
onmouseup="this.className='button1'" vAlign=center><A
href="http://www.chipgem.com.cn/refer/sale.asp"
target=""><B>在线销售</B></A></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=768>
<TBODY>
<TR>
<TD>
<HR align=center class=hr SIZE=1 width="100%">
</TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=768>
<TBODY>
<TR>
<TD><!-- InstanceBeginEditable name="EditRegion3" -->
<TABLE border=0 cellPadding=0 cellSpacing=0 width="99%"><!-- 正文区-->
<P><BR><FONT size=2><STRONG>
<CENTER><FONT size=3>应用技巧</FONT>/PIC单片机开发的若干问题 </CENTER></STRONG></FONT>
<P></P>
<P align=right><FONT face=楷体_GB2312 size=3></FONT><A
href="ftp://chipgem.vicp.net/Apply&Example/Apply/yyjq80.pdf">点击这里下载本页面内容的PDF文件</A></P><B><SPAN
style="FONT-SIZE: 9pt"><FONT color=#008080>摘 要:</FONT> </SPAN></B><SPAN
style="FONT-SIZE: 9pt">PIC单片机在国内日益流行,本文介绍Microchip
PIC系列单片机开发过程中软、硬件设计的一些经验、技巧。</SPAN> <SPAN style="FONT-SIZE: 9pt"><B>
<TBODY>
<TR><FONT color=#008080>关键词:</FONT> </B>Microchip单片机
功耗 编程</SPAN>
<TR><SPAN style="FONT-SIZE: 9pt"><B><FONT color=#008080>作者:</FONT>
</B><SPAN style="FONT-SIZE: 9pt">湖南长沙湖南师范大学计算机部(410006)
李继锋</SPAN></T>
<HR color=#008080>
<SPAN style="FONT-SIZE: 9pt">
由美国Microchip公司生产的PIC系列单片机,由于其超小型、低功耗、低成本、多品种等特点,已广泛应用于工业控制、仪器、仪表、通信、家电、玩具等领域,本文总结了作者在PIC单片机开发过程中的一些经验、技巧,供同行参考。</SPAN>
<B><FONT color=#008080><SPAN style="FONT-SIZE: 9pt">1
怎样进一步降低功耗</SPAN></FONT> </B></TR></P></TABLE>
<TABLE border=0 width="100%">
<TBODY>
<TR>
<TD width="100%"><SPAN style="FONT-SIZE: 9pt">
功耗,在电池供电的仪器仪表中是一个重要的考虑因素。PIC16C××系列单片机本身的功耗较低(在5V,4MHz振荡频率时工作电流小于2mA)。为进一步降低功耗,在保证满足工作要求的前提下,可采用降低工作频率的方法,工作频率的下降可大大降低功耗(如PIC16C××在3V,32kHz下工作,其电流可减小到15μA),但较低的工作频率可能导致部分子程序(如数学计算)需占用较多的时间。在这种情况下,当单片机的振荡方式采用RC电路形式时,可以采用中途提高工作频率的办法来解决。</SPAN></TD></TR></TBODY></TABLE>
<TABLE border=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top width="69%">
<P align=left><SPAN style="FONT-SIZE: 9pt">
具体做法是在闲置的一个I/O脚(如RB1)和OSC1管脚之间跨接一电阻(<I>R</I><SUB>1</SUB>),如图1所示。低速状态置RB1=0。需进行快速运算时先置RB1=1,由于充电时,电容电压上升得快,工作频率增高,运算时间减少,运算结束又置RB1=0,进入低速、低功耗状态。工作频率的变化量依<I>R</I><SUB>1</SUB>的阻值而定(注意<I>R</I><SUB>1</SUB>不能选得太小,以防振荡电路不起振,一般选取大于5kΩ)。<BR>
另外,进一步降低功耗可充分利用“sleep”指令。执行“sleep”指令,机器处于睡眠状态,功耗为几个微安。程序不仅可在待命状态使用“sleep”指令来等待事件,也可在延时程序里使用(见例1、例2)。在延时程序中使用“sleep”指令降低功耗是一个方面,同时,即使是关中断状态,Port
B端口电平的变化可唤醒“sleep”,提前结束延时程序。这一点在一些应用场合特别有用。同时注意在使用“sleep”时要处理好与WDT、中断的关系。</SPAN></P></TD>
<TD width="31%">
<P align=center><IMG alt="wpe1A.jpg (3150 字节)" height=96
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -