PIC32 I/O Problems

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

Moderator: Benj

Post Reply
User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

PIC32 I/O Problems

Post by QMESAR »

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.54 KiB) Viewed 7431 times
2.JPG
2.JPG (25.31 KiB) Viewed 7431 times
3.JPG
3.JPG (22.86 KiB) Viewed 7431 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC32 I/O Problems

Post by LeighM »

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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC32 I/O Problems

Post by LeighM »

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

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: PIC32 I/O Problems

Post by Benj »

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: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: PIC32 I/O Problems

Post by QMESAR »

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

Post Reply