Page 1 of 1

PIC18F44K22 RS232

Posted: Thu Nov 16, 2017 11:01 am
by Dave Squibb
Good morning.
This simple program outputs RS232 on channel 1 (PortC,6) but not channel 2 (PortD,6).
I can output RS232 on PortD,6 using the software implementation.
Any ideas please?
Thanks,
Dave.
SerialTest.fcfx
(14.77 KiB) Downloaded 298 times

Re: PIC18F44K22 RS232

Posted: Thu Nov 16, 2017 2:05 pm
by LeighM
Hi,
Could you also post the generated C code file please?

Re: PIC18F44K22 RS232

Posted: Thu Nov 16, 2017 3:55 pm
by Dave Squibb
Hi Leigh, C attached.
SerialText_C.docx
(8.21 KiB) Downloaded 294 times

Re: PIC18F44K22 RS232

Posted: Fri Nov 17, 2017 1:21 pm
by LeighM
Thanks.
That all looks OK.
Could you next try the attached CAL file, this is our latest, just in case you have older.
To go into your Flowcode 6 installation \CAL\PIC directory

Re: PIC18F44K22 RS232

Posted: Fri Nov 17, 2017 2:59 pm
by Dave Squibb
Still the same Leigh. On Channel 2 PortD,6 goes high but no data. Set to software on same pin all working.
Dave.

Re: PIC18F44K22 RS232

Posted: Wed Nov 22, 2017 12:16 pm
by Dave Squibb
Hello, Any further thoughts on this please?
Thanks,
Dave

Re: PIC18F44K22 RS232

Posted: Wed Nov 22, 2017 12:30 pm
by LeighM
Hi Dave,
Sorry, this got pushed to one side, we'll source some hardware and look into it

Re: PIC18F44K22 RS232

Posted: Wed Nov 22, 2017 2:27 pm
by LeighM
Hi Dave,
The quickest way to resolve this is to edit the PIC18f45k22.h header file (or whichever device you are using 44/45/46)
The file is found in your Flowcode6 installation directory \compilers\pic\boostc\include
Comment out the definition for TX2STA at around line 100

Code: Select all

// #define TX2STA                 0x00000F72

Re: PIC18F44K22 RS232

Posted: Wed Nov 22, 2017 3:22 pm
by Dave Squibb
Hi Leigh,

I tried to do this but "do not have permission to modify this file"

I need to change it for the PIC18F45K22 and PIC18F44K22

Any ideas?
Thanks,
Dave.

Re: PIC18F44K22 RS232

Posted: Wed Nov 22, 2017 3:26 pm
by LeighM
Hi Dave,
Ah right, that's a Windows thing, probably because they are under C:\Program Files (x86)
Maybe you can copy the files somewhere else, edit, then copy back?
Might get a Windows "Are you sure?" type dialogue.

Leigh

Re: PIC18F44K22 RS232

Posted: Wed Nov 22, 2017 3:58 pm
by Dave Squibb
I've replaced the file with the modified one but still not working :?

Re: PIC18F44K22 RS232

Posted: Wed Nov 22, 2017 4:13 pm
by LeighM
So you removed TX2STA?

Just as a test you could edit Flowcode6\CAL\PIC\PIC_CAL_UART.c around line 319
Change

Code: Select all

#ifdef TX2STA
to

Code: Select all

// #ifdef TX2STA
#if 0
Although this is only for K22, it will break other builds.

Re: PIC18F44K22 RS232

Posted: Wed Nov 22, 2017 5:09 pm
by Dave Squibb
That worked Leigh