Author Topic: arduino PCB debugging and programming  (Read 3200 times)

0 Members and 1 Guest are viewing this topic.

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 762
  • Country: gb
arduino PCB debugging and programming
« on: May 06, 2019, 02:40:49 am »
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.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 2924
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: arduino PCB debugging and programming
« Reply #1 on: May 06, 2019, 07:38:12 am »
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











~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 762
  • Country: gb
Re: arduino PCB debugging and programming
« Reply #2 on: May 06, 2019, 12:59:45 pm »
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.
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 762
  • Country: gb
Re: arduino PCB debugging and programming
« Reply #3 on: May 06, 2019, 05:34:21 pm »
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  :-//
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf