📄 bbs_content.jsp2.htm
字号:
<html><head>
<link rel="STYLESHEET" href="bbs_content.jsp2_files/bbs.css" type="text/css"><title>关于cs5532的初始化问题 ---AVR (原ourAVR.com) 技术论坛</title></head><body bgproperties="fixed" leftmargin="15" topmargin="0" bgcolor="#ffffff" marginheight="0" marginwidth="15" text="#000000"><br>
<script type="text/javascript">
function loadfunction(function_1)
{
var url = function_1.options[function_1.selectedIndex].value;
if (url != "")
{
if(function_1.options[function_1.selectedIndex].className=="class_1")
{
eval(function_1.options[function_1.selectedIndex].value);
}
else if(function_1.options[function_1.selectedIndex].className=="class_2")
{
window.open(url, "");
}
else
{
window.open(url, "class_3");
}
function_1.selectedIndex=0
}
return false;
}
</script>
<table bgcolor="#eeeeee" border="0" cellpadding="0" cellspacing="1" height="20" width="100%">
<tbody><tr>
<td width="26%">
<span class="f01">
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="14">欢迎您,ilan2003
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="7"><span class="f03"><font color="#444444">|登录</font></span>
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="2"><span class="f03"><font color="#444444">|快速注册</font></span>
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="2"><a href="http://www.ouravr.com/bbs/logout.jsp?mother_form=bbs_content.jsp&bbs_sn=762826&bbs_id=1000&bbs_page_no=1" title="退出登录,并回到首页" class="tt4">|退出</a>
</span>
</td>
<td align="right" width="74%">
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="5"><a href="http://www.ouravr.com/index.html" title="回到本站首页" class="tt4">首页</a>
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="5"><a href="http://www.ouravr.com/bbs/search_interface.jsp?mother_form=bbs_content.jsp&bbs_sn=762826&bbs_id=1000&bbs_page_no=1" target="_blank" title="搜索" class="tt4">搜索</a>
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="5"><a href="http://www.ouravr.com/bbs/online_members_list.jsp" title="当前在线会员" target="_blank" class="tt4">在线</a>
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="2">
<select name="list1" onchange="javascript:loadfunction(this)">
<option>个人功能</option>
<option>--------------</option>
<option target="_blank" value="user_data.jsp">修改个人资料</option>
<option target="_blank" value="bbs_list.jsp?search_text=ilan2003&search_mode=3&bbs_id=9999">我的主题</option>
<option target="_blank" value="bbs_list.jsp?search_text=ilan2003&search_mode=4&bbs_id=9999">我的回复</option>
</select> <img src="bbs_content.jsp2_files/pixel.gif" height="1" width="2">
<img src="bbs_content.jsp2_files/pixel.gif" height="1" width="5"><a href="http://www.mailshop.cn/" title="阿莫电子邮购服务部" target="_blank" class="tt11">本网站由阿莫电子邮购独家赞助</a>
</td>
</tr>
</tbody></table>
<table bgcolor="#ffffff" border="0" cellpadding="6" cellspacing="0" height="60" width="100%">
<tbody><tr>
<td align="left" valign="top">
<span class="tt1">
AVR (原ourAVR.com) 技术论坛 -> <a href="javascript:history.go(-1)" class="tt4">搜索主题:CS5532</a> -> 关于cs5532的初始化问题
</span>
</td>
<td align="center" valign="top">
<span class="tt1">跳转至:</span>
<select name="forumid" onchange="window.location=('bbs_list.jsp?bbs_id='+this.options[this.selectedIndex].value)">
<option value="9999">╟—ourDEV.cn 虚拟总论坛(可查看所有分论坛帖子)</option><option value="2060">╟┬电子综合</option><option selected="selected" value="1000">║├AVR (原ourAVR.com) 技术论坛</option><option value="1032">║├AT-ARM技术论坛</option><option value="1006">║├51单片机</option><option value="1028">║├PIC单片机</option><option value="1002">║├DSP</option><option value="1029">║├CPLD/FPGA</option><option value="2070">║├其它单片机与PLC</option><option value="1009">║├PCB(Protel等软件讨论)</option><option value="1024">║└机器人论坛</option><option value="1003">╟—马潮老师专栏(AVR)</option><option value="1004">╟┬电脑综合论坛</option><option value="1036">║└共享小软件</option><option value="1020">╟┬悠闲休息区 (灌水坛)</option><option value="1012">║├网站建设与建议</option><option value="0020">║└招标/招聘/自荐(项目招标、找工作、招人)</option><option value="1011">╙┬二手交易置换论坛</option><option value="2040"> ├广告、求购区</option><option value="2034"> └其它(非技术、非悠闲)</option>
</select>
</td>
<td align="right" valign="top">
</td>
</tr>
</tbody></table>
<table border="0" cellpadding="6" cellspacing="0" height="30" width="100%">
<tbody><tr bgcolor="#5d7790">
<td align="left" width="81%">
<span class="f06"><font color="#ffffff">贴子主题:关于cs5532的初始化问题</font></span>
</td>
<td align="center" width="19%">
<span class="f06"><font color="#ffffff">回复数:</font><font color="#ffffff">1</font>
(其中0条已删除)
</span>
</td>
</tr>
</tbody></table>
<table bgcolor="#e8e8e8" border="0" cellpadding="0" cellspacing="0" height="30" width="100%">
<tbody><tr>
<td>
<img src="bbs_content.jsp2_files/pixel.gif" height="2" width="20">
<span class="f06"><font color="#444444">相关链接:</font>
<font color="#444444">本贴没有相关链接</font></span>
</td>
</tr>
</tbody></table>
<table style="table-layout: fixed;" border="0" cellpadding="6" cellspacing="0" width="100%">
<tbody><tr>
<td class="f03" rowspan="2" style="border-style: solid; border-color: rgb(255, 255, 255) rgb(255, 255, 255) rgb(255, 255, 255) rgb(187, 187, 187); border-width: 0.5pt;" align="left" bgcolor="#d1d9e2" valign="top" width="19%">
【楼主位】 <font color="#000000">dongdaxing </font><br>
积分:<font color="#000000">17</font><br>
派别:<font color="#000000"></font><br>
等级:<font color="#000000">------</font><br>
来自:<font color="#000000"></font><br>
</td>
<td class="f03" style="border-style: solid solid none none; border-color: rgb(255, 255, 255) rgb(187, 187, 187) -moz-use-text-color -moz-use-text-color; border-width: 0.5pt 0.5pt medium medium;" bgcolor="#d1d9e2" valign="top" width="81%">
<font color="#000000">在前面的一个帖子里面看到有位大虾关于cs5532的一段程序 其中有段不是很明白请大家指点。
<br>程序如下:
<br>const unsigned char ADInitData[35]=
<br> {0x41,
<br> 0xfe,0x00,0x00,0x00, //通道0
<br> 0xfe,0x00,0x00,0x00, //通道1
<br> 0xfe,0x00,0x00,0x00, //通道2
<br> 0xfe,0x00,0x00,0x00, //通道3
<br> 0x45,
//设置所有通道设置寄存器
<br> 0x31,0xc0,0x31,0xc0,
//0x31:12.5Hz,通道1(1、2脚)
<br> 0x31,0xc0,0x31,0xc0,
//0x71,通道2(19、20脚)
<br> 0x31,0xc0,0x31,0xc0,
<br> 0x31,0xc0,0x31,0xc0,
<br> 0xc0}; //执行多路连续转换
<br>const unsigned char ADResetData[6]=
<br> {0xfe,0x03,0x20,0x00,0x00,0x00}; //配置寄存器RS位置1,AD复位
<br>//cs5532操作IO延时
<br>void AD_delay(void)
<br>{
<br>}
<br>//cs5532写寄存器
<br>void AD_write(unsigned char byte)
<br>{
<br> unsigned char i,data;
<br> data=byte;
<br> for(i=0;i<8;i++)
<br> {
<br> if((data&0x80)==0x80) PORTB|=(1<<AD_SDI);
<br> else PORTB&=~(1<<AD_SDI);
<br> AD_delay();
<br> PORTD|=(1<<AD_SCLK);//sclk=1
<br> AD_delay();
<br> PORTD&=~(1<<AD_SCLK);//sclk=0
<br> AD_delay();
<br> data<<=1;
<br> }
<br>}
<br>//cs5532读寄存器
<br>unsigned char AD_read(void)
<br>{
<br> unsigned char i,data=0;
<br> PORTD&=~(1<<AD_SCLK);//sclk=0
<br> AD_delay();
<br> for(i=0;i<8;i++)
<br> {
<br> data<<=1;
<br> if(((PIND>>AD_SDO)&0x01)==0x01) data|=0x01;
<br> AD_delay();
<br> PORTD|=(1<<AD_SCLK);//sclk=1
<br> AD_delay();
<br> PORTD&=~(1<<AD_SCLK);//sclk=0
<br> AD_delay();
<br> }
<br> return(data);
<br>}
<br>//初始化cs5532
<br>void Init5532(void)
<br>{
<br> unsigned char i,data=0;
<br> for(i=0;i<15;i++)
AD_write(0xff);
//初始化序列
<br> for(i=0;i<6;i++)
AD_write(ADResetData[i]); //复位
cs5532
<br> while(data!=0x10) //等待AD复位
<br> {
<br>
AD_write(0x0b); //读配置寄存器
<br> data=AD_read();
<br> AD_read();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -