Hi Team.
I am not saying it is a bug propably my understanding that causes the issue 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
PIC32 I/O Problems
Moderator: Benj
- QMESAR
- 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
- Attachments
-
- 1.JPG (33.54 KiB) Viewed 7657 times
-
- 2.JPG (25.31 KiB) Viewed 7657 times
-
- 3.JPG (22.86 KiB) Viewed 7657 times
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- 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
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
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
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- QMESAR
- 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
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
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
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR