PDA

View Full Version : debugger??



MARAD75
- 11th January 2008, 17:22
Hi everyone!
After many years of struggling, I have been able to get fairly proficient at structuring code so it works. (usually) What I have the most problems with is getting timing right when using several while/wend statements, pauses, etc, if they are interrelated. For instance, I have a large program that works ok. But if I knew how to change timing and delays and could "see" what is going on it its execution, I could fine tune it to work better.

I have never been hard pressed to learn how to use debuggers, etc!

I am using Microcode Studio Plus, Mplab and a Picstart + with latest firmware upgrade.
Can anyone suggest where I can get info on debuggers and how to use them? Or, if there is something better than debuggers I would like to hear about it.
Help would be appreciated!
Thanks,
Ron

duncan303
- 11th January 2008, 19:32
Hi Ron

Personally I treat Debugging and Timing as two completely independent processes, Debugging interferes with timing especially if you are using ICD as with MCSP even if you enable/disable sections.
Debug
Did you mean you do or do not use the ICD feature in MCSP

Timing
For me I choose a pin that is not being used for the routine i am interested in timing and toggle it, then capture the output on a scope or analyser, maybe also there is something that could be hooked up to a sound card. This for me is the only way I have found to accurately "see" timing.

Duncan

MARAD75
- 12th January 2008, 13:47
Hi Duncan'
Believe it or not, I have never learned how to use an ICD. Also, I don't even know if it is in the MPLAB IDE I'm using or how to get started with it. Certain aspects of the code I am working on use pauses, which seem to interfere with each other occasionally. I would use the ICD to look at the lines of code to spot problems that I can't do now, if that is how it works! They're not really "timing" problems but have to do with external pushbuttons working with while/wend statements that have various length pauses in them. Suggestions on how to start using the ICD (if there is one) would be welcome!
Thanks,
Ron
PS I am using ver. 7.60 of MPLAB IDE. In the past, I have found the help files with this program somewhat "unhelpful". Is there a separate program I could use to look at the code line by line?

duncan303
- 12th January 2008, 15:18
Hi Ron

Have a look at the Help pages in your copy of Microcode Studio Plus, it will tell you everything you need to know to get started using the In Circuit Debugger (ICD).

I do not have a PICSTART board so I am unable to say if it is easily connected to MCSP ICD. Maybe others who have used both MCSP and MPLAB as an ICD can say which is easier to get started, at a guess I would say Microcode Studio Plus,
whichever method you choose I would say that it is very much worth the effort.

Duncan

mister_e
- 14th January 2008, 17:16
PicStart is just a programmer, has nothing to do with MCS ICD. And PICStart can't be launched within MCSP either (Ok there's a known patch but it doesn't work for all PIC)

MCSP ICD tutorial? yeah, go over there
http://www.rentron.com/PicBasic/MCS_X3.htm

Now you could still Buy PICKIKT 2, nice replacement for PICStart, Can be launch from MCS, compatible with MPLAB + may work as ICD... even if pretty slow ~50$.

duncan303
- 16th January 2008, 14:46
It was not my intention to mislead with regard to the PICSTART . I just thought it might be worth looking at to see if one could get access to RX/TX pins at TTL levels.

In my defence, I had a very quick glance at the PICSTART package and understood it as a development system, together with the fact that the MPLAB IDE download is free, I guessed there must be something more that you get for your 300USD. I accept that the MELABS programmer does not have an independent MAX232, but I do also have Atmel programmers which have a MAX RS232/TTL converter built on; take the target device out and hook up with a couple of crock clips and one could have the MCSP ICD up and running pretty quickly. Ideal for a Sunday afternoon play about.

I have absolutely no idea what is inside the PICSTART + hardware, because I do not have one, maybe it was worth a look though. I do accept from what has been said that it is not designed to be used in this way.

As the Data and Clock lines of the ICSP whilst programming are at TTL levels maybe it is possible to get access to TX/RX with a MeLaBs serial programmer.

However ideally for me it was best to build Hardware units based upon the MCSP help pages and on the excellent RENTRON site kindly provided by Bruce Reynolds ( I have read it many many times. Thankyou very much indeed Mr Reynolds :D )

Rgrds

Duncan


Just trying to share a hobby :)

MARAD75
- 18th January 2008, 21:05
Hi Duncan,
Hi Steve,
I have used the Picstart + for many years and it works well with MPLAB and so far has been very reliable. I have the latest flash in it which allows me to program just about anything in the PIC line.
I did find out though, that the chip I am using cannot use the debug routine. (12F629), so I guess I'm dead with that issue.
Most of the time/pause length issues are settled anyway!
I appreciate all your help though.
Thanks,
Ron