Products > Embedded Computing

arduino PCB debugging and programming

(1/1)

OM222O:
For a project I've designed a PCB using the atmega-328p chip. I have exposed probe points on the PCB so I can test for shorts , voltage levels etc using a jig and another atmega328-p on a jig.

I also know that the atmega328-p can be programmed to act as a programmer itself and if I can use one chip to both program the MCU in circuit AND do the debugging it would be a lot faster and more convenient than what I'm doing right now: using a QFP to DIP socket, programming the chips one by one and then soldering them on the final product. I'm just not sure if altering the code of the "Arduino as ISP" which makes it able to burn boot loader and program another chip, will cause some sort of errors ... I suppose I can have 2 jigs: one for programming and one for debugging but it would be great if I can just use one to speed up the process.
If you know how the "Arduino as ISP" sketch works or if I can modify it without breaking it, please let me know. I tried going through the code but it's very long and I'm not really sure what a lot of the lines do.

sleemanj:
The ISP protocol is defined by AVR910, in consultation with the datasheet of course.

Long ago I wrote an Arduino library to program other AVR chips over ISP, I never really cleaned it up but it should still work, I've pushed it to github and you can see a couple of untested off-the-cuff examples of usage in the README

https://github.com/sleemanj/ArduinoProgrammer











OM222O:
I'm using the ISP code that is provided by the arduino IDE itself. I was just wondering if changing the code to do other things will interfere with that code as I don't really understand what the ISP code does.

OM222O:
Also another thing that I'm worried about is when setting nets to +5V, there might be chance to apply a reverse voltage on some of the capacitors. I have never had one blow up before, but is it something I should be worried about? for example if a net is shorted to ground, it will pull ground to +5v (since the circuit itself is not powered on) and the 5v line is floating (could be floating at 0v), it can put -5v on the input bypass capacitor and I know that anything more than -1v on a polar capacitor will damage it  :-//

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod