Page 1 of 1

reset for internal MCLR

Posted: Sat Jun 20, 2015 2:33 pm
by bilal
hi

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

Re: reset for internal MCLR

Posted: Sat Jun 20, 2015 3:22 pm
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

Re: reset for internal MCLR

Posted: Sat Jun 20, 2015 5:13 pm
by bilal
thanks

i don't need external MCLR.

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

Re: reset for internal MCLR

Posted: Sat Jun 20, 2015 5:21 pm
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

Re: reset for internal MCLR

Posted: Sat Jun 20, 2015 5:36 pm
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

Re: reset for internal MCLR

Posted: Sat Jun 20, 2015 5:49 pm
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

Re: reset for internal MCLR

Posted: Sat Jun 20, 2015 6:05 pm
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;" .

Re: reset for internal MCLR

Posted: Sun Jun 21, 2015 9:41 am
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

Re: reset for internal MCLR

Posted: Tue Jun 23, 2015 3:46 pm
by bilal
okay i will give example file:

I want to use all pin in the IC pic16f676.

Re: reset for internal MCLR

Posted: Tue Jun 23, 2015 8:51 pm
by medelec35
Try again with your flowchart but re-read this post first.

Re: reset for internal MCLR

Posted: Tue Jun 23, 2015 9:04 pm
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

Re: reset for internal MCLR

Posted: Tue Jun 23, 2015 9:47 pm
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.

Re: reset for internal MCLR

Posted: Tue Jun 23, 2015 10:41 pm
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.

Re: reset for internal MCLR

Posted: Wed Jun 24, 2015 7:24 am
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!!