完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
PIC32 MX775 F512LT(PrToBITS.Re8==1);在这行代码之后,我的UART5将停止接收数据。Re8是中断引脚:It1。这是不是拒绝UART?
以上来自于百度翻译 以下为原文 PIC32MX775F512L while(PORTEbits.RE8 == 1); After this line of code my UART5 will stop receiving data. RE8 is Interrupt Pin: INT1. Is that somehow turning off UART? |
|
相关推荐
9个回答
|
|
Re8会变低吗?如果不是,它明显地粘在那条线上。如果它变低了,你是否配置它来产生硬件中断?如果是,中断服务程序是否正确地清除中断?如果没有,那么它将被持续地服务于中断。
以上来自于百度翻译 以下为原文 Does RE8 ever go low? If not, it's plainly stuck on that line. If it is going low, have you configured it to generate a hardware interrupt? If yes, is your interrupt service routine correctly clearing the interrupt? If not, then it will be stuck continually servicing the interrupt. |
|
|
|
你能提供任何附加的上下文/代码吗?这条线和你的程序的其余部分在哪里?就引脚而言,U5RX和It1是无关的,但是如果你说,进入中断的It1信号,并在等待的同时循环,其他优先级较低的ISR(如UART RX中断)将不会火,直到国际电信局ISR完成。即使这样,U5RX ISR应该一旦INT1 ISR完成,如果我没有错的话(如果一个字符在UT1 ISR正在进行的时候出现在U5中),即使是像QB B所说的那样,如果使用INT1 ISR,也需要确保清除中断标志。否则,你只会一遍又一遍地输入它。如果你正在投票U5RX而不使用ISR,你可能会被卡住,等待R8低,永远不会击中你的UART接收代码。
以上来自于百度翻译 以下为原文 Can you provide any additional context/code? Where is this while line in relation to the rest of your program? U5RX and INT1 are unrelated as far as pinout is concerned, but if you, say, enter the interrupt for the INT1 signal, and are waiting at that while loop, other ISRs of lower priority (such as a UART RX interrupt) won't fire until the INT1 ISR is complete. Even then though, U5RX ISR should fire once the INT1 ISR finishes if I'm not mistaken (provided a character came into U5 while the INT1 ISR was in progress). And even then, like qɥb said, you need to make sure you're clearing the interrupt flag if you're using the INT1 ISR. Otherwise you'll just re-enter it over and over again. If you're polling U5RX and not using an ISR, you could just be getting stuck waiting for RE8 to go low and never hitting your UART receive code. |
|
|
|
Re8的断言很低,并且我已经禁用了中断的中断();
以上来自于百度翻译 以下为原文 RE8 does assert low and I have disabled Interrupts with INTDisableInterrupts(); |
|
|
|
我想现在是我们看到你们所有代码的时候了,你们只是告诉我们你们在做什么。
以上来自于百度翻译 以下为原文 I think it's time we saw ALL of your code. You're just telling us what you think you are doing. |
|
|
|
使用的UART调用如下,这是在UntARNUM=InDeBable中断()的主体()//CONTs上;而(PoPTBITS.Re8==1);NUBYBATH=GetDataBuffer(BUF,SIZEOF(BUF);UINT GetDataBuffer(char *缓冲器,Unt32 Max大小){Unt32 Nuffchar;NuthChar=0;同时(NuthChar & lt;Max大小){uTin)。8字;UARTRePvEDATAISIS(UART5):字符=UARTGetDataByte(UART5);如果(字符==‘0’)中断;*缓冲器=字符;缓冲器+;NUMIXCHAR+++;}返回NUMIXCHAR;} UART在编辑while循环时工作良好。它不经过编辑而通过while循环,但挂在UARTERCEDVDATAISIS可用(UART5)中,同时循环…RX缓冲区什么都没有?谢谢你的时间! 以上来自于百度翻译 以下为原文 The UART call used is as follows, this is all at the top of main() //configs for UART num = INTDisableInterrupts(); while(PORTEbits.RE8 == 1); numBytes = GetDataBuffer(buf, sizeof(buf); UINT GetDataBuffer(char *buffer, UINT32 max_size){ UINT32 num_char; num_char = 0; while(num_char < max_size) { UINT8 character; while(!UARTReceivedDataIsAvailable(UART5)): character = UARTGetDataByte(UART5); if(character == ' |