19
Brookfield, Wisconsin, USA 262-797-0455 July 2004 Copyright © 2004 Custom Computer Services, Inc. All rights reserved worldwide. No part of this work may be reproduced or copied in any form by any means-electronic, graphic or mechanical, including photocopy- ing, recording, taping or information retrieval systems-without written permission. ICD DIAGNOSTICS

ICD DIAGNOSTICS - Alfaomegalibroweb.alfaomega.com.mx/book/778/free/data/Lecturas/ccs_icd_trblsht.pdfICD-U connect 8 troubleshooting Select CCS-ICD-U40 and click connect Does the device

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

  • 1

    Brookfield, Wisconsin, USA262-797-0455

    July 2004

    Copyright © 2004 Custom Computer Services, Inc.All rights reserved worldwide. No part of this work may be reproduced or copied inany form by any means-electronic, graphic or mechanical, including photocopy-ing, recording, taping or information retrieval systems-without written permission.

    ICD DIAGNOSTICS

  • 2

    MCLR - Connect to target PIC and pull up to +5V on target board with 47Kresistor. The ICD will drive this with 13V during chip programming. Nocapacitor is desired on MCLR or it would cause programming problemswith the ICD.

    The ICD does not use the Low Voltage Programming mode. C programs should set the NOLVPFuse.

    The target chip oscillator must be running for the ICD to work with a debugger. Programming can bedone without an oscillator.

    The B3 pin is optional and is not used for programming. However, the Monitor feature of thedebugger does use B3. It is possible to program and debug (without monitor) and allocate B3 tothe target hardware. In this case, do not connect B3 to the ICD connector. If the monitor feature isnot used, userstream can be disabled in the configure tab and the connection from 1-6 does notmatter. In the old version of the software, where you cannot disable the userstream using theconfigure tab, the pin needs to be pulled high at all time. Although B3 is recommend, any PIC pincan be used for this feature.

    4.

    5.

    6.

    To program and/or debug in circuit, two I/O pins (B6, B7) are reserved. If debugging is not to bedone, then these pins may also be used in the target circuit. However, take care to ensure thetarget circuit has high impedance during programming.

    3.

    Connecting the ICD to User Hardware

    ICD-U40 is powered by the USB.

    The ICD-S40 requires 50 mA. If the target power is not to be used, the connection from5-2 may be cut and an external 5V power supply can be used. This technique may alsobe used to power both the ICD and the target through the ICD connectors.

    1 2 3 4 5 6

    Notes:

    B3 on target PIC - This is optional, used for advanced debugging

    (ICSP clock) B6 on target PIC (See table on page 3 for exceptions)

    (ICSP data) B7 on target PIC (See table on page 3 for exceptions)

    GroundVdd from target to ICD. The ICD-S40 is powered by this pin (5V) and theICD-U40 uses it to pull up the signals (3V-5V).

    Target PinICDSocket

    TargetSocket

    1

    2

    3

    5

    6

    4

    1

    2

    3

    5

    6

    4

    1.

    2.

  • 3The In-Circuit Programming/Debugging Interface

    Note that the ICD to target cable reverses the pins so the MCLR signal is ICD pin 6 and connectsto the target pin 1.

    1 2 3 64 5

    The MCLR pin is used for programming and debugging. Note that during programming the voltageis 13V. The 47K resistor to 5V is sufficient isolation for the 13V. However, if anything else isconnected to the MCLR pin be sure that the 13V will not damage or interfere.

    7.

    PIC12F629PIC12F675PIC12F683PIC16F630PIC16F676PIC16F684PIC16F688

    PIC12F629PIC12F675PIC12F683PIC16F630PIC16F676PIC16F627APIC16F628APIC16F648APIC16F684PIC16F688

    Chip Instead of B6 Instead of B7GP1GP1GP1RA1RA1RA1RA1

    GP0GP0

    14141420202828282020

    ICD-Chip Pins

    GP0RA0RA0RA0RA0

    Chips that do not use B6, B7

    The following chips do NOT have debugging capability in the standard version of the part. A specific-ICD version of the chip is needed for debugging. The -ICD chip will have more pins.

  • 4

    ICDLEDOn

    Serialor

    USB

    Start ICDDiagnostics

    Does theICD control

    programwindowappear

    Serialor

    USB

    GotoICD-U connect

    page 8

    ICD is good

    No

    Goto ICD-SPower Page 5

    Serial

    Go to ICD-UPower Page 6

    USB

    Yes

    GotoICD-S connect

    page 7

    Serial

    Doestest ICD

    pass

    Doestest target

    pass

    Gototarget connect

    page 9

    Yes

    No

    No

    No

    USB

    Yes

    Exit PCWRun: ICD.EXE inc:\programfiles\PICC

    No

    Yes

    No

    Is there adebugging

    problem

    Goto PCWpage 11

    GotoTarget Connect

    page 9

    Yes

    Verify errorsduring programming Yes

  • 5ICD-S power

    troubleshooting

    Make sure targetto ICD cable is connected

    LEDon

    Do youhave

    a DMM

    Make sure 5V target is powered up

    Do youhave another

    Mod cable

    Unplug ICD andmeasure

    volatage on Mod jack

    Got5v

    Problem is targetboard or Mod cable

    Done

    ReplaceCable

    Contact CCS to get a replacement ICD

    Yes

    No

    Yes

    No

    No

    Yes

    YesNo

    Got5v

    Problem is targetboard or Mod cable

    Contact CCS to get a replacement ICD

    YesNo

  • 6

    ICD-U powertroubleshooting

    Make sure PC toICD Cable isconnected

    LEDon

    Is USBcable going

    to a Hub

    HUB may not bea powered HUB.

    Try bypassing the HUB

    ICD is probablybad.

    Contact CCS fora replacement.

    Done

    No

    Yes

    No

    Yes

  • 7ICD-S connecttroubleshooting

    page

    Done

    Go to devicemanager

    and make surethe

    COM port isworkingproperly

    IsCOM port

    good

    No

    Fix theCOM port

    Do any otherprograms

    use the sameCOM port

    Closethose

    programs

    Select correctCOM port and

    click connect on"START

    Connection"Window

    Use connectionchecklist on

    page 13

    Are you usingthe original PC-ICDcable, no adaptors

    or switch boxes

    Try theoriginal

    PC-ICD cablestraight in

    Target5V?

    ICD-S onlyworks with5V target

    YesNo

    Yes

    Yes

    Would youlike to try

    reprogrammingthe firmware

    Yes

    Contact CCSfor replacement

    No

    Contact CCS forfile and pinout

    No

    No

    No

    Yes

    Do you haveanother ICSP

    unit

    Can youmake a

    cable to mateinside the ICD

    No

    No

    Yes

    YesYes

    Doesthe ICD

    control programwindowappear

  • 8ICD-U connecttroubleshooting

    SelectCCS-ICD-U40

    and clickconnect

    Doesthe device

    manager showthe CCS ICS-U40

    in the USBlist

    ContactCCS

    for help

    Yes

    Does theICD control

    programwindow appear

    Done

    Go to page 15and get instructions

    on installing thedriver, and then

    install it and try again

    Yes

    No

    No

    No

    Fixthe

    USB

    Have youinstalledthe ICD-U

    driver

    Use connection Checklist on

    page 13

    Go to page14 to get

    instructionson

    checking thedevice

    managerUSB list

    Yes

    Would youlike to try

    reprogrammingthe firmware

    Contact CCSfor replacement

    Contact CCS forimage and pinout

    Do you haveanother ICSP

    unit

    Can youmake a

    cable to mateinside the ICD

    No

    No

    Yes

    YesNo

    Doesthe COM port

    box in the startconnection window

    showCCS ICD-U40

    No

    Yes

    Yes

    Is USBport

    working

    NoYes

  • 9Target connecttroubleshooting

    Do youhave another

    Mod cable

    Is the targetchip supported?

    Go to www.ccsinfo.com/icddevices.shtml

    and check

    Replace cable

    Make suretarget is

    powered up

    Testtarget

    Contact CCSfor adding

    support for the chip

    Do you havea differenttarget chip

    No

    Replacethe

    chip

    Yes

    No

    Fail

    Go throughconnection checklist

    page 13

    DonePass

    GotoHardware Test

    page 10

    No

    YesYes

  • 10HardwareTest

    Go toadvancedoptionswindow

    and clickPIC16 or PIC18interface and

    selectcontinuous, in

    the B6,B7section

    Do you have

    a DMM

    Got13V

    Contact CCSfor

    replacement

    Go to advancedoptions

    window andclick on PIC16

    or PIC18 interfaceand check VPP in the

    MCLR Section

    Measure thevoltage

    on MCLR pinon the Mod jack

    No

    Yes

    Contact CCSfor replacement

    No

    Do you have a Scope

    Yes

    Contact CCSfor

    replacement

    No

    Yes

    Do you get amix of goodand bad ID's

    No

    YesProblem may be noise on

    B6, B7. Check cablelength and Vdd. See

    scope diagrams on page12.

    Goto advancedoptions window

    and click PIC16 orPIC18 interface andselect continous inthe B6,B7 section.

    See scopediagrams on page

    12.

  • 11PCW debuggingtroubleshooting

    Cannotreset the

    target

    Cannothalt target

    issue

    Cannot Connect

    Yes

    IsB3 connected

    to ICDContact CCS

    for helpIs B3 usedfor monitor

    Any other issues

    No

    Yes Yes

    Go to configure taband disable monitor

    or pull B3 high

    NoNo

    Yes

    Contact CCSfor help

    Yes

    No

    Yes

    Make sure the targetoscillator is running

    and fuses in the#fuses directive

    match thetarget clock

    Monitor notworking

    No

    Connect B3to Mod jack

    and use#use RS232(DEBUGGER)

    in code

    No

    YesGo to

    Debug>Windows>Configuretab and select the correct

    interface serialor ICD

  • 12

    The top line is MCLR, and the bottom line is B6. The MCLRtakes less than 2us to reach 5V, and then increases to 13V. B6is a good low while MCLR rises.

    The top line is MCLR, and the bottom line is B6. Approximately40ms after MCLR goes to 13V, B6 toggles to 5V; the time mayvary depending on the PC.

    Scope Diagrams

    The top line is B7, and the bottom line is B6. This diagramshows activity approximately 81 ms after MCLR goes high.

  • 13

    The top line is B7 and the bottom line is B6. This diagramshows some of the more typical B6,B7 activity. MCLR is ata constant 13V, while the B6,B7 signals toggle from 0V to5V

    Scope Diagrams

    Connection Checklist

    MCLR has a 47K resistor to Vdd.

    Nothing else connected to MCLR except 47K and ICD (nocapacitor).

    B6, B7 are only connected to the ICD.

    No more than 12” of cable from B6, B7 and the ICD unit.

    Target Vdd is connected to the ICD, both ICD-S40 and ICD-U40require this.

    Note:Even if the above does not represent your final hardware, please start with thisuntil your unit is working.

  • 14Driver Checklist

    These instructions are for Windows XP. Other versions of Windows may have slightly different setupprocedures, although it will be similar enough that these directions will suffice.

    Right click on “My Computer” and select Properties.

    Select the Hardware tab and click on the Device Manager button.

  • 15Driver Checklist

    Expand the USB Controllers list.

    You should see a CCS ICD-U40 in the list.

    These steps explain how to install drivers in Windows 2000. Other versions of Windowsmay have slightly different setup procedures, although it will be similar enough that thesedirections will suffice.

    When you look in the Device Manager, you should see a CCS ICD or CCS ICD-U40 listedwith a question mark next to it. For example:

    How to Install the ICD-U

  • 16

    If you connect your ICD-U to the windows and do not see a CCS ICD or CCS-U40 in theDevice Manager with a question mark next to it, please contact CCS before proceding.

    Download the CCS ICD-U drivers, located here. Unzip this and download it intoC:\ICDUDRV\.

    Start the Add Hardware Wizard so you are at the following screen:

    1.

    2.

    You can bring up the Add Hardware Wizard by plugging in your ICD-U. Or go to the deviceManager, right click on CCS ICD-U (or CCS ICD-U40), choose properties, and press theReinstall Driver button.

    Press the Next button

    You will now see the following screen.3.

    How to Install the ICD-U

  • 17

    Make sure “Search for suitable driver for my device (recommended)” is selected and pressthe Next button.

    You will now see the following screen:

    Make sure only “Specify a Location” is selected. No other choices should be selected.

    Press the Next button.

    You will now see the following screen:

    How to Install the ICD-U

    4.

    5.

  • 18How to Install the ICD-U

    Use the browse button to enter C:\ICDUDRV\ into the location field.

    Press the Next button.

    You will now see the following screen:

    Press the Next button.

    You will now see the following screen:

    6.

    7.

  • 19How to Install the ICD-U

    When finished, you can delete the C:\ICDUDRV\. This is the folder where you un-zipped the driver files.

    Press the Finish button.

    Re-boot your PC if it asks you.

    When you go to the Device Manager, you should see the following:8.

    9.