18F6722 RS232 flow control, is this a bug?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

18F6722 RS232 flow control, is this a bug?

Post by Ondra »

Good day all. I design a circuit that requires RG4 and RG3 be used as RTS and CTS flow control. Under properties for the RS232 component
I don't have G as an optional port. The board for my circuit is already done. Is there a way I can use the G port for my flow control pins?
Thanks in advance.

Ondra

Albert38
Posts: 23
Joined: Mon Jan 18, 2010 8:40 am
Has thanked: 2 times
Contact:

Re: 18F6722 RS232 flow control, is this a bug?

Post by Albert38 »

The 18F6722 has two EUSART's EUSART1 is on port RC6 (RX) and RC7 (TX) EUSART2 is on port RG1 (RX) and RG2 (TX)
If you want to use flow control you are able to select any pin of the ports A-E The flow control pins are user selectable.

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: 18F6722 RS232 flow control, is this a bug?

Post by Ondra »

When I designed the board I used G3 and G4 for my flow control pins. Is there no way to access them, maybe by changing the FCD file for that chip and if so, what and where do I make the changes?

Ondra

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 18F6722 RS232 flow control, is this a bug?

Post by Benj »

Hello Ondra,

Yes this is a bug with the RS232 component properties not allowing any ports past PortE.

To get around this you can use the code customisation feature.

Select the RS232 component and then click the edit code button,

Select the Defines code section and click edit.

Find the following lines in the defines section.

Code: Select all

#define %m_RTS_PORT %a
#define %m_RTS_TRIS %b
#define %m_CTS_PORT %c
#define %m_CTS_TRIS %d
#define %m_RTS_PIN %e
#define %m_CTS_PIN %f
Then change these to make them relevant for your hardware. eg.

Code: Select all

#define %m_RTS_PORT portg
#define %m_RTS_TRIS trisg
#define %m_CTS_PORT portg
#define %m_CTS_TRIS trisg
#define %m_RTS_PIN 4
#define %m_CTS_PIN 3
Note that you will still have to enable the flow control in the component properties. The port and pin values shown in the properties page will be overridden by your values.

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: 18F6722 RS232 flow control, is this a bug?

Post by Ondra »

Hi Benj.
I spent the better part to the day trying to get the USART 2 working with now success. I tried Receiving without using flow control and had no success. Using a scope I can see that the data is at the pin. At 9600 the bit width is .11ms. I think there maybe more issues with USART 2 on this PIC, could it be that the inability to select the G port for flow control also goes for the TX and RX as well? Could someone have a look at this? It's got me at a stand still. Thanks in advance.

Ondra

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: 18F6722 RS232 flow control, is this a bug?

Post by Ondra »

OK. forget about what I said earlier. I got it working. Oscillator was set to HS-PLL I set it to HS and it worked.

Ondra

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 18F6722 RS232 flow control, is this a bug?

Post by Benj »

Hi Ondra,

Phew, you had me a bit worried there for a minute. Thanks for letting us know the problem is resolved.

Post Reply