Hi, I've used ATMEGA on a breadboard successfully several times already for bootloading new chips and developing projects before soldering on to strip boards. However, I cannot get my latest project to work at all. Using an UNO and SD shield plugged directly together I have had them successfully logging GPS sentences feeding in to ARDUINO pin 8 (ATMEGA pin 14). I have separated the shield from the UNO and used flying leads to confirm what is required and my project works with just the 2 power leads and ARDUINO pins 10, 11, 12, 13 (ATMEGA 328 pins 16, 17, 18, 19). To keep things simple, my aim is to have the ATMEGA on breadboard with data coming from the GPS and leads going to the shield since the shield manages voltage levels for the card.
The problem I have is that even though I'm using a breadboard configuration that I know works (http://www.fiz-ix.com/2012/11/schematic ... d-arduino/ minus the LED and resistor from D13) the shield does not even create a logging file let alone any logging data. I have checked the GPS feed and it is good. Any ideas or suggestions would be much appreciated, thank you.
Breadboard ATMEGA 328 and SD shield
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Breadboard ATMEGA 328 and SD shield
Could you post clear pictures of your board and the connections to it so we can see where you have it connected? Also post your code with the modifications you've made. That will help us look for a problem. Are you using the bootloader or programming a bare 328?
- Classic123
- Posts: 13
- Joined: Fri Aug 29, 2014 1:44 pm
Re: Breadboard ATMEGA 328 and SD shield
Hi, I'm using bootloaded 328 PU. I have checked that it works in the UNO board. Photo 1 shows the SD shell separated from teh UNO board. I did this to prove what connections were necessary to maintain functionality. The sample logger file I uploaded was made in this configuration i.e it works. The next step is to breadboard the 328, I used a set up I have already had success with and have checked the pinout to the microcontroller has been 'translated in accordance with the UNO pinout diagram http://forum.arduino.cc/index.php/topic,146315.0.html. So, Uno pin 8 to MEGA 14, UNO pins 10-13 to MEGA pins 16-19. However, this setup does not create a logger file or anything. I will add the script on the next post as I'm limited to 3 files pre post. I would appreciate any advice.
- Attachments
-
- GPSLOG00.TXT
- Example logger file
- (365 Bytes) Downloaded 32 times
-
- Photo of unsuccessful ATMEGA 328 PU breadboard
- Photo 2.JPG (256.85 KiB) Viewed 727 times
-
- Photo of successful separation of SD shell from UNO
- Photo 1.JPG (353.64 KiB) Viewed 727 times
- Classic123
- Posts: 13
- Joined: Fri Aug 29, 2014 1:44 pm
Re: Breadboard ATMEGA 328 and SD shield
WIth script. The only changes I have made are to the set connection rates to 9k6. To confirm - I have had this working when fitted to the UNO but, it doesn't work when breadboarded. I have tried putting the microcontroller back in the UNO to check that it hasn't been corrupted and it hasn't.
- Attachments
-
- SD logger V0.2.txt
- (6.53 KiB) Downloaded 31 times
- Classic123
- Posts: 13
- Joined: Fri Aug 29, 2014 1:44 pm
Re: Breadboard ATMEGA 328 and SD shield
I've looked widely and there has been some advice to use pullup resistors. The consensus seems to be for one to be used os SS http://www.avrfreaks.net/forum/why-have ... i-and-miso
I've tried that by putting a 10k pullup on pin 16 (SS) but it has made no difference. No file, no logging.
I do have a 10k pullup on pin 1 (reset) and when I need to reset, just connect the pin 1 to ground for a couple of seconds.
I've also tried removing the power supply to the microcontroller and reapplying it to do a reset, still doesn't work.
I've tried that by putting a 10k pullup on pin 16 (SS) but it has made no difference. No file, no logging.
I do have a 10k pullup on pin 1 (reset) and when I need to reset, just connect the pin 1 to ground for a couple of seconds.
I've also tried removing the power supply to the microcontroller and reapplying it to do a reset, still doesn't work.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Breadboard ATMEGA 328 and SD shield
Try tightening up the wiring, and using a smaller breadboard if you have one.
Breadboards work reasonably well up through audio frequencies, but are notorious for causing problems with circuits running over about 100kHz. When you get into the megahertz range, inductive effects in the wiring can also cause problems, so neatness really does count.
Breadboards work reasonably well up through audio frequencies, but are notorious for causing problems with circuits running over about 100kHz. When you get into the megahertz range, inductive effects in the wiring can also cause problems, so neatness really does count.
- Classic123
- Posts: 13
- Joined: Fri Aug 29, 2014 1:44 pm
Re: Breadboard ATMEGA 328 and SD shield
Point taken. I've used a smaller board, shortened and tidied the wiring, checked the supply voltage (5.02V) but it still does not work. I've checked the GPS module again and it's OK. Photo 3 is the latest, tidiest version. The flying orange wire from pin 1 is what I am using to short to ground for the reset.
- Attachments
-
- Photo 3.JPG (265.48 KiB) Viewed 695 times
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Breadboard ATMEGA 328 and SD shield
That looks good.. wiring that tight shouldn't contribute any problems.
I see some differences between your SD shield and the product photos of the Datalogger in the shop. Are you using an Adafruit shield?
I see some differences between your SD shield and the product photos of the Datalogger in the shop. Are you using an Adafruit shield?
- Classic123
- Posts: 13
- Joined: Fri Aug 29, 2014 1:44 pm
Re: Breadboard ATMEGA 328 and SD shield
I'm using this one:
http://www.ebay.co.uk/itm/New-Data-Logg ... 3ce3ab14da
Do you think this is the issue? Would this work with an Adafruit micro SD breakout?
http://www.ebay.co.uk/itm/New-Data-Logg ... 3ce3ab14da
Do you think this is the issue? Would this work with an Adafruit micro SD breakout?
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Breadboard ATMEGA 328 and SD shield
Double-check the connections for the CS pin.
The Adafruit shield uses pin 4 for the SD card's CS signal, but a different shield might wire it anywhere.
The Adafruit shield uses pin 4 for the SD card's CS signal, but a different shield might wire it anywhere.
- Classic123
- Posts: 13
- Joined: Fri Aug 29, 2014 1:44 pm
Re: Breadboard ATMEGA 328 and SD shield
Nope. Still no joy. I've ordered an Adafruit micro SD breakout board to see if that works:
http://www.ebay.co.uk/itm/161382448238
It should arrive by 23 Sep, I will have a go with it and update this thread to pass on whether this has resolved the issue or, if there is still a problem.
Thanks for all your help so far.
http://www.ebay.co.uk/itm/161382448238
It should arrive by 23 Sep, I will have a go with it and update this thread to pass on whether this has resolved the issue or, if there is still a problem.
Thanks for all your help so far.
- Classic123
- Posts: 13
- Joined: Fri Aug 29, 2014 1:44 pm
Re: Breadboard ATMEGA 328 and SD shield
I've found it. It works now.
Although I checked and re-checked everything many many times, I assumed that the discrete components were all fine too. The 22pF caps I thought I was using across the crystal were actually 22nF. Other scripts I ran with them previously in circuit obviously didn't use the external oscillator.
I apologise for taking up your time with what is an error on my part but I've 'fessed up if only to provide an example to others that it's not always what you think that might be causing the problem.
Again, thanks for all your fantastic support.
Although I checked and re-checked everything many many times, I assumed that the discrete components were all fine too. The 22pF caps I thought I was using across the crystal were actually 22nF. Other scripts I ran with them previously in circuit obviously didn't use the external oscillator.
I apologise for taking up your time with what is an error on my part but I've 'fessed up if only to provide an example to others that it's not always what you think that might be causing the problem.
Again, thanks for all your fantastic support.
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Breadboard ATMEGA 328 and SD shield
Thanks for letting us know what you found. Perhaps this will help others that think "Everything is correct" to realize going over thing a second (or third) time sometimes turns up the problem. You'd be supprised how many people, when asked to provide pictures look at the picture and see the problem. Again, thanks for responding.
Please be positive and constructive with your questions and comments.