ATMega128 - good value at 77p each !!

Saw these on ebay, so I have ordered a few

128k Flash, 4kRam. 53 IO Pins !!

Cheaper alternative to the ATMega1280 if you dont need so much RAM but need the IO

I have been looking at cores and shoehorning it into Arduino IDE

Hmm… QPF-64… beyond my soldering skills!

Beyond my eyesight too.. but I have young friends that can help !!

Get yourself a desk magnifier. These are easy to solder.

PaulRB:
Hmm... QPF-64... beyond my soldering skills!

I was excited for a moment. Not with QFP 64. No way

I recently managed a LQFP64 without error, but that is my absolute limit and probably not something I want to repeat :slight_smile:

I have been reading that these may be a bit tricky to program with the Arduino IDE.. :frowning:

Not tricky at all with Atmel Studio, for those who don't mind using it.

I will say, this guy could do a bit better packing it. He used masking tape to tape them down to a piece of pink anti-static foam and then wrapped that in bubble wrap. I bet it is a very good physical protection technique (I bought 10 and no bent pins), but I wonder about static taking the tape off. Anyway, it's a pain in the ass and left a little bit of sticky veneer on the top of the ICs.

JoeN:
Not tricky at all with Atmel Studio, for those who don't mind using it.

I will say, this guy could do a bit better packing it. He used masking tape to tape them down to a piece of pink anti-static foam and then wrapped that in bubble wrap. I bet it is a very good physical protection technique (I bought 10 and no bent pins), but I wonder about static taking the tape off. Anyway, it's a pain in the ass and left a little bit of sticky veneer on the top of the ICs.

I got some of mine, its exactly what you said !!

I was reading that you can program over the SPI interface, but the MOSI and MISO should be connected into RDX0(PD1) and TDX0(PD0) of the AtMega128, and also pull /PEN low at the time of programming

New look to Atmel Block diagrams, this one from Sept 2015 datasheet.

128A, 128L are similar to 1284P, a few more IO pins (53 vs 32). 1284 still king of SRAM with 16K, vs 4K in 128 & 8K in 2560.

If one was to program over the SPI interface, I'd expect you'd connect the programmer to Reset, SCK, MISO, and MOSI like you'd do with other AVR chips.
Which are not the pins mentioned in Reply #9.
See page 14.

mcnobby:
I was reading that you can program over the SPI interface, but the MOSI and MISO should be connected into RDX0(PD1) and TDX0(PD0) of the AtMega128, and also pull /PEN low at the time of programming

Yeah, that got me. You do have to hook it up that way, or you can use the JTAG pins to allow debugging. I am trying to get it to work with u8glib, having some trouble. It does come up and can be programmed over both JTAG and ICE. Those chips look good. The problem I am having is with the u8glib.

ATMEGA128A.jpg

CrossRoads:
If one was to program over the SPI interface, I'd expect you'd connect the programmer to Reset, SCK, MISO, and MOSI like you'd do with other AVR chips.

McNobby is right. They do it differently for this IC. I verified it. Does not work with MISO and MOSI. This breakout board routes RTX and TDX to the ICSP header, it does not work the other way (they use a 10 pin header version but it is the ICE "SPI" interface):

See schematic, page 8.

JoeN:
McNobby is right. They do it differently for this IC. I verified it. Does not work with MISO and MOSI. This breakout board routes RTX and TDX to the ICSP header, it does not work the other way (they use a 10 pin header version but it is the ICE "SPI" interface):

https://www.olimex.com/Products/AVR/Header/AVR-H128-C/resources/AVR-H128.pdf

See schematic, page 8.

Thank you for clarifying JoeN !!
Very helpful :slight_smile:

CrossRoads:
128A, 128L are similar to 1284P, a few more IO pins (53 vs 32). 1284 still king of SRAM with 16K, vs 4K in 128 & 8K in 2560.

As you know Bob, I LOVE the 1284 !!
But as far as price goes, I dont think you can beat the 128 for IO (AVR only) as it is less than 1/5th of the price of the 1284

My current project gives 17bit colour VGA from a standard UNO
I am going to attempt full 24bit colour by using the 128

This still leaves heaps of IO on the 128, on the UNO I got fed up with having to be careful what pin I am using for what, and it ended up quite disjointed on the UNO as I was using part-ports for the DAC and part-ports for the Syncing

I see some very interesting projects coming up with the 128 :slight_smile:

Looking at Digikey for a comparison:
'128A are $8.89
'128L (8 MHz parts) are $15.85
'128 are $15.85

'1280 are $14.85
'1284 are $7.60
'1284P are $8.40
'1284P DIP are $8.51

Looks to me that legit parts, which are not 1/5 the price, are quite a bit more for some more IO and surface mount.
'128A would not be a bad way to go.

I can only say, good luck with e-bay parts for 78 cents or whatever it was.

JoeN:
The problem I am having is with the u8glib.

After far too much screwing around I finally got my OLED and u8glib to work. The problem was NOT u8glib, it was the "ATMega103 Compatibility Fuse" which comes factory preset and causes all sorts of problems with the code if you are targeting the ATMega128A because it doesn't behave as one if the fuse is set. TURN THAT FUSE OFF! That was the only thing I had to do to solve my problem.

One fuse that every ATmega128 user will become familiar with very early on is the ATmega103 Compatibility Mode fuse.

All '128's come from the factory with this fuse pre-programmed. In that state, the chip will behave almost exactly as if it were actually an ATmega103 instead of an ATmega128.

Any software you write with the ATmega128 in in mind is 99% guaranteed to fail if you attempt to run it while the chip is in M103 compatibility mode... you'll have to at least modify that fuse.

Very nice JoeN, I have some of those PCBs too
FUSE OFF... noted !!

Thank you