reset for internal MCLR

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

Moderator: Benj

Post Reply
bilal
Posts: 20
Joined: Sat Dec 06, 2014 5:15 pm
Has thanked: 1 time
Contact:

reset for internal MCLR

Post by bilal »

hi

how i can make reset for internal MCLR in flowcode ??

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: reset for internal MCLR

Post by medelec35 »

Hi bilal,
I'm assume you would like to have a reset and program via ICSP?

Make sure you have external MCLR set to enable.
The circuitry I thought made sense is:
MCLR cct.png
(4.95 KiB) Downloaded 4374 times
I found it on this website

Martin
Martin

bilal
Posts: 20
Joined: Sat Dec 06, 2014 5:15 pm
Has thanked: 1 time
Contact:

Re: reset for internal MCLR

Post by bilal »

thanks

i don't need external MCLR.

I need internal MCLR. By entering a code , through flowcode program.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: reset for internal MCLR

Post by medelec35 »

bilal wrote:i don't need external MCLR.
Oops sorry, I misread your post.
Its the opposite.
Select Build, project options.
Then select Configure tab.
Make sure you have external MCLR set to disable (or internal depending target device).
Also make sure PLL(unless pll is required) , watchdog and Low voltage programming is also set to disabled (or internal depending on target device).

Then MCLR can be used as an input if target device allows.

Martin
Martin

bilal
Posts: 20
Joined: Sat Dec 06, 2014 5:15 pm
Has thanked: 1 time
Contact:

Re: reset for internal MCLR

Post by bilal »

sorry
in external MCLR , if i press switch for reset he will reset.

in internal there is no switch for reset what i will do to make reset?? can you give me the code in flowcode it can make reset for internal MCLR.

thank you very match

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: reset for internal MCLR

Post by medelec35 »

You can use a c code block:

Code: Select all

reset();
So you could connect a switch and pull-up resistor to any i/p port including MCLR as an i/p
Then have a decision icon.
if i/p = 1 then C code block

Code: Select all

reset();
Other wise as far as I'm aware, you can't use a switch to reset if MCLR is configured to internal
Martin

bilal
Posts: 20
Joined: Sat Dec 06, 2014 5:15 pm
Has thanked: 1 time
Contact:

Re: reset for internal MCLR

Post by bilal »

thanks very match.

can you give me a file in flowcode for example.

if i but "reset" only or like this "reset_MCLR;" .

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: reset for internal MCLR

Post by medelec35 »

Thinking about it, I'm a bit confused.
Why do you want an internal reset when you can just have the standard external reset?

If using an internal reset and activated by a switch, then unless using an internal weak pull-up, a resistor and a switch are required plus some code.
If using an external reset then only a switch and resistor are required and no additional coding.

If you really want an internal reset then if you post the flowchart I will modify it for you.

Martin
Martin

bilal
Posts: 20
Joined: Sat Dec 06, 2014 5:15 pm
Has thanked: 1 time
Contact:

Re: reset for internal MCLR

Post by bilal »

okay i will give example file:

I want to use all pin in the IC pic16f676.
Attachments
internal reset.fcfx
(5.92 KiB) Downloaded 315 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: reset for internal MCLR

Post by medelec35 »

Try again with your flowchart but re-read this post first.
Martin

bilal
Posts: 20
Joined: Sat Dec 06, 2014 5:15 pm
Has thanked: 1 time
Contact:

Re: reset for internal MCLR

Post by bilal »

thanks.

I did not understand the meaning of the i/p in post.
(if i/p = 1 then C code block)

did my example file is correct ?! CONFIGURE AND SWITCH AND LED AND C CODE..??

in pic16f676
switch = RA0
LED = RA3/MCLR/VPP
Attachments
internal reset.fcfx
(5.92 KiB) Downloaded 265 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: reset for internal MCLR

Post by kersing »

bilal wrote:LED = RA3/MCLR/VPP
This will not work, if you check the data sheet for the chip you will see:
RA3 TTL — Input port with interrupt-on-change.
So RA3 is input only and can not be used to output to a LED.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: reset for internal MCLR

Post by medelec35 »

bilal wrote:did my example file is correct ?! CONFIGURE AND SWITCH AND LED AND C CODE..??
No I pointed to my post because you have a c code block with

Code: Select all

reset;
, but it should be

Code: Select all

reset();
That along with kersing post should help you get your flowchart sorted out.
bilal wrote:I did not understand the meaning of the i/p in post.
(if i/p = 1 then C code block)
That just means read an input pin.
Using a decision branch:
If true (=1) then

Code: Select all

reset();
Or you could do if =0 then

Code: Select all

reset();
instead.
Martin

bilal
Posts: 20
Joined: Sat Dec 06, 2014 5:15 pm
Has thanked: 1 time
Contact:

Re: reset for internal MCLR

Post by bilal »

thanks, I understood
So RA3 is input only and can not be used to output to a LED.
This is a new problem emerged ...... why!!! Because of that in flowcode program in simulations accept output from RA3 AND LED IS WORK IN SIMULATION!!

Post Reply