Page 1 of 1

PIC32 I/O Problems

Posted: Sun Aug 14, 2016 12:39 pm
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

Re: PIC32 I/O Problems

Posted: Mon Aug 15, 2016 9:20 am
by LeighM
Hi
It's a bug, we'll get on the case.
Thanks!
Leigh

Re: PIC32 I/O Problems

Posted: Tue Aug 16, 2016 10:32 am
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

Re: PIC32 I/O Problems

Posted: Tue Aug 16, 2016 10:42 am
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.

Re: PIC32 I/O Problems

Posted: Tue Aug 16, 2016 11:33 am
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