+ Reply to Thread
Page 2 of 2
First 1 2
Results 16 to 30 of 30

Thread: Why do I need an ICD (In Circuit Debugger)?

  1. #16
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Hi all thanks for your replies.
    Now I slightly understand what is ICD & is for what.

    So I planned to build an ICD circuit. Here is the circuit I’m going to build.
    http://www.stolz.de.be/

    In the circuit I see TARGET PGD, TARGET PGC and TARGET MCLR what is this?
    For what reason are they?

    And after built do I need some other software to program the chip like IC PROG, WinPIC Prog etc…or can I program the chip within MPLAB 7.6?

    Please reply me I’m a newcomer to this DEBUGGING world

    Thanks


  2. #17
    3v0
    3v0 is offline
    3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent
    Join Date
    Jul 2006
    Location
    USA
    Posts
    6,460
    Blog Entries
    11

    Default

    The chip you are programming/debugging is know as the target chip or target for short.

    The MCLR is a line used to set/reset the target, also provides the VPP program voltage.

    The other two lines are serial lines used to communicate between the ICD2 and the target. PGD is program data and PGC is a clock line for use with PGD.

    The ICD2 (and clones) is used with MPLAB software from Microchip. It is a IDE or Integrated Development Environment that also contains a PIC simulator program. MPLAB is the only free program that I know of that works with an ICD2. You can read more about MPLAB on the Microchip web site.

    The inchworm and inchworm+ are ICD2 clones. You can find the schematics for building them at www.blueroomelectronics.com. Many here have built these from scratch or as kits.
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's Tutorials
    Junebug USB PIC programmer kit., USB Bit Whacker,
    The 15 Minute Printed Circuit Board! (+drill time)

  3. #18
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Wow thanks 3V0 for your explanation.

    Here I have attached an ICD circuit one has already made.

    Now if I want to program a new PIC16F876 where do I have to insert the chip? In the circuit already there is a 876 PIC.

    I can plug the RS232 cable into this circuit. After that can I program with IC Prog?
    Attached Images

  4. #19
    Odin Okay
    Join Date
    Jun 2004
    Location
    Norway
    Posts
    40

    Default

    Quote Originally Posted by Suraj143
    Now if I want to program a new PIC16F876 where do I have to insert the chip? In the circuit already there is a 876 PIC.
    You have to connect it outside the ICD. There's a small socket with five pins. Run a cable from this socket to the right pins on the PIC you want to program. Look at the datasheet for the PIC to see wich pins. They're named PGD, PGC, MCLR. In addition you connect Vdd and Vss (+5V and GND)

    I can plug the RS232 cable into this circuit. After that can I program with IC Prog?
    I don't know ICProg, but you can use MPlab, wich is free downloadable from Microchip.

    One tip about finding the right pins to connect. Don't mix MCLR with PGM! I've done it myself on a couple of PICs, and spent some time finding the silly error...

  5. #20
    3v0
    3v0 is offline
    3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent
    Join Date
    Jul 2006
    Location
    USA
    Posts
    6,460
    Blog Entries
    11

    Default

    Quote Originally Posted by Suraj143

    Here I have attached an ICD circuit one has already made.

    Now if I want to program a new PIC16F876 where do I have to insert the chip? In the circuit already there is a 876 PIC.

    I can plug the RS232 cable into this circuit. After that can I program with IC Prog?
    The only program you can use with your ICD is MPLAB from Microchp. You can download it for free from the Microchip Website.

    Your ICD uses an ICSP connector. It has the MCLR, PGD, PGC, +5 and GND pins. Take a look at the schematics you built it from. It is up to you to get these signals to your target chip. Most often we put an ICSP connector on the target board and use a cable to connect the ICD ICSP to the target ICSP. This saves having to move the chip to and from a programmer socket.

    EDIT:
    Did you build this ICD? If so I am not sure that you understand it. The ICD has a PIC on it that is used to program other PICs. The problem is that the onboard PIC needs to be programmed or the ICD will not work. So if this is your only programmer you have no way to programm the onboard PIC.

    That is to say: The PIC on the ICD is part of the ICD and not a target for your use. It is the brains for the ICD.

    Did you use a new/blank PIC in the ICD or has it been programmed for use with the ICD?
    Last edited by 3v0; 6th July 2007 at 07:36 AM.
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's Tutorials
    Junebug USB PIC programmer kit., USB Bit Whacker,
    The 15 Minute Printed Circuit Board! (+drill time)

  6. #21
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Oh I see I have to connect my new PIC outside running a 5 pin cable from the ICD circuit.

    Earlier I thought I have to fix the new PIC in the ICD circuit.

    Then what’s the purpose of the PIC already in the ICD circuit?

    Do I need two PICs?

  7. #22
    3v0
    3v0 is offline
    3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent
    Join Date
    Jul 2006
    Location
    USA
    Posts
    6,460
    Blog Entries
    11

    Default

    Quote Originally Posted by Suraj143
    Do I need two PICs?
    Yes

    While you were reading my last post I edited it. Please re read it.
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's Tutorials
    Junebug USB PIC programmer kit., USB Bit Whacker,
    The 15 Minute Printed Circuit Board! (+drill time)

  8. #23
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Oh thanks a lot 3V0 now I understand.

    But how can I program the ONBOARD chip (the ICD BRAIN CHIP)?
    Do I have to program it from a different programmer & insert it?

    So where is the hex file?

    Sorry for asking more questions.

  9. #24
    3v0
    3v0 is offline
    3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent
    Join Date
    Jul 2006
    Location
    USA
    Posts
    6,460
    Blog Entries
    11

    Default

    It looks like your ICD uses a 16F876. This page has a link to the HEX file you need to program it with.

    Where did you get the schematic for the one you built. Did it not talk about programming and testing the ICD?
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's Tutorials
    Junebug USB PIC programmer kit., USB Bit Whacker,
    The 15 Minute Printed Circuit Board! (+drill time)

  10. #25
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Quote Originally Posted by 3v0
    It looks like your ICD uses a 16F876. This page has a link to the HEX file you need to program it with.

    Where did you get the schematic for the one you built. Did it not talk about programming and testing the ICD?
    Here it is http://www.stolz.de.be/

  11. #26
    3v0
    3v0 is offline
    3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent
    Join Date
    Jul 2006
    Location
    USA
    Posts
    6,460
    Blog Entries
    11

    Default

    Yes you need a different (simpler) programmer to program the PIC for the ICD.

    One of the parallel types seem to be the most reliable. Some have had good luck with the JDM style programmers but not always with laptops.
    You may want to go to the WinPicProg website and build the P16PRO40 programmer.
    Last edited by 3v0; 6th July 2007 at 11:46 AM.
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's Tutorials
    Junebug USB PIC programmer kit., USB Bit Whacker,
    The 15 Minute Printed Circuit Board! (+drill time)

  12. #27
    3v0
    3v0 is offline
    3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent
    Join Date
    Jul 2006
    Location
    USA
    Posts
    6,460
    Blog Entries
    11

    Default

    On stolz's site you need to see 3.1. ICD's Firmware.

    He also has a low voltage programming cable that you can use to program the PIC.

    It can be bult with only 4 10K resistors. He calls it dirty but working. The P16PRO40 is a better programmer but since you only need to program the one chp you may want to give it a try. I have not tried it.
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's Tutorials
    Junebug USB PIC programmer kit., USB Bit Whacker,
    The 15 Minute Printed Circuit Board! (+drill time)

  13. #28
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Hi 3V0 thanks your explanation.
    I’m sorry I have some more questions to ask so please answer me.

    What’s the meaning of a BOOTLOADER & FIRMWARE? Is it the OS in the ICD main chip?

  14. #29
    3v0
    3v0 is offline
    3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent
    Join Date
    Jul 2006
    Location
    USA
    Posts
    6,460
    Blog Entries
    11

    Default

    I do not mind answering your questions but if you want better/faster answers to the simple ones you can google for them or look them up on wikipedia.

    What follows have been put in the most basic terms. Not 100% correct but it should move you in the direction of understanding these terms enough so you can read more about them elsewhere.

    First some basic definitions.

    uC = microController
    RAM = Random Access Memory
    ROM = Read Only Memory
    Flash = a type of ROM used by many uC, also known as EEPROM.

    FIRMWARE is code that is saved in and executed out of ROM. Code you store/execute on a flash PIC is firmware. The code inside a microwave oven is firmware.

    A BOOTLOADER is a simple program with the purpose to load other programs. A bootloader must be written to the uC with a programmer. After the bootloader is in place the uC can be programmed without the use of a programmer. Most often this is done over a RS232 or USB connection. The bootloader can also be used to reprogram the flash. So once you have a bootloader on a uC you can do without a programmer. This is very useful to upgrade firmware after a product is released.

    A BOOTLOADER is most often firmware because it is software stored in ROM.

    What does this mean for the ICD2?

    The uC that is the brains of the ICD2 needs firmware to function.
    To make life easy that firmware is initialy a bootloader.
    MPLAB communicates with the bootloader on the ICD2 to download the software needed to program other PICs. Microchip calls this software an OS (operation system).

    There are several OS used to program various Microchip uC's. If you had been programming 16F chps and switched to a 18F chip the ICD2 would need a different OS. MPLAB uses the bootloader on the ICD2 to load in that new OS.

    HTH
    Last edited by 3v0; 9th July 2007 at 06:50 AM.
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's Tutorials
    Junebug USB PIC programmer kit., USB Bit Whacker,
    The 15 Minute Printed Circuit Board! (+drill time)

  15. #30
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Oh I see now only I fully understand the real situation.
    From the very first time only I have to program the firmware (BOOTLOADER) file to the brain chip using an external programmer. After that I have the OS. So after that I can program, flash & debug other new chips inserted in the target board.

    I’m half way mark building the ICD circuit.

    Thanks 3V0 you helped me a lot.
    Many thanks

+ Reply to Thread
Page 2 of 2
First 1 2

Similar Threads

  1. power electronics circuit analysis
    By ptewright in forum Electronic Projects Design/Ideas/Reviews
    Replies: 4
    Latest: 23rd August 2009, 05:38 AM
  2. Circuit functioning very strange. Why?
    By Cyclone in forum Electronic Projects Design/Ideas/Reviews
    Replies: 13
    Latest: 19th February 2009, 07:27 AM
  3. I need help in designing a circuit
    By chefach in forum Electronic Projects Design/Ideas/Reviews
    Replies: 13
    Latest: 27th September 2007, 12:15 PM
  4. Inchworm Problem
    By mouse9911 in forum Micro Controllers
    Replies: 9
    Latest: 19th May 2007, 01:01 AM
  5. Circuit auto OFF feature after no events design
    By Uman in forum Electronic Projects Design/Ideas/Reviews
    Replies: 2
    Latest: 3rd May 2004, 06:34 AM

Tags for this Thread