Hello to everyone, I have a very special project to make and I very much like your assistance on it.
- I know, I know it SOUNDS fancy and problematic. But I thought on the principle of operation of such device and is NOT that BAD as it sounds. So please Read my IDEA and I KNOW we can make it !
The history and context:
- I am coming right now from PIC forums, and there, I discussed a lot of things, and between them was the subject of "How to debug" a PIC12F508? And I got the typical nope, its too complex and unreachable for you. They will not easily give away some very important tool like a hardwae-debugger circuit anyway. In the same time I was intrigued by how Well one user there, was able to code the PICs, especially my old PIC, especially on some very delicate code problems like Very precise timing calculation.
q12: "- How do you debug your code lines?" Answer:" I have a prototype board made and connected to an emulator or a debugger. Usually I know what my code will do when I wrote them; so the board and emulator/debugger are just to test, debug and modify the code as needed. I don't use test LEDs much, as I prefer to use an oscilloscope; for digital signals, a logic analyzer will help." He said is making the code in his head first, or with pen and paper, and I really admire such skill, but for a dude like me, I think is easier using a serious debugger, hardware type, not software. Their software debugger is too advanced and too cryptic !!! Thats another reason why I have to "invent" such a hardware device myself. They actually told me to: "be ingenious and find a way", and in a sense, I totally agree with them.
This is one of their official recommendation: "... In-Circuit-Debug tool for the PIC12F508 the AC162059 debug adapter is required"...
These are some pictures of the AC162059 device from internet.
Another of their comments that made me think on a different solution: "Microchip has disconnected the AC162059 product. Some old stock may be available but it is expensive."
So this is how this device works: "When choose "debugging" and start a debug session your program is "programmed" to the PIC alongside some extra code, known as the "debug executive". Is this "debug executive" that works with the hardware special debug resources and "talks" with MPLAB software to allow the debugging operations. The presence of this extra code means your own program cannot run by itself. Is also this "debug executive" that uses the "reserved resources" listed for each PIC and debugging tool." I dont like it this way, at all.
Step1:
- I did think on this problem some time and I believe I find a solution, at least the logical dots I can connect and create my own Universal Hardware Debugging Board for PICs !!!
Some time ago, I build this Programer Test Board. It is mostly composed of many wires!!! Really, that's all there is to it. that are hooked to the pickit2 programmer (the BLACK box), and to the actual PIC12F508 there in the image with a green paper on it. I also added smd leds and a button to test the programmed PIC. This little circuit I made and already used very successfully, is a very nice alternative for the original test board that I used as reference, it's official name, google for "PIC Demo Board" (is this big green board)
Step2:
Usually, my 12F508 runs from it's internal 4Mhz RC oscillator option, but it can be connected from an external clock with different frequency. I know for certain, that we can use PICs at very low clock cycle ! What it means, is PIC can run it's program one instruction per 1 second if I hook it to a 1second pulse beating circuit.
In other words, I have to set the PIC to an external oscilator from it's internal registers code, and literally link its pins to this external oscilator that happens to variate its frequency from a potentiometer.
Step3:
I believe the guys on MIcrochip are VERY smart. I also believe their hardware debugger AC162059 is -one possible variant- of debugging a PIC. I think there are easier ways of debugging a PIC and more universal and more intuitive.
My plan is to make a similar board like my"test board", but with some extra hardware around it. That hardware will BASICALLY slow down the beating cycles of the chip code, in other words, the chip will run its code at a lower speed.
I believe it all comes down to a potentiometer on that board that will delay the pulses to as much as 1 pulse per 1 second. That's my plan.
This is the whole idea of this Universal Hardware Debugging Board for PICs.
Technical problems to resolve:
1- a pulse generator that can be adjusted by a potentiometer to pulse up to 4Mhz.
2- a step by step button that is linked to the pulse generator, and when I press the button, the pulse generator pulses 1 time and waits for another button press. The button is not linked to the PIC, but to the pulse generator. Ok?
3- a reset button to reset the entire chip program to start over again, and I think this is as simple as cutting the power of the PIC and power it again, and its code will be reset to Start. This might be a simple task like that. I'm not completely sure...
4- I also want the pulse generator to be switched to 8Mhz and 12Mhz. I believe every PIC is "safely" set to 4Mhz but in reality it can run at much more higher speed than it's official specifications. It's a personal impression, so I have to test this theory.
5- Im open to any other debug suggestions you may have.
- Can you assist me with it?
As always, thank you !
- I know, I know it SOUNDS fancy and problematic. But I thought on the principle of operation of such device and is NOT that BAD as it sounds. So please Read my IDEA and I KNOW we can make it !
The history and context:
- I am coming right now from PIC forums, and there, I discussed a lot of things, and between them was the subject of "How to debug" a PIC12F508? And I got the typical nope, its too complex and unreachable for you. They will not easily give away some very important tool like a hardwae-debugger circuit anyway. In the same time I was intrigued by how Well one user there, was able to code the PICs, especially my old PIC, especially on some very delicate code problems like Very precise timing calculation.
q12: "- How do you debug your code lines?" Answer:" I have a prototype board made and connected to an emulator or a debugger. Usually I know what my code will do when I wrote them; so the board and emulator/debugger are just to test, debug and modify the code as needed. I don't use test LEDs much, as I prefer to use an oscilloscope; for digital signals, a logic analyzer will help." He said is making the code in his head first, or with pen and paper, and I really admire such skill, but for a dude like me, I think is easier using a serious debugger, hardware type, not software. Their software debugger is too advanced and too cryptic !!! Thats another reason why I have to "invent" such a hardware device myself. They actually told me to: "be ingenious and find a way", and in a sense, I totally agree with them.
This is one of their official recommendation: "... In-Circuit-Debug tool for the PIC12F508 the AC162059 debug adapter is required"...
These are some pictures of the AC162059 device from internet.
Another of their comments that made me think on a different solution: "Microchip has disconnected the AC162059 product. Some old stock may be available but it is expensive."
So this is how this device works: "When choose "debugging" and start a debug session your program is "programmed" to the PIC alongside some extra code, known as the "debug executive". Is this "debug executive" that works with the hardware special debug resources and "talks" with MPLAB software to allow the debugging operations. The presence of this extra code means your own program cannot run by itself. Is also this "debug executive" that uses the "reserved resources" listed for each PIC and debugging tool." I dont like it this way, at all.
Step1:
- I did think on this problem some time and I believe I find a solution, at least the logical dots I can connect and create my own Universal Hardware Debugging Board for PICs !!!
Some time ago, I build this Programer Test Board. It is mostly composed of many wires!!! Really, that's all there is to it. that are hooked to the pickit2 programmer (the BLACK box), and to the actual PIC12F508 there in the image with a green paper on it. I also added smd leds and a button to test the programmed PIC. This little circuit I made and already used very successfully, is a very nice alternative for the original test board that I used as reference, it's official name, google for "PIC Demo Board" (is this big green board)
Step2:
Usually, my 12F508 runs from it's internal 4Mhz RC oscillator option, but it can be connected from an external clock with different frequency. I know for certain, that we can use PICs at very low clock cycle ! What it means, is PIC can run it's program one instruction per 1 second if I hook it to a 1second pulse beating circuit.
In other words, I have to set the PIC to an external oscilator from it's internal registers code, and literally link its pins to this external oscilator that happens to variate its frequency from a potentiometer.
Step3:
I believe the guys on MIcrochip are VERY smart. I also believe their hardware debugger AC162059 is -one possible variant- of debugging a PIC. I think there are easier ways of debugging a PIC and more universal and more intuitive.
My plan is to make a similar board like my"test board", but with some extra hardware around it. That hardware will BASICALLY slow down the beating cycles of the chip code, in other words, the chip will run its code at a lower speed.
I believe it all comes down to a potentiometer on that board that will delay the pulses to as much as 1 pulse per 1 second. That's my plan.
This is the whole idea of this Universal Hardware Debugging Board for PICs.
Technical problems to resolve:
1- a pulse generator that can be adjusted by a potentiometer to pulse up to 4Mhz.
2- a step by step button that is linked to the pulse generator, and when I press the button, the pulse generator pulses 1 time and waits for another button press. The button is not linked to the PIC, but to the pulse generator. Ok?
3- a reset button to reset the entire chip program to start over again, and I think this is as simple as cutting the power of the PIC and power it again, and its code will be reset to Start. This might be a simple task like that. I'm not completely sure...
4- I also want the pulse generator to be switched to 8Mhz and 12Mhz. I believe every PIC is "safely" set to 4Mhz but in reality it can run at much more higher speed than it's official specifications. It's a personal impression, so I have to test this theory.
5- Im open to any other debug suggestions you may have.
- Can you assist me with it?
As always, thank you !
Last edited: