On Sun, 2006-10-22 at 23:27 -0400, Xiaofan Chen wrote: > On 10/22/06, Herbert Graf wrote: > > On Sun, 2006-10-22 at 17:04 -0400, Xiaofan Chen wrote: > > > ICD2 is relatively cheap as well but it is really painful to use for > > > bigger Microchip MCUs like dsPIC33F/PIC24. > > > > Define "painful"? I have never noticed much of a speed difference in the > > usage of the ICD2 when dealing with large dsPIC parts, or small 12F > > parts. Yes, if you don't do things wisely (like leaving tons of watch > > windows open, or the whole SFR window open) then the larger parts WILL > > be slower in use since there's just so much more to update. > > > > I have a feeling most people don't realize how the ICD2 works, and > > simply blame the bigger parts as being "slower" then the smaller parts > > with using the ICD2. > > I am not that experienced with large PIC parts. But I have tried the > Explorer 16 demo board with ICD2. Without doing much, just stepping > through the code was very slow. I do not think I was doing stupid > things then but I will check again once I am back in Singapore. Single stepping IS slow, especially when dealing with HLLs since one line of code rarely corresponds to one op code, which is how the ICD2 operates in single stepping mode. Since using an HLL is a much larger possibility with "bigger" parts, people think the bigger parts are "slower" since each line of code takes longer. Even without any watch windows, since stepping will be relatively slow with the ICD2, regardless of what PIC you are using. That said, the solution is simple: don't single step. I have rarely needed to extensively single step any of my code. Yes, from time to time, when I've narrowed down the location of a problem I will single step a few lines, but that's about it. Breakpoints are MUCH more effective at narrowing down where a problem comes from, ignoring the speed advantage. In fact, when dealing with an HLL I'd recommend you never single step. Simply set the breakpoint at the next line. The result will be MUCH faster operation since the PIC will be allowed to run whatever it needs to to get to that line. For example, if you have a software division happening, the single step will cause the PIC to execute each op code of the division one at a time, at each step reporting back to the ICD2, with the ICD2 telling it to "keep going". If, OTOH, you set a break point at the next line, the ICD2 will instruct the PIC to break when the PC reaches the first op code of that line. There could be hundreds of steps between those two lines, but there will only be one "ICD2->go PIC, PIC->I'm done" transaction. > Maybe I am biased but I never think ICD2 is a good debugger. Of the debuggers I've used (which I admit isn't that extensive) the ICD2 is an excellent value for the money. It's not perfect. It has quite a few limitations. And it can be cranky (more so because of the crap Windows does sometimes then the actual hardware). But once you know how to PROPERLY use it, the ICD2 is a VERY effective tool, and WELL worth the money. Of the debuggers I have used, it has had the steepest learning curve (because of the quirks) but is the most effective. > As > a programmer, it is even worse. Well, as a programmer it also has limitations, but then, it was never meant to be a programmer. As such, it's pretty damn good. Device support is AMAZING. I used to continuously worry whether a new part would be supported by the programmer I was using that day. With the ICD2 I've stopped worrying. Yes, it has some VERY annoying limitations on smaller parts (i.e. no internal MCLR on the 12F675. Actually it warns and warns about that, but it still seems to program without a problem), and it holds the ICDCLK and ICDDAT lines for no good reason, but hey, it's meant to be a debugger, NOT a programmer. Personally, out of all the dev tools I've used, for chips varying from CPLDs, to FPGAs, to MCUs, the ICD2 has been the most useful to me. TTYL -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist