Page 1 of 1

1826j53 UART2 PROBLEM

Posted: Mon Mar 18, 2013 9:15 am
by ProtonLaser
Hi i have a compiling error
CHIP: PIC18F26J53
FLOWCODE 5.0 VERSION 5.4.0.0
C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_UART.c(521): error: left operand must be l-value
C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_UART.c(521:13): error: failed to generate expression
C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_UART.c(522): error: left operand must be l-value
C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_UART.c(522:13): error: failed to generate expression
What should i do to fix this because i urgently need to use UART2?

I am also trying to use the Peripheral Pin Select feature

Thank you

Re: 1826j53 UART2 PROBLEM

Posted: Mon Mar 18, 2013 10:58 am
by Benj
Hello,

What pins would you like the UART2 connected to and I will see if I can fix the file to route to these pins for you.

Re: 1826j53 UART2 PROBLEM

Posted: Mon Mar 18, 2013 11:24 am
by ProtonLaser
Hi Ben
TX2 -> RP1(pin3)

Thanks

Re: 1826j53 UART2 PROBLEM

Posted: Mon Mar 18, 2013 11:55 am
by Benj
Hello,

Can RX2 be anything for now or do you have a free I/O pin in mind I can assign it to?

Re: 1826j53 UART2 PROBLEM

Posted: Mon Mar 18, 2013 12:02 pm
by Benj
Hello,

I have re-routed TX2 to RP1 and RX2 to RP0 in this CAL file.
PIC_CAL_UART.c
(25.86 KiB) Downloaded 252 times
Copy the file to your "Flowcode/v5/CAL/PIC" folder and the compilation should then go through correctly.

Here are the lines of code that control the remapping, line number 525 in the C file.

Code: Select all

RPOR1 = 6;		//TX2 - RP1 - RA1
RPINR16 = 0;	//RX2 - RP0 - RA0

Re: 1826j53 UART2 PROBLEM

Posted: Mon Mar 18, 2013 12:48 pm
by ProtonLaser
Hi Ben

I have tryed what you said, copied the file into my folder, and compiled again using the second UART, and the same problem appears.

I have posted my program, to see if there is something i am doing wrong in my code.

Thanks.

Re: 1826j53 UART2 PROBLEM

Posted: Mon Mar 18, 2013 12:57 pm
by Benj
Ah sorry about that, I had capitalised the register names and they should be in lower case,

This one should work correctly.

Re: 1826j53 UART2 PROBLEM

Posted: Mon Mar 18, 2013 4:35 pm
by ProtonLaser
Great It worked.
Thanks Ben.