Hi,
if the UART interrupt doesn't occur maybe is because the CPU interrupts are disabled.
If you call ENTER_CRITICAL_SECTION you disable all interrutps.
If this is not the problem, check with a simpler code how UART interrupts work and then retry with your application code.
I hope this is helpful.
Thanks.
DDS
Problem using Flex Full board and RS485 module
Moderator: paolo.gai
Re: Problem using Flex Full board and RS485 module
I figured out why the TX interrupt did not occur. What happened was the following: Once TX INT was disabled "after" TX completion, I needed to write a byte to U2TXREG before re-enabling the TX INT.
Another problem I have is mode switch in RS485. Now my master can send bytes to slave periodically and my slave is programmed to echo back the byte stream it received from the master. However, the master does not receive it. Is there any timing issues to switch between ENABLE
PORTFbits.RF12 = 0;
PORTFbits.RF13 = 1;
and DISABLE
PORTFbits.RF12 = 0;
PORTFbits.RF13 = 0;
Once the slave receives a predefined number of bytes, it "ENABLEs" the UART2 port for RS485. Then, it echos back those bytes received. At the end of tx, it "DISABLEs" the port. However, the master does not receive the echo-back bytes, and the slave does no longer receive any additional bytes after the mode change-and-back. Any comments or suggestions?
Another problem I have is mode switch in RS485. Now my master can send bytes to slave periodically and my slave is programmed to echo back the byte stream it received from the master. However, the master does not receive it. Is there any timing issues to switch between ENABLE
PORTFbits.RF12 = 0;
PORTFbits.RF13 = 1;
and DISABLE
PORTFbits.RF12 = 0;
PORTFbits.RF13 = 0;
Once the slave receives a predefined number of bytes, it "ENABLEs" the UART2 port for RS485. Then, it echos back those bytes received. At the end of tx, it "DISABLEs" the port. However, the master does not receive the echo-back bytes, and the slave does no longer receive any additional bytes after the mode change-and-back. Any comments or suggestions?
Re: Problem using Flex Full board and RS485 module
Hi, sorry for the delay in the answer.
It seems more a problem of programming the Serial peripheral than about ERIKA or the board itself... I guess one place to look at could be the demos provided by microchip. Also the Errata for the specific microcontroller usually helps... I do not think it is anything related to the rs485, probably the same thing appears also with rs232...
PJ
It seems more a problem of programming the Serial peripheral than about ERIKA or the board itself... I guess one place to look at could be the demos provided by microchip. Also the Errata for the specific microcontroller usually helps... I do not think it is anything related to the rs485, probably the same thing appears also with rs232...
PJ