完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,这里有什么遗漏的东西吗?我使用LT1791实现半双工485,并且根据需要在输入和输出之间切换。有没有方法可以确定当发送串行串中的字节串时,传输是否已经完成?我问的原因是我发送,然后希望听,这涉及切换485接收。看来,除非我在最后一次传输之后手动插入一个延迟,在切换到监听的过程中,在结束之前,我会切断最后一个字节。我是否漏掉了一些明显的东西?
以上来自于百度翻译 以下为原文 Hi folks have a missed something here? I am implementing half duplex 485 and so using an LT1791, and switching between input and output as required. Is there a way I can determine if the transmission has completely finished when sending a string of bytes out of the serial port? The reason I ask is that I transmit, then wish to listen, which involves switching the 485 to receive. It seems that unless I manually insert a delay after the last transmission, on switching to listen I end up cutting the last byte off before it is completed. Have I missed something obvious? |
|
相关推荐
7 个讨论
|
|
|
通常是这样做的……你必须在TIC上完成“TX完成”的标志:一个告诉你字节已经移动到TX'Enter寄存器,一个告诉它已经完成了传输-所以你通常使用这个。然后我添加一些时间延迟…确保线路稳定。这有点TBD,但工作!
以上来自于百度翻译 以下为原文 Usually this is how it's done... You have to "TX done" flags, usually, on PICs: one tells you that the byte has been moved to TX'ing shift register, and one tells that it is done transmitting - so you usually use this one. Then I add some bit-time delay... to make sure line is stable. This is somewhat TBD, but works! |
|
|
|
|
|
|
|
|
HiIn与PIC输出(TX)有关的最佳方法是知道TrMT位,如果内存没有欺骗我,它就住在TXSTA寄存器中。TXIF标志只告诉您TXBUFF是空的,当最后一个字节被传递到发送器移位寄存器时,会发生什么?在最后一个字节的起始位时,TunIn继续运行。
以上来自于百度翻译 以下为原文 Hi In what relates to the PIC output (TX) the best way to know when the tranmission is finished is the TRMT bit, if memory isd not tricking me it lives in the TXSTA register. The TXIF flag only tells you TXBUFF is empty what happens when the last byte is passed on to the transmiter shift register, meaning TXIF goes on at the time of the start bit of the last byte. |
|
|
|
|
|
|
|
|
确保TXIF和TrMT都很高。在停止位开始时TrMT变高,因此建议额外的一个时钟周期延迟。不幸的是,没有8位部件支持TrMT中断。
以上来自于百度翻译 以下为原文 Make sure TXIF and TRMT are both high. TRMT goes high at the start of the stop bit, so an extra one clock cycle delay is advised. Unfortunately no 8 bit parts support interrupt on TRMT going true. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
454 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3529 浏览 3 评论
1121浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1094浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
872浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
460浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 16:37 , Processed in 2.827978 second(s), Total 58, Slave 48 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
5837