2015-7-13 10:10| 发布者: kaloha| 查看: 6825| 评论: 0
串口芯片MAX3232控制电路原理图
/*01010101010101010101010101010101010101010101010101010101010101010101----------------------------------------------------------------------实验内容:使用串口调试助手查看串口的收发状态是否正常。----------------------------------------------------------------------硬件连接: DVK501(MAX3232PrlPort) F320 EX VCC --------- VCC GND --------- GND R1O --------- P0.5 T1I --------- P0.4 ----------------------------------------------------------------------注意事项:(1)若有加载库程序,请将光盘根目录下的“library”下的“C8051F”文件夹拷到D盘(2)请详细阅读:光盘根目录下的“说明书首页.htm”里的相应产品说明----------------------------------------------------------------------10101010101010101010101010101010101010101010101010101010101010101010*/
#define _DVK501_F320_EX_
#include <c8051f320.h> #include <stdio.h>#include <../../../../library/C8051F/ws_clock.h>#include <../../../../library/C8051F/ws_usart_port.h>
void main (void) {uchar inputcharacter;
PCA0MD &= ~0x40; //clear watchdog timer XBR1 = 0x40; // Enable crossbar and weak pull-upsclock_external(); usartInit();
while (1){printf ("\nEnter character: ");inputcharacter = getkey ();printf ("\nCharacter entered : %c",inputcharacter);printf ("\n Value in Hex: %bx",inputcharacter);}}
打开串口调试助手,波特率调为9600,在PC机接收到“Enter character: "后,从键盘中随意输入一个字母、数字或符号,然后回车,查看串口调试助手上的现象。
以上资料由微雪电子整理并发布,未经许可不得转载,否则追究相应责任!
评论
微雪官网|产品资料|手机版|小黑屋|微雪课堂. ( 粤ICP备05067009号 )
GMT+8, 2024-12-27 02:54 , Processed in 0.018369 second(s), 20 queries .