Atmega328p 32 MLF vs PDIP?

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

Hi,

I have used the Atmega328P in the PDIP package. But recently I needed an SMD solution, so I ordered some PCBs with the Atmega328P 32MLF assumming that the microcontrollers were exactly the same except for the SMD package and the extra 4 pins.

I am able to program the 32mlf microcontroller via an ISP programmer. However, the program doesn't seem to run. For instance, I am trying to output a high voltage (3.3V) at one pin, but when I measure the voltage in that pin the tester just says 0V.

This is the code:

#define F_CPU 14745600

#include 
#include 

#include 
#include 
#include 
#include 
#include 

#include "io_328p.h"

int main() {


    DDRB |= (1<<PB2); // set PB2 as output
    PORTB |= (1<<PB2); // set PB2 high

	while(1) {

	}


  return 0;
}

Why is it not working? What are the differences between the Atmega328p in the 32Mlf and the PDIP packages?

Thanks in advance

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

If I had to guess, I'd suspect the soldering of the MLF package.

(We do a lot of surface-mount, but TQFP with leads.)

But perhaps when you "ordered the boards" it came with the processor mounted? Then other possibilities include brown-out level set higher than VCC (if your PDIP project was 5V and you used the same settings. Or AVcc not connected? All Gnd pins connected?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

theusch wrote:
If I had to guess, I'd suspect the soldering of the MLF package.

(We do a lot of surface-mount, but TQFP with leads.)

But perhaps when you "ordered the boards" it came with the processor mounted? Then other possibilities include brown-out level set higher than VCC (if your PDIP project was 5V and you used the same settings. Or AVcc not connected? All Gnd pins connected?

The chip did not come mounted in the board. We soldered it. The strange thing is that the software was burned successfully in the microcontroller with the ISP programmer. Avcc is connected and we used 3.3V as well with my PDIP project. This is the schematics of the circuit:

http://www.myicv.com/media/73_6_1444.png

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

Are you scared of capacitors? There's no 22pF caps on the crystal - without these it will probably not oscillate. VREF should have a 100nF cap to 0V and there should be at least one bypass cap on the power rails.

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

Kartman wrote:
Are you scared of capacitors? There's no 22pF caps on the crystal - without these it will probably not oscillate. VREF should have a 100nF cap to 0V and there should be at least one bypass cap on the power rails.

Is that really necessary? I have the exact same circuit on a breadboard with a PDIP MCU and it works.

Also, The crystal oscillates, otherwise I wouldn't be able to even program the MCU with the ISP programmer right?

P.S I do have the bypass capacitor, a 0.1uF cap.

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

You are lucky the crystal oscillates then. Breadboards are known to have heaps of stray capacitance, again, luck was on your side.

How many port pins have you tried?

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

Kartman wrote:
You are lucky the crystal oscillates then. Breadboards are known to have heaps of stray capacitance, again, luck was on your side.

How many port pins have you tried?

I have tried about 5 different pins (The C, B and D ports) but none seem to work. If I want to output a high voltage, the tester keeps saying it's 0V.

Is there anything else that I need to do in order to activate the pins or something on this 32MLF version that I didn't have to do in the PDIP MCU? Or they should be exactly the same?

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

Silly question, but is there definitely 3.3V on the Vcc pins when the programmer cable isn't connected?

What are the fuse settings, and have you verified the fuse bits on the two packages are the same?

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

You also have AREF pin tied to VCC, this is a good way to blow up a chip. This pin should have a .1 to ground.

OP said

Quote:
Is that really necessary?

What does the datasheet say?

As far as does the MLF package need anything different in the program then the PDIP package? No

JC

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

Mlf package has a solder pad on the bottom side, did you solder it to ground?

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

Quote:
Is that really necessary?

Yes.

Quote:
I have the exact same circuit on a breadboard with a PDIP MCU and it works.

And the stray capacitance of the breadboard is...?

Quote:
Also, The crystal oscillates, otherwise I wouldn't be able to even program the MCU with the ISP programmer right?

Unless it is still running from it's internal RC oscillator. Since you can program, you should also be able to read out the fuses. Do. (Just read'em - don't change them.) Report here.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]