ATMEGA328 hex downloading issue

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

My project uses ATMEGA328p. ADXL345 accelerometer is connected via SPI interface.

The target board is a PCB that has above parts soldered and for time being I'm using Arduino As ISP to program the ATMEGA328.

The connections are as follows:

Connections
ATMEGA328 ARDUINO AS ISP
RST SS/CS
MOSI MOSI
MISO MISO
SCK SCK
VCC VCC
GND GND

 

I'm using avrdude to download the hex. However, the process fails.

I'd get this during the download process!

 

After some research, it was found that  SS pin of ATMEGA328 must be pulled up so that ADXL remains deselected during the download process.

Here is my main issue:

While downloading somehow the MOSI track on PCB got cut. I was able to replicate the same effect on another PCB effectively spoiling the boards.

Meanwhile, accelerometers have also become futile.

 

How do I proceed with proper downloading of hex?

or what am I missing in the process stated above?

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

Sounds like you have some wiring issues, can you post a schematic of your custom board, and also a clear picture?

 

Does the SS line to the ADXL have a pull up resistor (10k typ) so when the AVR is reset (code loading) the SS is high?

 

Does the target board have power while trying to do code load?

 

Jim

 

Edit: just looked at your error msgs, it shows vtarget 0 volts, and not able to read dev signature.

So your target needs power, nothing will work until you can successfully read the device signature.

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

Last Edited: Tue. May 14, 2019 - 01:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Sounds like you have some wiring issues, can you post a schematic of your custom board, and also a clear picture?

Here is the  schematic. Well, this one is a revision old. Just imagine a 10K pullup on SS-CS wire.
 

Does the target board have power while trying to do code load?

Yeah. 3.3V

As I'm using Arduino as ISP for now, I connect the 3.3V power pin to target chip by a test pad on PCB. The ground is also commonly hooked up.

I don't know why avrdude show vtarget as 0. 

Here is a similar output of avrdude when I isolate target ATMEGA328p by removing ADXL.

 

I'd also like to mention that I'm able to download hex successfully without having ADXL.

Does the SS line to the ADXL have a pull up resistor (10k typ) so when the AVR is reset (code loading) the SS is high?

Yup. There's a pullup resistor.

I don't have access to hardware right now to clarify about SS being high when code loading. I'll let you know in a reply soon.

AFAIK, it must be high as it is pulled up. Anyways I'll confirm and let you know.

Thank you for your reply :)

 

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


 

NoGrassFire wrote:
Well, this one is a revision old. Just imagine a 10K pullup on SS-CS wire.

BTW, AREF should not be tied to VCC, it either floats with n.c., or has a 100nf cap to gnd connected.  Internal damage can happen with it tied to VCC like that!

 

Note: you also need bypass caps on the ADXL chip as well:

 

This could be your problem too!

time to Read The Fine Manual RTFM.

 

Jim

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

Last Edited: Tue. May 14, 2019 - 06:31 PM