Auto reset MCLR


+ Reply to Thread
Results 1 to 6 of 6

Thread: Auto reset MCLR

  1. #1
    Join Date
    Sep 2005
    Location
    France
    Posts
    52

    Default Auto reset MCLR

    Hi,
    I would like to use a bootloader (mikroE) on my PCB (18f45k22) over my serial RF connection (433MHz). To distant upgrade my pic. (I'm using PBP2.60)
    The bootloader works like this:
    Put the Mclr Low then I have 2 seconds to upload my new firmware or my program is starting.
    As my program use Usart, I would like to send my pic a command to put it's own MCLR low...
    But I have no idea how to do it...
    May be using another pic in // RX and doing the job ? or my 18f45k22 could do the job itself ?

    Thanks for ideas.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,204

    Default Re: Auto reset MCLR

    If you have a spare I/O then you could have the PIC pull its own MCLR down. Or, perhaps you can use the watchdog timer to "force" a reset.

    /Henrik.

  3. #3
    Join Date
    Sep 2005
    Location
    France
    Posts
    52

    Default Re: Auto reset MCLR

    Henrik,

    I tried (simulation) with one Output of my PIC but it doesn't work. Pic doesn't restart... May be it's because simulation ? Actually it works when my pic trig a 555 in monostable (output of 555 trig a mosfet connected to MCLR)
    May be I have to try in real life ?
    regards

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,204

    Default Re: Auto reset MCLR

    I don't see how it could NOT work. MCLR is pulled up thru the normal resistor and also connected to a normal I/O.
    When that I/O is set LOW it'll pull MCLR low which will reset the PIC. As soon as that happens the TRIS bit for the IO will be set which makes the pin high Z which releases MCLR.

    Try it with real hardware and let us know.

    It wouldn't be the first time a simulator got it wrong but I'll gladly stand corrected if the simulator is right.

    /Henrik

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,534

    Default Re: Auto reset MCLR

    Quote Originally Posted by harryweb View Post
    May be using another pic in // RX and doing the job ? or my 18f45k22 could do the job itself ?

    Thanks for ideas.
    Don't the 18F series have a software reset command ???

    4.0 RESET
    The PIC18(L)F2X/4XK22 devices differentiate between
    various kinds of Reset:
    a) Power-on Reset (POR)
    b) MCLR Reset during normal operation
    c) MCLR Reset during power-managed modes
    d) Watchdog Timer (WDT) Reset (during
    execution)
    e) Programmable Brown-out Reset (BOR)
    f) RESET Instruction
    g) Stack Full Reset
    h) Stack Underflow Reset
    see Datasheet : DS41412D-page 397

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6

    Default Re: Auto reset MCLR

    Don't the 18F series have a software reset command?
    Yes, but not knowing the bootloader it's possible that it might not work since it can tell the difference. That's unlikely, though.

    What Henrik proposed works. Once again, the simulator lies.

Similar Threads

  1. Auto Pilot
    By PlantBob in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th May 2012, 19:43
  2. Replies: 12
    Last Post: - 7th May 2012, 18:25
  3. External Reset for MCLR
    By gavo in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th September 2010, 21:56
  4. Auto Downloads
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 16th November 2004, 20:21
  5. auto advance
    By c_Moore in forum General
    Replies: 6
    Last Post: - 31st October 2004, 13:20

Members who have read this thread : 19

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