Author Topic: ATMega48 - Programming problem  (Read 1928 times)

0 Members and 1 Guest are viewing this topic.

Offline tux75atTopic starter

  • Newbie
  • Posts: 6
  • Country: at
ATMega48 - Programming problem
« on: November 06, 2017, 08:36:31 pm »
Hi!

I am new to this forum, but was reading a lot and also looking for my problem, but didnt find anything useful.
Maybe someone can help me to solve this problem.

I made a little board (i etched it myself with soldermask, but these are my first boards, so not best quality but came out very good and should work)
It came out pretty good, this little board is the second one, first one was with same chip but different circuit which didnt work also.
Because of the problems i made this little board to see if it works without anything else. Purpose of this board was to see if i can program this chip.

I made a few attachments, there is a second layer which is ground only with two vias. The 8 MHz crystal is on the bottom side with two 22pF on the left side of the chip.
6 Pin ISP header on the bottom right, GND and VCC on the bottom left side of the ISP header. VCC is 5 Volt. (4 IOs which are unused at the moment)

I expect Pin 1 to be on the top left where the dot is on the chip. If this is not correct, then of course it wont work.
(I produced 4 boards, another one i soldered the chip 180° rotated, same result, so i tested allready another orientation  :-DD)
There might be too much solder on the pins (i was out of smaller solder wire so it was hard to put less there), but i checked it, there are no solder joints and everything looks ok.

I used a logic analyser to see if the protocol is working. The pictures are attached also. The 0xAC 0x53 0x00 0x00 to enable programming for ATMega48 are included, just not in the beginning, but later on i see it. At the first or second 0x00 the chip should repeat 0x53 which is not there. Programmer is a version of USBASP and works on a arduino leonardo. ISP connections are same as on the leonardo, but of course different pins as it is also a different package.

As far as i know, the 8 MHz are not neccessary at factory fuse settings, but these chips are from china and this could be an issue with fuses, but there is a crystal, so the fuse settings should be ok.
Any other reasons why my chip is not responding?

Right now i am out of ideas.
 

Offline alank2

  • Super Contributor
  • ***
  • Posts: 2196
Re: ATMega48 - Programming problem
« Reply #1 on: November 07, 2017, 01:13:35 am »
As the MISO line is basically grounded and not changing, it would be the first thing I'd look at.

Some of the pins look like the solder is bulgy on them.  Do you have any flux?  A bit of flux would let you even that out quite a bit.  You might have a short between pins, that might be worth checking.

Good luck!
 

Offline tux75atTopic starter

  • Newbie
  • Posts: 6
  • Country: at
Re: ATMega48 - Programming problem
« Reply #2 on: November 07, 2017, 04:52:14 am »
No short between the pins, and i used some flux. Problem is the too big solder wire for this, but i dont have any smaller at home at the moment.
But i doulbe check it later.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3043
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: ATMega48 - Programming problem
« Reply #3 on: November 07, 2017, 06:24:37 am »
Analyzer trace does not show reset going high - is the 100n cap from reset to gnd shorted maybe. 
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3043
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: ATMega48 - Programming problem
« Reply #4 on: November 07, 2017, 06:29:48 am »
Scratch that, i see the other trace shows it going high.

You may want to try slowing down the usbASP's clock rate in case your 48 is running too slow for it due to fuses.

It is certainly possinle your chinese-sourced 48 has bad fuses, i once got a load of tiny13s which had thier reset fuse disabled!
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline imidis

  • Frequent Contributor
  • **
  • Posts: 426
  • Country: ca
Re: ATMega48 - Programming problem
« Reply #5 on: November 07, 2017, 07:31:03 am »
If you havent set the fuses it's probably shipped to use the internal 8mhz oscillator, you will probably need to change and make sure your icsp is set low enough, I think 16khz or less (going off the top of my head) I can't remember whether it will work properly with an external oscillator hooked up to the oscillator pins, you may have to pull it.

If that does not work I would try pulling the capacitor off the reset pin as well.

Just my ideas if the pins are ok.
« Last Edit: November 07, 2017, 08:35:16 am by imidis »
Gone for good
 

Offline tux75atTopic starter

  • Newbie
  • Posts: 6
  • Country: at
Re: ATMega48 - Programming problem
« Reply #6 on: November 07, 2017, 07:41:14 pm »
I tried also with slow Jumper active on my programmer and in the beginnen without the cap on the Reset Pin.

But the problem with the reset fuse might be worth lokking closer at. I have two boards with the same problem, that would be too much for me for the same random error (short on the same pin, with different layout; cap on reset pin was removed on both; slow programming on both). I real somewhere that it is possible to reset the fuses with 12 Volt circuit. If someone has some links for me [emoji16]... 
I will investigate more into this direction and hopefully i can try this on the wecken.

Gesendet von meinem E5823 mit Tapatalk

 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3043
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: ATMega48 - Programming problem
« Reply #7 on: November 07, 2017, 09:18:16 pm »
First, buy a 48 (or pin compatible, 88 etc) from a reputable source and try that.

For fuse change with reset disabled you need hvpp.  Search fusedoctor.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline alank2

  • Super Contributor
  • ***
  • Posts: 2196
Re: ATMega48 - Programming problem
« Reply #8 on: November 07, 2017, 09:36:22 pm »
Are your MISO/MOSI backwards?  datasheet shows mosi pin15, miso pin16
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3043
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: ATMega48 - Programming problem
« Reply #9 on: November 07, 2017, 09:57:43 pm »
Well spotted, definately looks like OP has them swapped.

My own Arduino pin numbering diagram for simplicity but shows corrrect positions...

~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline tux75atTopic starter

  • Newbie
  • Posts: 6
  • Country: at
Re: ATMega48 - Programming problem
« Reply #10 on: November 08, 2017, 06:25:40 pm »
Right, i screwed it up, but only on this board (i tripple checked it and still didnt see it, i think i need some new glasses  :palm:), the other design is correct and same behavior. I also tried to switch these signals, no answer from the chip.
I dont think that the chip is fried, i believe that the MISO pin is driven from the ATMega after the 0xAC 0x53 is received and on the next byte the 0x53 echo comes on MISO.

I can use this chip to test the HVPP method and check if it still works.

Thanks for finding this error!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf