Switching from ATmega128 to ATmega64

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

Dear guys,

In a new design I am using the ATmega128 micro. My flash.HEX code is near 30KB, I am also not using more than 20 bytes of internal EEPROM and not more than 1050 bytes of SRAM.

In order to reduce my final product price I would like to switch from the ATmega128 to the ATmega64.

Does anybode has the experience to inform on which things I have to take care? (PINS, Features, Errata, anything else). I am using the IAR Embedded Workbench C Compiler.

The ATmega128 and ATmega64 seem to be similar devices (PIN to PIN, features) except the memories length, althought they are incuded in different areas/datasheet/series, that's why I am asking you.

Regards,

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

They are not just similar, they are identical (besides the memories sizes).

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Thank you very much for your reply

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

Check the ISR tables. I think there was another subtle difference in there but it might be somewhere else.

Steve

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

Quote:
AVR090: Migrating between ATmega64 and
ATmega128

Perhaps check out the app note?

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

Quote:
In order to reduce my final product price I would like to switch from the ATmega128 to the ATmega64.
Will that really lower your price? Looking at Digikey, the mega128A cost less than the mega64. And if you go with the mega644, it is even less.

Regards,
Steve A.

The Board helps those that help themselves.

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

Koshchi wrote:
And if you go with the mega644, it is even less.
A while back, I ported the WIZnet W5100 Ethernet controller software from an ATmega128 to an ATmega644. I don't recall any particular difficulties.

Some differences I had to deal with:

  • The 644 has fewer I/O (no ports E or F)
  • The 644 has 3 external interrupts (not 8)
  • The 644 has 1 UART (not 2) - the 644P does have 2 UARTs
  • Some I/O register name differences
Don

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

Quote:
Will that really lower your price? Looking at Digikey, the mega128A cost less than the mega64. And if you go with the mega644, it is even less.
OK, I am just really curious. If you looked at the A price of 128, why not A of 64? Why did you bring up mega644?

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

The mega64A didn't show up in my search, and the 644 could very well meet the OP's needs.

Regards,
Steve A.

The Board helps those that help themselves.

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

Koshchi wrote:
The mega64A didn't show up in my search, and the 644 could very well meet the OP's needs.
But does not 644 have only 40-something pins compared to 64 that the OP is currently using?

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

And how do you know that the OP is using all those pins? The only thing that he has really told us is memory requirements, and the mega644 satisfies those.

Regards,
Steve A.

The Board helps those that help themselves.

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

Hello guys.

I am using all the I/O pins. All analog pins are used as analog inputs (Except PF4,5,6,7 - JTAG). Also all the Ext Interrupts are used. Furthermore Both UART0 and UART1 are used. That's why I think that the 644 does not meet my needs.

I use to buy components from Schukat Electronics.

Here is the list of Atmel microcontrollers and the prices.
http://www.schukat.com/schukat/s...

I may read the Migration file that you suggest me.

Thank you all guys.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

icarus1 wrote:
Furthermore Both UART0 and UART1 are used. That's why I think that the 644 does not meet my needs.
Since you mentioned uarts - 644p has two uarts. But I understand that 644P still would not meet your needs because you need more pins.

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

Quote:
In order to reduce my final product price I would like to switch from the ATmega128 to the ATmega64.

If the quantity you consider is less than ~200 pcs/year, and your product is on it's manufacturing stage, go for ATMega64/128.

But I suppose your product is not at it's manufacturing stage yet.
If it is so (before final testing) port the code to something cheaper with ~30k flash.
At quantity of 250 pcs you can get (mind digikey is for reference only):
http://search.digikey.com/us/en/...
1,43$ (which has only 25IOs, so several 74XX573 (0,1$ a piece) must be added)
If the eeprom requirement is only for calibration storage (and not for online logging), you can place it on some flash page, then there are many PICs of 28k flash down to 1,15$ at this quantity(but no eeprom). I didn't check the USART count.

I think you can go down about 4 times with the price, when compared with ATMega64.

No RSTDISBL, no fun!

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

mmmmmmmmmmmmmmmm....................

Very interesting. Thank you Brutte.

Did you used the specific series in any product. Could you please tell me your opinion ? I am asking you because I am planning to start a new project and need to select a device.

My design is just before the manufacturing stage. The PCB has 160 components aprox. and while checking the BOM list I am trying to reduce the final price.

I am talking about 600 to 800 pieces per year. So any Euro lower price means 600 to 800 euros. I reduced the price up to 8 euro now and this means 4800 to 6400 euros. This is a big deal for me.

I really can't take the afford to make any modification because the product is tested enough and this is a work of couple of months.

I look forward to your reply about the ST series.

Thank you.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

What we've done (on a slightly larger scale) if pressed to meet a production/launch deadline is to start by making a small quantity of an initial design then do a V2 "cost engineered" variant for the main part of the production run. Might be worth considering. If you are only actually going to sell 100/200 in the first 2-3 months then just make those with the current design then use the 2-3 months to re-engineer the remaining 600 (or whatever) for a low production cost.

Of course if your own customer wants to take all 800 in a single drop on day one you don't get this luxury.

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

clawson wrote:
is to start by making a small quantity of an initial design then do a V2 "cost engineered" variant for the main part of the production run.

Definitely! That is a traditional way of designing a more complicated stuff when the risk of bugs/failure is high. Do not even try do do it in one leap when you are not very experienced!

You must pick a chip with more resources, initial Release firmware version is bigger and way more complicated than final Release as it contains a lot of diagnostics/logs/dumps - when (if) it is being returned because of a failure, it holds an extremely valuable information inside. At a price of several bucks you can save hundreds of hours of chasing the most nasty bugs.

The most important is to start with the chip which fits with BOM of final Release and still allows easy migration with minimal design changes (one -D should do the trick) in case of the development or evolution of the product.

icarus1 wrote:
Did you used the specific series in any product.

You mean STM8? No, I did not, but I am fascinated with their price! This link was given for reference only to show you that a 32k device is the very center of embedded market nowadays and there is a lot to choose from(PIC/HC08/ST7/8051 or even CM0). Not mentioning less popular Asian manufactuters.
AVRs are really expensive, marketed for hobbyists IMHO (check their prices at www.findchips.com for example).

Here is the link of a topic you may be interested in:
https://www.avrfreaks.net/index.p...

No RSTDISBL, no fun!