Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:20 09 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PIC debugger

Author Message
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 09:04am 27 May 2013
Copy link to clipboard 
Print this post

Hello

Thank you for your help with the PicKit3 - I can now program and make my LED flash

PIC debugger - what is it and what can it do for me ?

- Andrew -
Andrew Rich VK4TEC
www.tech-software.net
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 1211
Posted: 12:29am 28 May 2013
Copy link to clipboard 
Print this post

Hi Andrew,
A quick FRUUUUUUUgle found this and this and this.


Ok it aint for pic32's but you ask about debuggers....
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 08:12pm 28 May 2013
Copy link to clipboard 
Print this post

Personally, I wouldn't worry about debuggers until you are fully proficient with PIC programming (unless you already are).

Keep to small blocks of code that are easily visually debuggable.

What I used to do with my home grown assembler/programmer was to hook up a led display to the i2c pins and have a small routine that always worked and move it around the programme to ascertain where the programme was up to and display data accordingly. Alternatively, something similar with a bank or one or two leds to indicate where in the programme you are.

I'm sure the help section in MPLAB will have a section on debuggers - have you looked there?
David M.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3674
Posted: 09:21pm 28 May 2013
Copy link to clipboard 
Print this post

The better ones let you debug at the level you wrote the code (so, C if you wrote in C) and also let you drop down levels (to ASM with C) if you wish. They let you single step or breakpoint at any function or line number. You can examine program variables by name, including things on the stack. You can peek/poke memory (or I/O). You can watch where your program is in the actual source code. You can intercept interrupts (but may upset the target device). They'll disassemble if you wish. And so on.

However, good though they can be they're arguably no substitute for writing code carefully in the first place so that it will work and thus need no (or almost no) debugging. It depends how you like to go about writing code.

Many CPUs have JTAG and can allow software via a hardware debugger to get right at the internals of the CPU. An example is OpenOCD. It can also read/write flash or EEPROM etc if set up right. Some people like to use it with Eclipse & gdb.

JohnEdited by JohnS 2013-05-30
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 11:21pm 28 May 2013
Copy link to clipboard 
Print this post

Sorry I think my question was off the mark.

I am fluent with the 16F628A and 16F877

I have done bit/byte operations, LCD, GPS, A/D D/A Comparator. Maths, Interrupts. USART etc etc

I got back into PIC's to try and understand a bit more.

I made things like GPS trackers and GPS LCD displays.

I was more after a high level decsription.

I am familiar with break points.

Does the debugger get any info from the PIC ? of is more like a fancy "step through"

I have only done "dump the code and run" before.

- Andrew -
Andrew Rich VK4TEC
www.tech-software.net
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 12:24am 29 May 2013
Copy link to clipboard 
Print this post

  Quote  Does the debugger get any info from the PIC ? of is more like a fancy "step through"


The pickit 3 has jtag facilities which allows data to be read back from the pic to the pc via the jtag device. I've never had to use it although once or twice it could have come in handy. You can also debug your programme using a simulator where the code is run outside of the pic.

It looks from your history and abilities that pretty expert at using pics already.

I'm not sure what more you are seeking.


David M.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3674
Posted: 03:34am 29 May 2013
Copy link to clipboard 
Print this post

With a proper debugger of the types mentioned you can get anything at all. You can change anything, too (subject to it being connected in the hardware!).

E.g. in OpenOCD you can set up external chips (flash or whatever) and program them, as well as accessing the CPU(s).

John
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024