Have I bricked my ATmega328P?

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello folks,

 

I'm trying to build an open-source synthesiser module that uses an ATmega328P, the documentation for which can be found here. I've been unable to burn the bootloader or make any contact at all really, using both the Arduino IDE as recommended by the circuits designer, or with avrdude directly, using this USBAsp programmer. I've checked the continuity of all the relevant connectors several times, and it looks to me like the right signals are getting to the pins on the IC (5v on the Vcc, low-pulse on RST etc.) I've tried pretty much every option in avrdude, and the low rate jumper on the programmer, but it's as if there's no connection to the IC at all, just "error: program enable: target doesn't answer. 1" or "device signature 0x00000". The design uses an external 20Mhz crystal with 22u caps, and which I've checked independently and is working fine.

 

There's been one time that avrdude has been able to get a response, the log of which can be found in the first post of this thread on the designers forum.

 

I think the IC is dead, or I've set the fuses in such a way that a connection isn't going to happen. This build is the first time I've worked with any sort of AVR, or micro-controller in general, so I apologise in advance if I've made any glaring rookie errors.

 

Thanks

This topic has a solution.
Last Edited: Tue. Nov 6, 2018 - 02:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you have an oscilloscope try to power up AVR and check if there's 20MHz wave on XTAL1 and XTAL2 pins. If not you may try to connect external source clock to XTAL1 and try again with programmer.

extronic.pl

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Feed a 1MHz clock signal into xtal1 pin and reset fuses to default values should restore the chip to working condition again.

Most likely you set the fuses to use external clock rather then external xtal the first time you programmed it!

 

Jim

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the replys guys. I've tried measuring across the XTAL pins but I didn't see anything. Unfortunately my function generator is from the stone age and can only go as high as 500KHz. I could rectify a triangle to get to 1MHz, how picky is the AVR about the precision/shape of the clock signal?

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Got an Arduino?  Use it to gen the signal for the xtal1 pin by toggling a pin.  Note:  any frequency will work, the ISP must be set to <1/4 the clock frequency you gen so the higher the better.

 

Jim

 

 

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think you mean 22pF caps not 22u caps. Only a million times off! 22u would definitely kill any oscillation by the crystal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For anyone interested in the subject of AVR audio and/or synthesis, I'd like to do a shout-out for the generic VS1053b UNO board.  These are sold on eBay for about $7-12 US.  Here's one:https://www.ebay.com/itm/1pcs-VS...

 

The VS1053 has a reset mode (selected by pulling GPIO pin #1 active when the VS reset pin is toggled) where an internal set of 128 General MIDI ROM-based audio samples can be accessed using standard (31.25K baud) MIDI commands.   You can send MIDI commands (like 0x90 0x3c 0x60 for Note-On Middle-C) directly to the VS1053's TX pin and get the sample playback through the headphone connector.  Or, you can use the AVR's SPI to send MIDI data directly to the VS1053.   As you can imagine, the samples aren't great in musical quality. But they are all unique and some are pleasant and interesting.  Pitch-bending is also included for note shaping or fine-tuning (if playing together with record).  It is the cheapest musical instrument that you can build with an Arduino, a VS1053 module board, and a MIDI keyboard. 

 

The VS1053 module board can also play standard MP3 files from an SD card,  or record CD-quality stereo audio [onto SD-card files in OGG format], or be a real-time audio graphics equalizer.  But only one task at a time, so you can't play the GM MIDI synth along with an MP3 recording.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
I think you mean 22pF caps not 22u caps. Only a million times off! 22u would definitely kill any oscillation by the crystal.

Yikes, good thing I got that mixed up after I'd placed them!

 

ki0bk wrote:

Got an Arduino?  Use it to gen the signal for the xtal1 pin by toggling a pin.  Note:  any frequency will work, the ISP must be set to <1/4 the clock frequency you gen so the higher the better.

 

Jim

 

No Arduino to hand, but Ye Olde function generator managed to get something!!

 

A 500KHz clock on pin 7 coupled with a -B 40 tag managed to initialise the AVR. The fuses were set as:

 

Fuses OK (E:FC, H:DE, L:E0)

I reset the fuses to the default of  E:FF, H:D9, L:6; then with the slow clock jumper on the USBAsp the bootloader burned fine, and then the code uploaded fine. 

 

Thanks for all the help folks!