Pins not requre connecting option.

Please add any feature requests for Flowcode version 6 here

Moderator: Benj

Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
Post Reply
medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Pins not requre connecting option.

Post by medelec35 »

There are components which may not require all pins to be connected to enable it to work on hardware.
One example is RS232 RX. With a few of my projects I only use TX.

Can we have another option in the port drop down list for 'Not required' (or wording to that effect).
So left on 'Unconnected' there will be a warning, as user may have forgot to connect to a pin.
If user selects 'Not required' then Flowchart runs simulations and compiles with no warnings or unconnected errors.
Martin

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Pins not requre connecting option.

Post by JonnyW »

Hello. This would be up to the component. I have added an event to allow this to happen, but each component has different requirements and it should not be a users job to do this - a component should know whether its pins are required given certain settings.

Jonny

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Pins not requre connecting option.

Post by medelec35 »

Hi Jonny, thanks for your reply.
JonnyW wrote:it should not be a users job to do this
If im using RS232 in software mode.
Only sending string variables for example, Then you are forced to set RX to a pin connection.
Otherwise you will get pin not connected warnings and when compiling your get:

Code: Select all

C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(327:5): error: unknown identifier 'tris'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(327:5): error: failed to generate expression
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(327:5): error: invalid operand 'tris'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(327:11): error: failed to generate expression
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(407:5): error: unknown identifier 'tris'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(407:5): error: failed to generate expression
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(407:5): error: invalid operand 'tris'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(407:11): error: failed to generate expression
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(533:15): error: unknown identifier 'port'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(533:15): error: failed to generate expression
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(533:15): error: invalid operand 'port'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(533:21): error: failed to generate expression
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(533:14): error: invalid operand '(port) & (1 << ( (0)))'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(533:11): error: failed to generate expression
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(561:8): error: unknown identifier 'port'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(561:8): error: failed to generate expression
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(561:8): error: invalid operand 'port'
C:\Program Files (x86)\Flowcode 6 Beta\CAL\PIC\PIC_CAL_UART.c(561:14): error: failed to generate expression
Rs232 unconnected.c(242:9): warning: local variable 'FCL_CHCOUNT' may be used uninitialized
Rs232 unconnected.c(254:16): warning: local variable 'FCL_CHCOUNT' may be used uninitialized
Rs232 unconnected.c success

failure
...
Launched program C:\Program Files (x86)\Flowcode 6 Beta\compilers\pic\boostc\boostc_16F.exe
Completed BoostC compilation, return = 1
To get around this the TX pin can be set to the same pin as RX (or free pin if there is one available), but i'm not sure if this can be done with other components.
JonnyW wrote:This would be up to the component. I have added an event to allow this to happen, but each component has different requirements and it should not be a users job to do this
Did not know the component will allow an unconnected pin to compile ok as this did not happen with Rs232.
Leaving this up to you as I thought 'Not required' may future proof where other components are created which may or may not require an optional connection.
Martin

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Pins not requre connecting option.

Post by JonnyW »

Hi Martin. The event has been around a while, but I don't think anyone implements it in their components. We should, I think.

Not sure how it can be done cleanly if a component requires more knowledge of what the User is calling to know what needs to be connected. Perhaps your idea of allowing the User to ignore pins selectively could sort this though.

Jonny

Post Reply