Announcement

Collapse
No announcement yet.

i have never done ICD but now i want to, how do i start?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • i have never done ICD but now i want to, how do i start?

    i have never done ICD but now i want to, how do i start?
    is there a tutorial somewhere ?
    and for the programmer (is that what MCS calls 'loader'?) can i use the meLABS usb or do i need to get a pickit ?

  • #2
    > is there a tutorial somewhere ?
    In Microcode Studio PLUS, go to Help > Topics > In Circuit Debugger (ICD)

    The ICD in MCSP uses an RS232 serial connection to the PC.
    It does not use the programmer.
    PBP3 Manual : Microchip Datasheets - 10F, 12F, 16F, 18F
    Never download a PIC datasheet from anywhere but microchip.com

    Comment


    • #3
      obviously i don't know about this area, i will go read that, i sort of assumed it would be done over the programming pins

      Comment


      • #4
        Hi Dennis,
        As Darrel says, the ICD in MicroCodeStudio uses a RS232 connection to the PC and, although it is an In Circuit Debugger it's actually using firmware in the PIC to do the "debugging". This impacts the size of the compiled code and the speed at which it executes.

        A "real" In Circuit Debugger does indeed use the programming pins and the debugging is supported by hardware in the PIC itself and in the debugger (the PICKit or other device). Unfortunately this "mode" isn't supported from within MicroCodeStudio (I wish it was). You'll have to resort to MPLAB to use source level debugging at the hardware level.

        And, no, this is not what MCS calls a "loader". A loader in this context would be a bootloader which is a little bit of code that you program into the PIC using the normal device programmer and then allows the PIC to reprogram itself with data being being sent over a serial connection. Ie you can download new firmware to the PIC without using your meLabs programmer or PICKit or other device programmer.

        /Henrik.

        Comment


        • #5
          Henrik that was very helpful, thanks

          i have been using PBP since the very beginning of the program but sometimes a year or three will lapse between projects that require it
          during such lulls it is amazing how much rust develops and also how much things move along (progress!)

          my main means of debugging things which i can't figure out in the abstract has been to use a character LCD and the DEBUG serial routine to write the values of suspect variables or a message to indicate the program has reached some particular location

          yes i know about boot loaders (never used one though) and now i also 'get' the term wrt the MCS and serial setup

          so if i wanted to tackle the hardware ICD using MPLAB will the meLAB U2 programmer work or do i need the PICKit one ?
          and now the 'source' would be what ? the ASM file ?
          yes i see the issue, now one must understand that well for it to be useful

          so maybe my conclusion is: back to my good old character LCD for debug ?
          i don't think i want the overhead or bother of the serial port business, sounds like another day or three would go in the tank just getting up to speed on that

          Comment


          • #6
            Using the ICD in MicroCode Studio

            I use MCS with a MeLabs X1 development system. With MCS you can compile without programming, or without programming, that usually only invokes the programmer of choice. (I use the U2 programmer with the X1. The U2 is USB input). For debugging, it's simple to select the other choices for compiling: ICD compile or ICD compile with programming. This opens up a window on the right side of the screen showing all the parameters, registers, constants, variables, a ton of information. The ICD is real easy to use, very intuitive.

            Of course you need a big enough MCU to hold the software that does the debugging. Nothing in the 12F series can be debugged in this way because there are not enough pins, or sometimes no UART for the serial connection. If you are using the X1 development system you're pretty much stuck with using the 16F887 chip that comes with it. (Yes, you could use others with same pin function). The ICD works great with this chip. For big projects this is where I start, with the 16F887, do all the debugging, then change what is necessary to use the same program in a smaller PIC, like a 12F675. This is what works for me. (I also have a MikroElectronika board with hardware ICD that can accept ANY PIC chip, but that's another story).

            Comment


            • #7
              Hi Dennis,
              my main means of debugging things which i can't figure out in the abstract has been to use a character LCD and the DEBUG serial routine to write the values of suspect variables or a message to indicate the program has reached some particular location
              Yeah, that's what I usually do as well though I tend to use a terminal program (the one built into MCSP) instead of a serial LCD. With the conditional compile feature of PBP3 it's easy to switch the debug output on/off as needed - at compile time.

              so if i wanted to tackle the hardware ICD using MPLAB will the meLAB U2 programmer work or do i need the PICKit one ?
              I'm not 100% sure but I don't Think the meLabs programmer supports debugging, you're best off to verify that though. A PICKit3 is very cheap so it's really not much to think about if you need one.

              and now the 'source' would be what ? the ASM file ?
              No, it's PBP source. Thru some sort of magic which I don't fully comprehend the compiler, linker, assembler and what not "matches" the lines in the PBP source with the generated ASM and binary file so you can step through, step over, set breakpoints, whatch variables etc, all at the PBP source level. Too bad it's not supported from within MCSP....

              so maybe my conclusion is: back to my good old character LCD for debug ?
              Well, if it gets the job done then by all means. Sometimes a simple LED is all you need.....

              i don't think i want the overhead or bother of the serial port business, sounds like another day or three would go in the tank just getting up to speed on that
              The overhead I can understand though, depending on the application, it may or may not matter. However, if the target's already got a serial Connection then it's really easy and even if it doesn't adding one with MAX232 etc ain't exactly rocket science.

              /Henrik.

              Comment


              • #8
                debugging using MCS

                I have used the LabX1 with it's serial port to debug programs I wrote to the 16F887 on the Labx1 board. But I also built a circuit with a max232 chip and use quick clips to attach to any 18 pin MCU in circuit, for debugging, using the MCS debugger. (I also use LCD for debugging). Since then I've found max232 chip boards premade from China for about $5.00 - not worth anyone's time to make them when you can buy them that cheap! (shipping is free).

                So, without the LabX1, I can program and debug any chip in circuit as long as it can support the software and has a UART on board. This applies to most 18 pin PIC MCUs, like the 16F628,, 16F88, 16F84. The biggest problem I had was requiring a serial card in my computer and even that was not that traumatic.

                If I don't want to go the ICSP (in circuit serial programming) route i can program with MCS, compile (without debug) creating a Hex file to my computer. Then I program the chip in my MikroElektronika board using that hex file. If I use the MikroElektronika BASIC (or C) to program, then I can use the hardware Mikro debugger.

                Bottom line: for big programs or complex stuff, I use the LabX1 with 16F887 and compile with the software debugger. Then I can port over to a smaller chip.

                For small less complex programs, eg servo control, I use my Mikro board and program from the hex file created in MCS.

                I do it this way because I LOVE MCS, and I LOVE my Mikro board. So versatile and easy to use.

                Comment

                Working...
                X