PIC18f2553 RE3/Mclr

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

Moderator: Benj

alanwms
Posts: 56
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

PIC18f2553 RE3/Mclr

Postby alanwms » Sat Nov 16, 2019 6:36 pm

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 1031 times

User avatar
LeighM
Matrix Staff
Posts: 2008
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 688 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby LeighM » Mon Nov 18, 2019 3:01 pm

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: 56
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby alanwms » Tue Nov 19, 2019 5:21 am

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: 2008
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 688 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby LeighM » Tue Nov 19, 2019 12:59 pm

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: 14676
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4660 times
Been thanked: 4286 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby Benj » Wed Nov 20, 2019 12:15 pm

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: 56
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby alanwms » Wed Nov 20, 2019 7:27 pm

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: 14676
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4660 times
Been thanked: 4286 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby Benj » Thu Nov 21, 2019 11:01 am

Hello,

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

alanwms
Posts: 56
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby alanwms » Thu Nov 21, 2019 9:44 pm

Thanks Ben - Here are my files I call "Musings" because I change lots of stuff in order to attempt resolve.
Attachments
P3 Musings.hex
(83.76 KiB) Downloaded 26 times
P3 Musings.fcfx
(275.68 KiB) Downloaded 27 times

User avatar
Benj
Matrix Staff
Posts: 14676
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4660 times
Been thanked: 4286 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby Benj » Fri Nov 22, 2019 11:00 am

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 890 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: 56
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: PIC18f2553 RE3/Mclr

Postby alanwms » Sat Nov 23, 2019 2:52 am

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