PIC18f2553 RE3/Mclr
Moderator: Benj
-
- Posts: 67
- Joined: Tue Sep 16, 2008 2:09 pm
- Location: Minnesota USA
- Has thanked: 4 times
- Been thanked: 17 times
- Contact:
PIC18f2553 RE3/Mclr
Attempting to read RE3 but the compiler refuses to compile. See bellow picture. Any thoughts?
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: PIC18f2553 RE3/Mclr
The problem is that with RE3 being only input there is no TRISE for this device, so our generic port control throws the error.
This is a similar issue viewtopic.php?f=76&t=20252
A work-around might be to try adding this code into the (Build->Project Options) Supplementary code (Definitions and function declarations) …
This is a similar issue viewtopic.php?f=76&t=20252
A work-around might be to try adding this code into the (Build->Project Options) Supplementary code (Definitions and function declarations) …
Code: Select all
#define TRISE TRISE
extern volatile unsigned char TRISE @ 0xF96;
-
- Posts: 67
- Joined: Tue Sep 16, 2008 2:09 pm
- Location: Minnesota USA
- Has thanked: 4 times
- Been thanked: 17 times
- Contact:
Re: PIC18f2553 RE3/Mclr
Thanks you. I will attempt that resolve.
On another note - I think (maybe) that the project option config which disables mclr in leu for Re3 is not working. I think that the mclr pin is still an mclr pin? I can get the pic to reset using this pin.
To be clear - It will compile with the Re3 pin selected in place of the mclr pin if I don't insert a "Input" component, but I don't think that the config changes or disables the mclr pin - Thoughts?
In will check out the supplemental code.
Regards
On another note - I think (maybe) that the project option config which disables mclr in leu for Re3 is not working. I think that the mclr pin is still an mclr pin? I can get the pic to reset using this pin.
To be clear - It will compile with the Re3 pin selected in place of the mclr pin if I don't insert a "Input" component, but I don't think that the config changes or disables the mclr pin - Thoughts?
In will check out the supplemental code.
Regards
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: PIC18f2553 RE3/Mclr
I've checked the FCD against the device datasheet and it looks OK, I'll see if Ben has a view on this oneI think (maybe) that the project option config which disables mclr in leu for Re3 is not working
- 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: PIC18f2553 RE3/Mclr
Hello,
I'll see if I can get this fixed in a more elegant manner. Basically Flowcode looks for a data direction register and on your device there isn't one for PortE as the single port pin can only ever be an input.
For now you can work around the problem like this.
If you click on Build -> Project Options.
Then check the "Use Supplementary Code" checkbox.
Click the "Supplementary Code" button.
In the definitions section enter this code.
Then Click OK and OK again and the project should now compile correctly.
I'll see if I can get this fixed in a more elegant manner. Basically Flowcode looks for a data direction register and on your device there isn't one for PortE as the single port pin can only ever be an input.
For now you can work around the problem like this.
If you click on Build -> Project Options.
Then check the "Use Supplementary Code" checkbox.
Click the "Supplementary Code" button.
In the definitions section enter this code.
Code: Select all
unsigned char TRISE;
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
-
- Posts: 67
- Joined: Tue Sep 16, 2008 2:09 pm
- Location: Minnesota USA
- Has thanked: 4 times
- Been thanked: 17 times
- Contact:
Re: PIC18f2553 RE3/Mclr
Thank you Ben.
The system compiles now. The reason I was doing this is because I can get the system to reset by a low signal on the pin (mclr). My thought were that making this an input would resolve the issue.
Unfortunately it didn't. I can still get the system to reset under a low condition on the mclr pin 1.
I'm thinking that the project option to disable the mclr and use the RE3 may not be working. Can you investigate that and let me know if the mclr is truly being disabled?
I should not reset my software if I hit an input on RE3
Regards
The system compiles now. The reason I was doing this is because I can get the system to reset by a low signal on the pin (mclr). My thought were that making this an input would resolve the issue.
Unfortunately it didn't. I can still get the system to reset under a low condition on the mclr pin 1.
I'm thinking that the project option to disable the mclr and use the RE3 may not be working. Can you investigate that and let me know if the mclr is truly being disabled?
I should not reset my software if I hit an input on RE3
Regards
- 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: PIC18f2553 RE3/Mclr
Hello,
Please can you attach your Flowcode project file and also your .hex file and I'll investigate for you.
Please can you attach your Flowcode project file and also your .hex file and I'll investigate for you.
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
-
- Posts: 67
- Joined: Tue Sep 16, 2008 2:09 pm
- Location: Minnesota USA
- Has thanked: 4 times
- Been thanked: 17 times
- Contact:
Re: PIC18f2553 RE3/Mclr
Thanks Ben - Here are my files I call "Musings" because I change lots of stuff in order to attempt resolve.
- Attachments
-
- P3 Musings.hex
- (81.89 KiB) Downloaded 195 times
-
- P3 Musings.fcfx
- (275.66 KiB) Downloaded 190 times
- 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: PIC18f2553 RE3/Mclr
Hello,
I've loaded your .hex file into MPLAB-X and this confirms that the config value is correct and that there are no issues in the Flowcode definition file etc.
Have you checked the errata datasheet on the Microchip website for the chip as it should list any known problems with the silicone as well as potential workarounds.
I've loaded your .hex file into MPLAB-X and this confirms that the config value is correct and that there are no issues in the Flowcode definition file etc.
Have you checked the errata datasheet on the Microchip website for the chip as it should list any known problems with the silicone as well as potential workarounds.
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
-
- Posts: 67
- Joined: Tue Sep 16, 2008 2:09 pm
- Location: Minnesota USA
- Has thanked: 4 times
- Been thanked: 17 times
- Contact:
Re: PIC18f2553 RE3/Mclr
Thank you very much Ben. That removes the question for me. I will check the docs you reference.