完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我有PIC18F2520,我正在做简单的UART程序。我使用了遗留库。以下是演示代码:数据显示在终端上,但是在Hello之前还有一个空字符。我附上了一个终端数据的图片。请看一下。
以上来自于百度翻译 以下为原文 I have PIC18F2520 and I am doing simple UART program. I have used the legacy libraries. Following is the demo code: OpenUSART( USART_TX_INT_OFF & USART_RX_INT_ON & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_HIGH,51 ); while(1) { putrsUSART("Hellon"); DelayMs(500); } Data is showing on the terminal but there is one extra NULL char before Hello. I have attached an image of the terminal data. Please have a look at it. Attached Image(s) |
|
相关推荐
3个回答
|
|
|
PLIB函数PutrSuxAtter()在字符串上发送终止null。只需滚动自己的函数就不发送它。
以上来自于百度翻译 以下为原文 The plib function putrsUSART() sends the terminating NULL on the string. Just roll your own function to not send it. |
|
|
|
|
|
|
|
|
|
|
|
首先,你应该自己动手写一遍,如果你有困难,可以找我们寻求帮助。这不会太难,简单的循环,检查字符是否为空,导致循环退出,还有一两件小事应该变得明显。从练习中复制比粘贴别人的代码。
以上来自于百度翻译 以下为原文 You should have a go at writing it yourself to begin with, and if you have trouble get back to us for help. It really wont be that hard, a simple loop, a check if the character is NULL which causes the loop to exit, and one or two more little things which should become apparent. You will learn far more from that exercise than copy/pasting someone elses code. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 06:15 , Processed in 0.535865 second(s), Total 48, Slave 41 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1330