As I continue checking my program after compiling with Pascal Pro 4.0, I find that my UART code to communicate with two external systems no longer works. No idea why not. Went back to Pascal Pro 3.6 and that identical source code compiles and works.
Must say that makes me a bit leery of what else I may find once (if) I can figure out why this problem.
Anyone else having a similar problem?
UART Comm Code no longer works with Pascal Pro 4.0
UART Comm Code no longer works with Pascal Pro 4.0
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered
Matthews, NC USA
Rv-6A N494BW Rotary Powered
Re: UART Comm Code no longer works with Pascal Pro 4.0
I have continued to dig into why my UART comm function no longer work using Version 4.0 of the pascal pro compiler.
It appears that the module no longer functions to transmit the characters placed in the UART2_Write() or UART5_Write() modules
I have a somewhat simple Rs232 monitor on my computer and it clearly show the difference in the output of the UARTX module between the code compiled with 3.6.0 verse that compiled with version 4.0.
The bottom image shows the data as it should be transmitted to an external device which then decodes the commands and replies. The top image shows the output after compiling with Pascal Pro 4.0. Just a series of FF and FE which are invalid. I have even taken the UART2_Write() library routine alone and attempt to transmit a character with the same results - this would seem to indicate (as well as my code working with the 3.6.0 compiler) that the problem is not in my code. But, I can not show that for certain.
I suspect the problem could be in the UART initiation sequence, but have no way of knowing.
So if any one is using a PIC32MX795F512H/L chip and the UARTx_Init_Advance initiational routine, I would appreciate hearing from you.
Thanks
It appears that the module no longer functions to transmit the characters placed in the UART2_Write() or UART5_Write() modules
I have a somewhat simple Rs232 monitor on my computer and it clearly show the difference in the output of the UARTX module between the code compiled with 3.6.0 verse that compiled with version 4.0.
The bottom image shows the data as it should be transmitted to an external device which then decodes the commands and replies. The top image shows the output after compiling with Pascal Pro 4.0. Just a series of FF and FE which are invalid. I have even taken the UART2_Write() library routine alone and attempt to transmit a character with the same results - this would seem to indicate (as well as my code working with the 3.6.0 compiler) that the problem is not in my code. But, I can not show that for certain.
I suspect the problem could be in the UART initiation sequence, but have no way of knowing.
So if any one is using a PIC32MX795F512H/L chip and the UARTx_Init_Advance initiational routine, I would appreciate hearing from you.
Thanks
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered
Matthews, NC USA
Rv-6A N494BW Rotary Powered
Re: UART Comm Code no longer works with Pascal Pro 4.0
I Have finally gotten the UART models to work with Compiler 4.0. The problem I am having apparently resides in the module's advanced initialization routines. Posting this in case someone may be having a similar problem.
Here is the code I use for UART2 and UART5 modules for over two years that works with all Pascal Pro PIC32compilers up to and including compiler 3.6.0. However, this initialization does not work for my project with compiler 4.0. There is no error indication when compiled - just does not work.
After some experimenting I tried this simple initialization
This initialization works in 4.0.
I can not determine why my original code works with 3.6.0 but not 4.0. But, it looks like the simpler UART initialization routine works for me in 4.0, so onward!
Here is the code I use for UART2 and UART5 modules for over two years that works with all Pascal Pro PIC32compilers up to and including compiler 3.6.0. However, this initialization does not work for my project with compiler 4.0. There is no error indication when compiled - just does not work.
Code: Select all
UART2_Init_Advanced(9600,24000 ,_UART_LOW_SPEED, _UART_8BIT_NOPARITY, _UART_ONE_STOPBIT); // 11 July 2015
UART_Set_Active(@UART2_Read, @UART2_Write, @UART2_Data_Ready, @UART2_Tx_Idle); // set UART2 active
UART5_Init_Advanced(9600,24000 ,_UART_LOW_SPEED, _UART_8BIT_NOPARITY, _UART_ONE_STOPBIT); // 11 July 2015
UART_Set_Active(@UART5_Read, @UART5_Write, @UART5_Data_Ready, @UART5_Tx_Idle); // set UART5 active
Code: Select all
UART2_Init(9600); // 20 Nov 2017
UART5_Init(9600); // 20 Nov 2017
I can not determine why my original code works with 3.6.0 but not 4.0. But, it looks like the simpler UART initialization routine works for me in 4.0, so onward!
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered
Matthews, NC USA
Rv-6A N494BW Rotary Powered
Re: UART Comm Code no longer works with Pascal Pro 4.0
Hi Lana,
Tested the UART code you sent compiled with 4.0 and loaded to my Fusion V7 board. Both channels USB-UART worked, two way communication over both UART2 and UART5 chip modules . Since your code used the advanced initialization and worked, I conclude the problem has to be in my code . So thanks, I will keep working on my code to find out where the problem lies.
Thanks again
Tested the UART code you sent compiled with 4.0 and loaded to my Fusion V7 board. Both channels USB-UART worked, two way communication over both UART2 and UART5 chip modules . Since your code used the advanced initialization and worked, I conclude the problem has to be in my code . So thanks, I will keep working on my code to find out where the problem lies.
Thanks again
Rotary_Ed
Matthews, NC USA
Rv-6A N494BW Rotary Powered
Matthews, NC USA
Rv-6A N494BW Rotary Powered