The Godfather talking
You think I am funny guy huh?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 25, 2024, 06:51:37 18:51


Login with username, password and session length


Pages: [1]
Print
Author Topic: [Q]In circuit hardware debugger  (Read 4338 times)
0 Members and 1 Guest are viewing this topic.
biomed12
Junior Member
**
Offline Offline

Posts: 94

Thank You
-Given: 67
-Receive: 5


« on: April 13, 2017, 01:10:52 01:10 »

Hello,

I have a question about ICDs. I have an arm eval. board and it has an ICD. I have been using it for 4-5 months but, I have wondered short time ago the concept of ICD principles. I know the ICSP concept of PIC MCUs. Are ICDs same to it? Briefly, how it works?

Thanks.
Logged
Miss-Electro
Newbie
*
Offline Offline

Posts: 11

Thank You
-Given: 6
-Receive: 3


« Reply #1 on: April 13, 2017, 02:25:57 02:25 »

To be short, ICSP is used to program a uC while it's still connected to the application circuit.
ICD allows you to control firmware execution on your uC so that you can see how it performs on real hardware.
For example you can set break points in the code or read out memory and port values. An ICD can also animate the execution of code, power the application circuit, program the uC...
I think these are the main purposes of the two mentioned interfaces, but of course every constructor can implement additional features.
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 1002

Thank You
-Given: 231
-Receive: 983



« Reply #2 on: April 13, 2017, 01:29:56 13:29 »

As an aside. For some strange reason students often think their programmings skills are so good. That they do not have to use nor understand the concept of debugging. Some students can coast through a computer class. But barely know how to use the debugger tool at hands.
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
Miss-Electro
Newbie
*
Offline Offline

Posts: 11

Thank You
-Given: 6
-Receive: 3


« Reply #3 on: April 13, 2017, 02:39:58 14:39 »

As an aside. For some strange reason students often think their programmings skills are so good. That they do not have to use nor understand the concept of debugging. Some students can coast through a computer class. But barely know how to use the debugger tool at hands.

I totally agree, and from my experience programmers that use low astraction programming languages are more familiar using debuggers than the ones that use higher astraction languages.
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4668

Thank You
-Given: 834
-Receive: 4322


There is no evidence that I muted SoNsIvRi


« Reply #4 on: April 13, 2017, 10:11:28 22:11 »

We had in our works stores loads of ICD2 and other Programmers, no one ever used them. The most signed programmer out was the pickit2.
Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
zac
Active Member
***
Offline Offline

Posts: 147

Thank You
-Given: 81
-Receive: 57


« Reply #5 on: April 13, 2017, 10:32:19 22:32 »

Differences between the various microchip tools:

http://microchipdeveloper.com/faq:65
Logged
biomed12
Junior Member
**
Offline Offline

Posts: 94

Thank You
-Given: 67
-Receive: 5


« Reply #6 on: April 14, 2017, 02:35:29 02:35 »

To be short, ICSP is used to program a uC while it's still connected to the application circuit.
ICD allows you to control firmware execution on your uC so that you can see how it performs on real hardware.
For example you can set break points in the code or read out memory and port values. An ICD can also animate the execution of code, power the application circuit, program the uC...
I think these are the main purposes of the two mentioned interfaces, but of course every constructor can implement additional features.
As an aside. For some strange reason students often think their programmings skills are so good. That they do not have to use nor understand the concept of debugging. Some students can coast through a computer class. But barely know how to use the debugger tool at hands.
Differences between the various microchip tools:

http://microchipdeveloper.com/faq:65

Of course I know debugging and use it. I did not ask "how to debug or what is debugging or what are the advantages of debugging". I just wondered how ICD works at the hardware level. So as an example, in icsp, MCLR pin is pulled-down and hex data is sent over a pin. I wonder what is the concept of working of a debugger hardware.  
Logged
Miss-Electro
Newbie
*
Offline Offline

Posts: 11

Thank You
-Given: 6
-Receive: 3


« Reply #7 on: April 14, 2017, 03:37:28 15:37 »

Of course I know debugging and use it. I did not ask "how to debug or what is debugging or what are the advantages of debugging". I just wondered how ICD works at the hardware level. So as an example, in icsp, MCLR pin is pulled-down and hex data is sent over a pin. I wonder what is the concept of working of a debugger hardware. 

The concept? Maybe this will be of your interest...

The PIC16F877 was the first Microchip Microcontroller to have in-built debugging capabilities. The actual silicon area used for the debug facilities is tiny compared to the major peripherals. Microchip has keep the operation of the debug facilities pretty well under raps, however it doesn’t take much reading between the lines to work out how the actual debugging facilities are implemented.
The heart of the ICD is the breakpoint address register. This register is set with an address where you wish to break execution and examine the registers. When the Program Counter equals the Break Point Address, the PIC places the Program Counter Address on the Stack, as would happen with any interrupt and jumps to 0x1F00. This is the start of that all special debug code.
The debug code starts by preserving the Status Register, then moves down the chain making sure everything is recorded in it’s exact state when the break point occurred.
Now the question is, How to get the data into and out of the device?
We already know RB6 & RB7 are used for ICSP. The pin-out description names them as the In-Circuit Debugging pins as well as the Serial In-Circuit Programming Pins. Maybe there are additional ICSP commands for the debugger?
However to enter programming mode, we would have to reset the part and raise MCLR to VPP and after all wasn’t the ICD capability suppose to take minimal silicon? Why not simply synchronously bit bang the data in and out of the two pins using software support. This is what is actually done.
So forget the bit in the pin description about RB6 and RB7 being the In-Circuit Debugging Pins. They are in Microchip’s implementation of the ICD, but they are not set in concrete thus you could bit bang any two disused pins in your device. Not to say RB6 and RB7 aren’t the obvious choice as they are also used for in-circuit programming.
You could use the Asynchronous Serial Port to do such a task. You can all ready find bootstrap programs which read a program in on the serial port and burn it to portions of flash, then execute it. You could easily further this to include In-Circuit Debugging Capabilities without the need for a second control microcontroller or VPP programming voltages.
The next obvious question is how to set the Break Point Register? My guess would have been though the in-circuit programming protocol but as already discussed, this is not the case. It must be set from with in the program/execution environment.
Leisurely readying the ICD manual, you rellies two things. (a) you must leave the first program location as a NOP and (b) the processor breaks only after the instruction is executed. Put two and two together, and assuming the power on reset value of most registers is Zero, you could guess that on Power Up, the processor executes the NOP, then a break point interrupt occurs and execution jumps to the debug code at 0x1F00. . . . A reasonable assumption.
Now, if the program must write to the breakpoint address register, where is it?
Unimplemented data memory locations which read as ‘0’ is probably not much use, thus leaving two “Reserved” registers at 0x18Eh and 0x18Fh. Too easy? It is.
So what looks like a quite a little complicated debugging facility is nothing more than a breakpoint address register, a comparator and interrupt.

Source: http://wearcam.org/seatsale/programs/www.beyondlogic.org/pic/icd.htm
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC