收藏 分享(赏)

rs485通讯程序接收0123456789,只接收不发送,使用LM1602液晶显示.doc

上传人:fmgc7290 文档编号:7108885 上传时间:2019-05-06 格式:DOC 页数:7 大小:313.50KB
下载 相关 举报
rs485通讯程序接收0123456789,只接收不发送,使用LM1602液晶显示.doc_第1页
第1页 / 共7页
rs485通讯程序接收0123456789,只接收不发送,使用LM1602液晶显示.doc_第2页
第2页 / 共7页
rs485通讯程序接收0123456789,只接收不发送,使用LM1602液晶显示.doc_第3页
第3页 / 共7页
rs485通讯程序接收0123456789,只接收不发送,使用LM1602液晶显示.doc_第4页
第4页 / 共7页
rs485通讯程序接收0123456789,只接收不发送,使用LM1602液晶显示.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

1、rs485 通讯程序接收 0123456789,只接收不发送,使用 LM1602 液晶显示2008-12-07 19:45#include #include #include #include/液晶为 JDH162A 1602 液晶 16*2/以下宏定义语句可根据实际情况更改#define dataport PORTB#define datapin PINB#define dataddr DDRB#define conport PORTA#define conddr DDRA#define rw PA5#define rs PA6#define e PA4unsigned char str1=

2、“Waiting.“;volatile int num;/中断接收函数ISR(USART_RXC_vect)writelocatechar(num,0,UDR);num+;unsigned char isbusy(void)unsigned char tmp;conporti-)writelocatechar(x+i-1,y,(*p+48);p+;void port_init(void)PORTA = 0x00;DDRA = 0xFF;PORTB = 0x00;DDRB = 0x00;PORTC = 0x00; /m103 output onlyDDRC = 0x00;PORTD = 0x00

3、;DDRD = 0x00;/call this routine to initialize all peripheralsvoid init_devices(void)/stop errant interrupts until set upasm(“cli“); /disable all interruptsport_init();MCUCR = 0x00;GICR = 0x00;TIMSK = 0x00; /timer interrupt sourcesasm(“sei“); /re-enable interrupts/all peripherals are now initializedint main()init_devices();init_lcd();writecom(0x01,1);/清除屏幕 num=0; uart_init(0x00,0x17);asm(“sei“);while(1);

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报