11 Replies Latest reply on Jan 2, 2014 6:33 PM by racullin

    keep on destroying atmega328 on gertduino why?

    racullin

      I have a rfm12b connected to the gertduino (gert)   spi port   all goes well till I reprogram the gert from the raspi arduino ide (upload via programmer style)  with the rfm12 insitu  :- poof dead 328

      ok silly me the common  ss for the rfm12 and the gpio isp will probably make the devices clash , next try isolate the  the rfm12 ss pin and let it float high , no good another 328 bites the dust.

      so next I isolate the rfm12 so pin as well , guess what another 328 in the bin , in short I can only reprogram the gert with the 4 spi pins totally isolated. for someone used to the pic/arduino environment

      this is very annoying and severely limits the usefulness of a gertduino , does this make pins 10-13 unusable in reality when used on a pi  ?  does this mean

      is it possible to put a bootloader on the gert and program it normally ?

        • Re: keep on destroying atmega328 on gertduino why?
          racullin

          meant to say does this mean pins 10 to 13 are really unusable on a gertduino  on a pi ?  if so the whole   gert/pi  setup  is rather  pointless if you want to use spi devices

            • Re: keep on destroying atmega328 on gertduino why?
              shabaz

              Hi Richard,

               

              I must admit, I didn't realise this difference between a normal Arduino Uno and the Gertduino, but looking at the schematics for both, it seems that while the Arduino Uno usually uses the RXD/TXD pins for dounloading programs into the chip, the Gertduino uses the SPI interface.

               

              Basically, an Arduino Uno is an ATmega chip with a special program running on it. That program is initially programmed into the ATmega via the SPI interface, because that is the only way available due to the i.c. implementation. As far as I understand, all subsequent user programs use the RXD/TXD pins, because the special program is designed to use the RXD/TXD pins. In normal programming use the SPI pins are not taken over by the board.

               

              With the Gertduino, I think this special program does not run, and so all user programs are downloaded via the SPI interface. (I'd like someone else to confirm this, I may have misread the schematics, I'm not too knowledgeable on the Gertduino). This has ups and downs. The advantage is that space is not used up on the special program, so in theory user programs can be bigger (I'm guessing, I have not tried this). The downside is that the behavior is different to the Arduino Uno as you have observed, and should be documented (I'm guessing it is, I have not checked, but perhaps needs to be highlighted more in the documentation).

               

              If you don't want to keep disconnecting your hardware while programming the Gertduino, then as an experiment you could try to place 1k resistors in series with the SPI connections. It may not work, I honestly have no idea, but it is worth trying as an experiment, and it shouldn't destroy anything in theory, but I can't be 100% sure.

                • Re: keep on destroying atmega328 on gertduino why?
                  racullin

                  the si and sck inputs have 4k7 series resistors and the so and ss lines are disconnected , the 328 still gets bricked .

                  I think the gpio 3v logic levels are so marginal to the 5v 328 that any load on the spi I/f pins at all causes a failed upload , why this bricks the 328 is a total mystery to me

                    • Re: keep on destroying atmega328 on gertduino why?
                      shabaz

                      I see. I wonder if it is a config reg related thing (it's been so long since I've used an ATmega, I can't recall how this worked exactly). The Gertduino has an external crystal, I'm wondering if it is possible to corrupt the config reg setting through using marginal logic levels maybe? and if it impacts the ability to program it at a certain frequency,

                      This is just stabbing in the dark though, I really don't know the ATmega programming well enough any more to be sure, but may be worth investigating if you have a separate AVR programmer (like AVR-ISP) by any chance, just to confirm 100% that the ATmega is really totally dead or needs config reg reprogramming.

                        • Re: keep on destroying atmega328 on gertduino why?
                          racullin

                          it could be that but,

                          The avrdude setup script (supplied by gert) will no longer recognise the chip signature (new chips are fine) , I have a usbtiny  programmer also and the chip does not respond according to it ,

                          have tried the chips  on a proto board   with no xtal , 4mhz xtal , 8mhs xtal  ,16 MHz xtal ,(a new 328 works with any of these)

                          I conclude the  the chips are bricked , I don't know why

                            • Re: keep on destroying atmega328 on gertduino why?
                              shabaz

                              I wonder if anyone with a spare ATmega they don't mind destroying could try to replicate without any external hardware, apart from 4.7k load resistors. I suppose the official answer might be to remove the load, but at least if it is easy to replicate then maybe you could ask Gert if he doesn't mind replicating, or to get it added to the documentation that there is a risk of permanent failure if there is any load present. I don't want to ask you to keep destroying ATmega's though just for the sake of research :-( A scope would also reveal the logic levels while programming but I don't know if you have access to that.