Homemade arduino troubles

I have designed my own homemade arduino and I am following this tutorial here

The only thing I have changed is the reset pin in the avrdude.conf to pin 8 for a nice grouping of wires

I have also changed the led to pin 7.

The arduino shows up when I run the

sudo avrdude -c linuxgpio -p atmega328p -v

I would prefer to be able to upload code via the second method but I have tried both and both times I get no led ouput the Led is functional as I have tested it.

Any Ideas why there is no LED output?

PS @gadgetoid I did try your tutorial at pi.gadgetoid.com but I could not get it working!

So you’re able to upload code to the AVR, but not determine if it’s actually running?

Cripes it’s been a heck of a long time since I last hooked up an AVR to a Pi!

I would post a picture of the setup - I presume you have an ATmega on a breadboard but without seeing what possible wiring issue there might be it is hard to tell whether that is the culprit, or some software issue on the Pi side.

what commands are you running specifically and what is the output?

I am soldered up on perfboard but that is not the problem as I have redone the solder joints multiple times

@gadgetoid you are correct

have you tried dumping your AVR flash back to file? can you measure any voltage at the AVR leg as the code is (presumably) running? and are you sure you wired the led in the right place, referring to:

… you should see voltage variation at physical pin 13 if I followed your initial report. If not then I’d expect there is no code on the chip (or at least not what you intend it to be).

I still need to get myself a multimeter it is what I am currently saving up for.

I am currently working on a fritzing diagram to show the setup.

Do you think the changed reset pin is having an effect I did change it in the file

There you go

EDIT: the led ground should be going to the ground rail (it is in real life!)

  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 7;

// the setup routine runs once when you press reset:
void setup() {
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second

Here is also the code I am trying to run

hum, is that all you have on your protoboard? without any capacitors I don’t think your clock can work… since you have a crystal in your diagram I would assume your intend is to use an external clock and that is how your bootloader was configured?

The guide does not say you need caps and @gadgetoid picoduino guide on pi.gadgetoid.com seems to work for him without caps

I am just following the guide so I am unaware of anything to do with the bootloader.

Also on a side note I you have a spare moment would you be able to check I have resized the picture correctly on my pinout.xyz pull request on the sixfab boards. If it is correct I can move on to resizing the others

Oh and another thing I changed which probably is nothing to do with the problem is

./configure – -enable-linuxgpio

as in the tutorial to

./configure --enable-linuxgpio

as the first one spit out errors and I think it was just a typo on the tutorial creators behalf

I think yes, in principle , it’s correct, you can dispense with the caps, but one of the reason to have them in is to make sure the avr is reliable… if yours is crashing continuously it may never get as far as running your code.

So, one option would be to swap the crystal for another, just in case that one is particularly touchy. But if you got it soldered in place it will be difficult.

did you use a socket to sit the IC? if so take it out and try to get things working on a breadboard, until you are happy all is functional… this will allow you to try with extra components first, then remove them and ensure all still works.

In short sightedness I presumed it would work so I did not use an IC socket. I also did not have one to hand at the time

I also do not have another crystal to hand at the moment but I could easily get another one.

I had it all working on a breadboard a few months ago so I presumed it would work once soldered although I think I may have comunicated with it differently.

I do have a couple of caps around is there any place I could add them in.

Generally speaking, IC can be prone to heat damage when they find themselves at the end of a hot tip… best IMO not to risk it.

That said, if you are able to program it, seemingly without errors, then my guess would be that the chip is fine.

FWIW, I was able to program a Uno following the tutorial you refer to, using the manual method of compiling a ‘blink’, so it seems to work as described. I used the reset on bcm8 to be as close to your setup on the Pi side.

… I’m going to dig my AVR ‘shrimp’ and see if I can get it alive, though I’ll have to do some mods to bypass the caps, so I can test something as similar to your barebone AVR.

works for me here with caps in place… I have another setup I can try which I had done specifically to test with the 8MHz internal clock, which I believe I can mod to use an external 16MHz crystal.

what value caps should I use and where should I put them within the circuit?

hum… interesting, I have the opposite issue, I have a working ‘blinkt’ without caps, but the pace of it is totally wrong, pointing indeed at a clock malfunction. But still, in theory I have the same setup as yours without caps, so not sure adding some will make a difference for you.

But anyhow, here’s the version with protection/clock stabilisers:


the important caps, in term of clock reliability, are those connected to the crystal, the others are not necessary (though they provide added protection).

interestingly I have two ATmega328p chips here, one of them respects the external clock and the other does not.

I am merely swapping the chip on a DIP socket and flashing the same program so in respect to the circuit they are exactly the same (and equal to your Fritzing diagram), including crystal… very very strange…

I added the two caps that go to ground from the crystal and uploaded the script again and there was no result.

I have even tried the pin the led is on

Do you think it is a problem with the chip or maybe the crystal.

I am fairly certain the soldering is good because the first thing I tried was reflowing and redoing any dodgy joints.