PIC32 I/O Problems

A forums to allow resolved bugs and problems with Flowcode v7 to be stored and marked as resolved.

Moderator: Benj

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1089
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 334 times
Been thanked: 544 times
Contact:

PIC32 I/O Problems

Postby QMESAR » Sun Aug 14, 2016 12:39 pm

Hi Team.

I am not saying it is a bug propably my understanding that causes the issue :D however
When I use the Output I can not switch on the Port pins when the value in the configuration window is set to true
only when I write a direct value such as 0x1E then I can switch RC1to RC4 on for example.
by using a C call I can switch the bits in any order and way I want it is only when I use the Output component set a complete Port and or set to True and false as the values in both modes single pin and complete Port

:D
Attachments
1.JPG
1.JPG (33.55 KiB) Viewed 2806 times
2.JPG
2.JPG (25.31 KiB) Viewed 2806 times
3.JPG
3.JPG (22.87 KiB) Viewed 2806 times

User avatar
LeighM
Matrix Staff
Posts: 1844
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 429 times
Been thanked: 612 times
Contact:

Re: PIC32 I/O Problems

Postby LeighM » Mon Aug 15, 2016 9:20 am

Hi
It's a bug, we'll get on the case.
Thanks!
Leigh

User avatar
LeighM
Matrix Staff
Posts: 1844
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 429 times
Been thanked: 612 times
Contact:

Re: PIC32 I/O Problems

Postby LeighM » Tue Aug 16, 2016 10:32 am

Hi

Having investigated your scenario in a bit more detail, it is not really a bug.
In that the use of true and false in this way should only be used in the context of a Boolean.
False is zero and true is anything else, we currently give true the value of 1, as most C compilers would.
Hence true or false should not be used in the context of multiple bit setting.
You are best to set the value or variable to precisely what you want at the output.
I've logged it as an issue here for consideration, maybe we need to do something with this dialog window to avoid any confusion.

Thanks,
Leigh
These users thanked the author LeighM for the post:
EtsDriver (Tue Aug 16, 2016 2:08 pm)
Rating: 5.56%
 

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

Re: PIC32 I/O Problems

Postby Benj » Tue Aug 16, 2016 10:42 am

Hi Peter,

I also agree with Leigh here but we could be wrong. In my mind a boolean is a singular true or false state and so should not be assigned to a byte value such as a port. Assigning to a single bit such as a pin is probably ok.

In Java it won't let you assign a boolean to a numeric variable and visa versa, it causes a compile error unless you specifically thrown in an extra typecast to force the compilers hand.

The best fix for the problem might be to not allow the true or false values to be entered into the dialogue when in port mode.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1089
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 334 times
Been thanked: 544 times
Contact:

Re: PIC32 I/O Problems

Postby QMESAR » Tue Aug 16, 2016 11:33 am

Hi Guys

I agree with you regarding the Boolean and True assignments,I do think also that it is a good idea to remove the true or false when in PORT mode because it does
imply that it can be done which is not the case

Thanks for looking into the issue it is clear and totally ok how it work then