2015-7-13 10:10| 发布者: kaloha| 查看: 6623| 评论: 0
串口芯片MAX485控制电路原理图
/*01010101010101010101010101010101010101010101010101010101010101010101----------------------------------------------------------------------实验内容:在8位LED灯上查看MAX485芯片自发自收的数据。----------------------------------------------------------------------硬件连接:P2口连接8位LED指示灯 DVK501(MAX485PrlPort) F320 EX VCC --------- VCC GND --------- GND RO --------- P0.5 DI --------- P0.4 ----------------------------------------------------------------------注意事项:(1)若有加载库程序,请将光盘根目录下的“library”下的“C8051F”文件夹拷到D盘(2)请详细阅读:光盘根目录下的“说明书首页.htm”里的相应产品说明----------------------------------------------------------------------10101010101010101010101010101010101010101010101010101010101010101010*/
#define _DVK501_F320_EX_
#include #include <../../../../library/C8051F/ws_clock.h>#include <../../../../library/C8051F/ws_delay.h>#include <../../../../library/C8051F/ws_usart_port.h>
void main(void){uchar tmp = 0,a = 0;PCA0MD &= ~0x40; XBR1 = 0x40; clock_external();usartInit();
while(1){putUsart0(tmp);delay_ms(100);a = getUsart0();P2 = a;tmp++;delay_ms(1000);}}
连接P2与8位LED指示灯,把RO与DI用跳线短接,查看现象。
以上资料由微雪电子整理并发布,未经许可不得转载,否则追究相应责任!
评论
微雪官网|产品资料|手机版|小黑屋|微雪课堂. ( 粤ICP备05067009号 )
GMT+8, 2024-12-27 18:23 , Processed in 0.018978 second(s), 20 queries .