The RS232 Tx/Rx ports can be selected in Flowcode.
My question is , can the ports changed with a C-code ?
Kind regards
Jan Lichtenbelt
Change RS232 ports with C
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
Re: Change RS232 ports with C
I think Flowcode has a hardware RS232 and then a Software RS232.
INCORRECT -> If you select the software RS232 you might be able to change the pins with C code.
But if you want to change the hardware pins (if the PIC has at least two RS232 outputs) it might be difficult as you'll need to set the registers so the second RS232 of the PIC is enabled and used.
EDIT :
I just checked how Flowcode assigned a software Rx and Tx and they use defines (RS232_SW_RX or something like that) so I don't think the compiler will let you undefine and define it again in your main.
INCORRECT -> If you select the software RS232 you might be able to change the pins with C code.
But if you want to change the hardware pins (if the PIC has at least two RS232 outputs) it might be difficult as you'll need to set the registers so the second RS232 of the PIC is enabled and used.
EDIT :
I just checked how Flowcode assigned a software Rx and Tx and they use defines (RS232_SW_RX or something like that) so I don't think the compiler will let you undefine and define it again in your main.
- 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: Change RS232 ports with C
Hello,
In v4 of Flowcode the RS232 component has no component connections when in hardware mode. However if you switch the coponent properties to software mode then the RX and TX component connections become available in the connections window.
Some PIC devices have RP remappable functionality which allows you to change the pins used for the hardware UART. Not many 8-bit devices have this feature built in but quite a lot of the 16-bit PICs have this.
In v4 of Flowcode the RS232 component has no component connections when in hardware mode. However if you switch the coponent properties to software mode then the RX and TX component connections become available in the connections window.
Some PIC devices have RP remappable functionality which allows you to change the pins used for the hardware UART. Not many 8-bit devices have this feature built in but quite a lot of the 16-bit PICs have this.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 3
- Joined: Mon Jun 25, 2012 9:18 pm
Re: Change RS232 ports with C
hi
I used port c for RS232 eblock but I want change it to Port D or E it possible to do it? and how?
I used PIC16F877A with Flowcode v4
Thank you
I used port c for RS232 eblock but I want change it to Port D or E it possible to do it? and how?
I used PIC16F877A with Flowcode v4
Thank you
- 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: Change RS232 ports with C
Hello,
The 16F877A only has one hardware UART and this is fixed to PortC pins 6 and 7.
You may get away with using a software UART which can be connected to any pins but receiving data is much more reliable with a hardware UART. Transmitting data should work equally well using a hardware or software UART.
The 16F877A only has one hardware UART and this is fixed to PortC pins 6 and 7.
You may get away with using a software UART which can be connected to any pins but receiving data is much more reliable with a hardware UART. Transmitting data should work equally well using a hardware or software UART.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel