How to MCLR by code for 16F877


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Firat, Yes it is possible to effect an MCLR function from within your code. Paste these lines into your code where you want to effect the reset function. I use this code on an 16F876 and it works great. I use it after waking from sleep mode.

    Asm
    bcf PCLATH, 3
    bcf PCLATH, 4
    goto 0
    EndAsm

    Try it and let me know....

    Dave Purola,
    N8NTA

  2. #2
    Join Date
    Apr 2010
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: How to MCLR by code for 16F877

    Quote Originally Posted by Dave View Post
    Firat, Yes it is possible to effect an MCLR function from within your code. Paste these lines into your code where you want to effect the reset function. I use this code on an 16F876 and it works great. I use it after waking from sleep mode.

    Asm
    bcf PCLATH, 3
    bcf PCLATH, 4
    goto 0
    EndAsm

    Try it and let me know....

    Dave Purola,
    N8NTA


    Thank you for sharing . Your post did help me. Thanks

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: How to MCLR by code for 16F877

    This thread predates my membership here by a year or two, and I had never seen it. Thanks Dave for this delicious tidbit and thanks to Vett58 for resurfacing it. BTW, it works a treat!
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Apr 2010
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: How to MCLR by code for 16F877

    Quote Originally Posted by Archangel View Post
    This thread predates my membership here by a year or two, and I had never seen it. Thanks Dave for this delicious tidbit and thanks to Vett58 for resurfacing it. BTW, it works a treat!
    I am grateful to you and all moderators and members to have shared the vast knowledge by this remarkably useful and accurate forum. Thanks for all you do.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default Re: How to MCLR by code for 16F877

    The software reset is not a complete hardware reset. Keep that in mind, since some registers are not really reset as in a power cycle.

    Ioannis

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts