caramoan tour package

caramoan tour package

Author Topic: about the MCLR pin in PICs...  (Read 1390 times)

Offline Alexithymia

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
about the MCLR pin in PICs...
« on: June 11, 2009, 04:55:30 PM »
Ano po ba ang use ng MCLR pin ng PIC? Is it as simple as resetting the program of the PIC once the pin is turned low? If simple reset lang talaga siya maybe I can use it as a reset for the whole program routine. Sabaw po kasi ako sa pagbabasa ng datasheet. Ang alam ko lang is shared siya ng pin with Vpp which is used in ICSP at may recommend na RC ckt ang microchip for the MCLR. Please enlighten me and correct me if I'm wrong.  :)
Live as if you were to die tomorrow. Learn as if you were to live forever.
-M.K. Gandhi

Philippine Electronics Forum

about the MCLR pin in PICs...
« on: June 11, 2009, 04:55:30 PM »

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1879
  • Pogi/Ganda Points: 244
  • Gender: Male
  • Been at this longer than you've been alive.
Re: about the MCLR pin in PICs...
« Reply #1 on: June 11, 2009, 07:49:25 PM »
Yes the MCLR pin functions as a master clear or reset. Earlier PICs (circa PIC16C5x) required a fancy RC circuit. However newer ones don't and can be tied directly to Vcc or through a pull-up resistor. Or the pin can simply be reasigned to an I/O and the MCLR will be internally pulled up.

Yes you can use the MCLR initiate when to run a routine but there is no assurance when exactly the PIC will resume running because I believe the clock oscillator is also stopped. When it restarts oscillating will depend on how the crystal and the oscillator circuit components. If the timing is critical then the MCLR pin is a poor choice

BTW, try your best to understand the datasheets because once you learn to do that then you can use the skill to read almost anything else like business contracts, etc...
"Set your mind free!"

Philippine Electronics Forum

Re: about the MCLR pin in PICs...
« Reply #1 on: June 11, 2009, 07:49:25 PM »

Offline Alexithymia

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 0
Re: about the MCLR pin in PICs...
« Reply #2 on: June 12, 2009, 11:56:37 AM »
Thank you sir! Pogi pts 4 you.

Guess I have to try and test it myself... I'm making a simple UART routine along w/ some interrupts. If phail then I guess some proper coding would do.
Live as if you were to die tomorrow. Learn as if you were to live forever.
-M.K. Gandhi

Philippine Electronics Forum

Re: about the MCLR pin in PICs...
« Reply #2 on: June 12, 2009, 11:56:37 AM »

Offline karombal

  • CR2032 Battery
  • **
  • Posts: 21
  • Pogi/Ganda Points: 0
Re: about the MCLR pin in PICs...
« Reply #3 on: July 09, 2009, 01:57:14 AM »
kailangan ba i-pull up ang mclr? ano ang epekto nito? eto ba ang magsasabi sa PIC na magstart na sha sa routine na nakaprogram?

Philippine Electronics Forum

Re: about the MCLR pin in PICs...
« Reply #3 on: July 09, 2009, 01:57:14 AM »

Offline spo

  • CR2032 Battery
  • **
  • Posts: 25
  • Pogi/Ganda Points: 0
  • Gender: Male
  • fulltime estudyante, part time earthbender
Re: about the MCLR pin in PICs...
« Reply #4 on: July 09, 2009, 02:47:35 AM »
Ang alam ko ung mclr ung master reset. Pag pineress mo, mag start uli ung sequence ng program mo sa micro.
Earthbend... Yah!!

Philippine Electronics Forum

Re: about the MCLR pin in PICs...
« Reply #4 on: July 09, 2009, 02:47:35 AM »

Offline Mayalin22

  • Hydroelectric
  • ***
  • Posts: 3389
  • Pogi/Ganda Points: 400
  • Gender: Female
Re: about the MCLR pin in PICs...
« Reply #5 on: July 09, 2009, 03:29:56 AM »
Maraming function ang MCLR as sir motion said, once you bring it from high to low it will reset the micro and start again at the beginning of the code. Some micro have multiple function in MCLR pin, it is better to understand the datasheet of the target micro since their is a variation in function from micro to micro.
Simpler designs are usually better.

Offline karombal

  • CR2032 Battery
  • **
  • Posts: 21
  • Pogi/Ganda Points: 0
Re: about the MCLR pin in PICs...
« Reply #6 on: July 09, 2009, 07:20:53 AM »
kung naiwan shang naka-low diba stop lang yung circuit? kung naibalik mo ulit sa high chaka tatakbo yung routines sa code mo? sa high state kasi ako nagkakaproblema.. seems like hindi ko sha mapull-up to the "run" state... nagconnect naman ako ng 5V dc power supply mismo to the mclr via 4.7k / 10k resistor..
hehe sorry medyo malabo.. nalalabuan nga rin ako bakit hindi gumagana kasi ilan beses ko na nidouble check.. gamit ko 16f877a..

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: about the MCLR pin in PICs...
« Reply #7 on: July 09, 2009, 09:06:20 AM »
kailangan ba i-pull up ang mclr? ano ang epekto nito? eto ba ang magsasabi sa PIC na magstart na sha sa routine na nakaprogram?

to keep the PICmicro running, the MCLR should be high state. having to momentarily pull it low, generally, the program shall reset. basta in a normal setup ganun lang yun.

kaya nga dito nilalagay ang reset bottom. eto ang simple implementation:

it is also good to put at least a 100ohms in series with the switch. this will limit the current when the switch is  closed.
with that setup, VDD (or high level) will be continually be provided to the MCLR pin. 10k will also limit the current. when the switch is closed, the mclr pin will be nearer to the VDD (because of the 10k) causing it to have a low state.

ganun lang. ;D ;D ;D

kung naiwan shang naka-low diba stop lang yung circuit? kung naibalik mo ulit sa high chaka tatakbo yung routines sa code mo? sa high state kasi ako nagkakaproblema.. seems like hindi ko sha mapull-up to the "run" state... nagconnect naman ako ng 5V dc power supply mismo to the mclr via 4.7k / 10k resistor..
hehe sorry medyo malabo.. nalalabuan nga rin ako bakit hindi gumagana kasi ilan beses ko na nidouble check.. gamit ko 16f877a..

papost nalang ng schematic. :)
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline karombal

  • CR2032 Battery
  • **
  • Posts: 21
  • Pogi/Ganda Points: 0
Re: about the MCLR pin in PICs...
« Reply #8 on: July 09, 2009, 11:33:46 PM »
salamat sa mga responses..

kahibangan nanaman ang nangyari sa akin.. napagana ko na sa breadboard..  :)
hindi ko alam ano nangyari.. kasi dati pa tama connections ko.. maraming beses ko na sha paulit ulit na tanggal kabit.. eh same connections lang i'm sure.. tapos kanina inayos ko yung mga jumpers/wires para maganda tingnan.. ipapakita ko kasi sana sa gizmo at magpapatulong.. pero nung pagkatapos ko ikabit, nag-run na yung routines.. i've no idea what changed! na-fru-frustrate na nga ako dati..  :-\

Philippine Electronics Forum

Re: about the MCLR pin in PICs...
« Reply #8 on: July 09, 2009, 11:33:46 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com