PIC18F44K22 RS232

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

PIC18F44K22 RS232

Post 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 259 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC18F44K22 RS232

Post by LeighM »

Hi,
Could you also post the generated C code file please?

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: PIC18F44K22 RS232

Post by Dave Squibb »

Hi Leigh, C attached.
SerialText_C.docx
(8.21 KiB) Downloaded 240 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC18F44K22 RS232

Post 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
Attachments
PIC_CAL_UART.c
(23.32 KiB) Downloaded 178 times

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: PIC18F44K22 RS232

Post 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.

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: PIC18F44K22 RS232

Post by Dave Squibb »

Hello, Any further thoughts on this please?
Thanks,
Dave

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC18F44K22 RS232

Post by LeighM »

Hi Dave,
Sorry, this got pushed to one side, we'll source some hardware and look into it

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC18F44K22 RS232

Post 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

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: PIC18F44K22 RS232

Post 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.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC18F44K22 RS232

Post 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

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: PIC18F44K22 RS232

Post by Dave Squibb »

I've replaced the file with the modified one but still not working :?

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC18F44K22 RS232

Post 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.

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: PIC18F44K22 RS232

Post by Dave Squibb »

That worked Leigh

Post Reply