Hi guys,
Using Flowcode dsPIC 5.5.2.1.
Simples I get the following when compiling my little project (SWICTH0 on PORTG_H_0 and LED0 on PORTB_H_1), anmd the program doesn't run on hardware.
test.c: In function 'FCD_SWITCH0_WaitUntilHigh':
test.c:304: warning: comparison is always true due to limited range of data type
test.c: In function 'FCD_SWITCH0_WaitUntilLow':
test.c:333: warning: large integer implicitly truncated to unsigned type
test.c:342: warning: comparison is always false due to limited range of data type
test.c: At top level:
test.c:293: warning: 'FCD_SWITCH0_WaitUntilHigh' defined but not used
test.c:331: warning: 'FCD_SWITCH0_WaitUntilLow' defined but not used
Compilation successful!
Return code = 0
Seems like a bug to me... and Flowcode won't read the status of PORTG_H_0 on hardware, I have chcked with the Flowcode debugger).
If I use an "Input" component in Flowcode to read PORTG_H_0, the program works fine.
Below the little program working and the one not working at all.
Thanks for looking into this!
Ronald
dsPIC30F5013 Switch ReadState Bug
Moderator: Benj
-
- Posts: 139
- Joined: Tue Jan 05, 2010 10:07 am
- Has thanked: 20 times
- Been thanked: 25 times
- Contact:
dsPIC30F5013 Switch ReadState Bug
- Attachments
-
- Not Working Code
- not_working.jpg (48.85 KiB) Viewed 2554 times
-
- Working Code
- working.jpg (46.91 KiB) Viewed 2554 times
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: dsPIC30F5013 Switch ReadState Bug
This is an issue for all processors with 16 bit ports. The switch component tries to read a 16 bit value into an 8 bit variable. Drop the attached file in the components directory to solve the issue.
- Attachments
-
- FC5_PIC16BIT_SWITCH.c
- (7.53 KiB) Downloaded 219 times
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Posts: 139
- Joined: Tue Jan 05, 2010 10:07 am
- Has thanked: 20 times
- Been thanked: 25 times
- Contact: