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: 1187
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 378 times
Been thanked: 604 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 3444 times
2.JPG
2.JPG (25.31 KiB) Viewed 3444 times
3.JPG
3.JPG (22.87 KiB) Viewed 3444 times

User avatar
LeighM
Matrix Staff
Posts: 2006
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 686 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: 2006
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 686 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%
 

User avatar
Benj
Matrix Staff
Posts: 14660
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4651 times
Been thanked: 4269 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: 1187
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 378 times
Been thanked: 604 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