PIC18f2553 RE3/Mclr

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
alanwms
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

Post by alanwms »

Attempting to read RE3 but the compiler refuses to compile. See bellow picture. Any thoughts?
RE3-MCLR.jpg
RE3-MCLR.jpg (62.09 KiB) Viewed 5359 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: PIC18f2553 RE3/Mclr

Post by LeighM »

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) …

Code: Select all

#define TRISE TRISE
extern volatile unsigned char TRISE @ 0xF96;

alanwms
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

Post by alanwms »

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

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: PIC18f2553 RE3/Mclr

Post by LeighM »

I think (maybe) that the project option config which disables mclr in leu for Re3 is not working
I've checked the FCD against the device datasheet and it looks OK, I'll see if Ben has a view on this one

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: PIC18f2553 RE3/Mclr

Post by Benj »

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.

Code: Select all

unsigned char TRISE;
Then Click OK and OK again and the project should now compile correctly.

alanwms
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

Post by alanwms »

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

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: PIC18f2553 RE3/Mclr

Post by Benj »

Hello,

Please can you attach your Flowcode project file and also your .hex file and I'll investigate for you.

alanwms
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

Post by alanwms »

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 191 times
P3 Musings.fcfx
(275.66 KiB) Downloaded 187 times

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: PIC18f2553 RE3/Mclr

Post by Benj »

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.
Config.jpg
Config.jpg (22.3 KiB) Viewed 5218 times
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.

alanwms
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

Post by alanwms »

Thank you very much Ben. That removes the question for me. I will check the docs you reference.

Post Reply