bootloading to a multi-controller board


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2004
    Location
    New Hampshire
    Posts
    76

    Default bootloading to a multi-controller board

    Hi all,

    I thought I'd share the resolution to a problem I had using a board we designed that included three PIC controllers. It was elusive and took quite some time fumbling around before the cause presented itself.

    The board we use has two 16f876s and one 16f877, though the problem would have occured with any PICS connected the following way.

    The TX and RX lines were tied to all three chips from a MAX232 circuit. The board was connected by serial cable to my computer and each of the pics had the MicroCode Bootloader installed.

    An on-board three-position jumper chose which pic would receive the MCLR LOW signal to initialize the correct pic for programming. And for a while it would seem that everything worked. And that is what really led me astray. Why would it work one day and not the next.

    Long story short...

    The TRIS register for PORTC has to be set properly so that the TX and RX pins are made INPUTS (high impedance) on EACH of the PICS. In my case, the '876s defaulted to a HIGH output on the TX (or RX) pin. When trying to program one of the PICs, the data signals would fight going LOW because the other pics would be stubbornly trying to hold the TX or RX lines HIGH. This meant that the PICS could only be programmed with one on board at a time.

    Once I realized the problem, I set the TRIS registers on all three PICS to make their TX and RX pins INPUT. Then I could install all three PICS without further problems. Now I can boot-load programs to any of the three PICS with only a jumper change (for MCLR).

    Having multiple PICS on a circuit board may be seldom done but it can be done with the MicroCode bootloader and work well.

    I hope this helps someone in the future. This forum has helped me a great deal.

    CUDOS to the forum GODS!

    Ross
    Never enough knowledge to be called intelligent but just enough knowledge to be considered dangerous!

    I like that! :-)

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Thumbs up Awesome!

    Nice tip Ross.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Steve,

    do you remember This
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Talking

    Yep for sure... but since you boot the PIC, all pins are set to input, IMO the booloader software set TX to output itself.

    AND the link was about ICD problem, not bootloader problem(like i had few days ago... still feeling cheap of my mistake ;o] )

    BUT... i'm not sure HSEROUT will work after that. AND case it's working... all TXs are tie together without any kind of isolation... short circuit's coming soon

    AND i'm really not going to use this kind of method. i'll prefer using one bigger PIC.
    Last edited by mister_e; - 15th February 2005 at 19:02.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Yep for sure... but since you boot the PIC, all pins are set to input, IMO the booloader software set TX to output itself.
    I always set the registers "manually"
    AND the link was about ICD problem, not bootloader problem(like i had few days ago... still feeling cheap of my mistake ;o] )
    My reminder was just ment to make you smile ;-)
    BUT... i'm not sure HSEROUT will work after that. AND case it's working... all TXs are tie together without any kind of isolation... short circuit's coming soon
    I fully agree. when connecting pins that have a chance to come up as output there should be some kind of protection (like diodes)
    AND i'm really not going to use this kind of method. i'll prefer using one bigger PIC.
    I also agree on this one, but sometimes there is no choice, since the PIC is only able to do one task at a time.

    You can get some kind of "multi-tasking" by adding some PIC's .
    Last edited by NavMicroSystems; - 16th February 2005 at 01:17.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    My reminder was just ment to make you smile ;-)
    hehe that's what you did

    In case i'll have a board with multiple PIC to be updated, i'll probably use another method using Digital switches (4066 or else better) probably controlled by a dedicated 'firmware update PIC server' who'll do the switching for me.
    Last edited by mister_e; - 15th February 2005 at 20:46.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Oct 2004
    Location
    Porto - Portugal
    Posts
    28


    Did you find this post helpful? Yes | No

    Default

    Hi all

    After reading the link provided by NavMicroSystems I remember what happened when I used the ICD for the first time and I must say it originated a "melting" problem.

    I just programmed a small program in a 16F628 and didn't take care about TRIS, because has I though then the ICD isintelligent enough to take care of that.

    The ICD fail to start the first time due to wrong schematic provided by MCSplus helpfile, after correction of circuit at my second attempt and while I was at the PC keyboard trying to find what is wrong, suddenly it started smelling that something is not OK, when I turn back I found that the heat at the PIC pins has melted the plastic of my breadboard and "believe it or not" I could not remove the PIC from the breadboard, result: PIC=1 - breadboard=0.

    In the General forum under "Which PBP Compiler are you using?" I appreciated the help from mister_e, here I thanks the guidance of NavMicroSystems with that link.

    Credit should be given to those who know how to enlarge our small ideas.
    nomada

  8. #8
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    nomada

    we're glad to hear those threads have been of any use.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



Similar Threads

  1. 16f887 44 pin demo board code problem?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th December 2008, 14:17
  2. HELP with LAB-X1 board
    By manwolf in forum Off Topic
    Replies: 1
    Last Post: - 11th June 2008, 19:52
  3. 5v and 7v on same board - question
    By mark.oswald in forum Schematics
    Replies: 1
    Last Post: - 28th July 2007, 23:03
  4. Replies: 8
    Last Post: - 7th December 2006, 15:42
  5. SRF04 Range Finder 16F628 R18iXL Board
    By Spindle in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th June 2005, 02:08

Members who have read this thread : 1

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