atmega128A and atmega128

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


I looked into the data sheet of Atmega 128 and atmega 128a 

I am using atmega128a and I didnt know untill now that it is a little different from (atmega 128) I was using the data sheet for atmega 128 and in that data sheet the ISCn0 and ISCn1 has the following table for control. I want to use it as any logical change on INTn generates an interrupt

 

 

 

but nothing was happening and It almost took me 1 week to realize that atmega 128 and aatmega 128a can have separate data sheets

 

atmega 128 A data sheet  says,

 

 

now my question is, ( as far as i know atmega 128a was the upgrade of atmega 128 ) then why would they remove this important feature and also please suggest me how can I use the same (interrupt on logic change) with the same chip ( i am sure there must be some way to do it) .

 

Thanks in Advance, 

 

 

 

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


Which version of 128 datasheet are you using? I just downloaded 

 

http://ww1.microchip.com/downloads/en/DeviceDoc/doc2467.pdf

 

from Microchip.com and it says:

 

 

So 01 is already "reserved" in the latest ATmega128 (not ATmega128A) data from Microchip. The date code on this issue is 06/11 so June 2011.

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

This is quite ... interesting.  Is there a migration app note for the '128A?

 

[edit] Well, yes -- http://ww1.microchip.com/downloa...

But it says

3 Summary of Changes
For a summary of changes, see the revision history at the end of the ATmega128A
data sheet.

Not very helpful.

 

 

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.

Last Edited: Fri. Jul 12, 2019 - 11:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I might have some other version of atmega 128 so does it mean that I can not use the interrupt on logical change in atmegaA ?

  or is there any other way of doing it? 

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

clawson wrote:

 

So 01 is already "reserved" in the latest ATmega128 (not ATmega128A) data from Microchip. The date code on this issue is 06/11 so June 2011.

Note that Cliff's posted datasheet expert applies to ICS 0/1/2/3.  But the "problem" area appears to be for ICS 7/6/5/4.  INT 4, 5, 6, and 7?  Not a Mega128 nor a Mega128A, is it?

 

OP needs to tell which AVR model is really being used, and a bigger datasheet excerpt with the identification information.

 

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.

Last Edited: Fri. Jul 12, 2019 - 11:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SufyanRaza26 wrote:
I might have some other version of atmega 128

What model ARE you using?!?

SufyanRaza26 wrote:
but it does not say anything about the above mentioned change

It says to look in the datasheet.

 

-- Tell which AVR model you are really using.

-- Give an excerpt from the datasheet that shows document identification, model, and date -- at the bottom of each page.

 

 

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


okay, 

 

I am using atmega128A 

 

This is the latest data sheet that i could find 

http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-8151-8-bit-AVR-ATmega128A_Datasheet.pdf  

 

Here is the picture from the data sheet 

 

 

 

 

 

But i am sure something is not right here because I am using PIN 5 of PORT E for interrupt generation and i am supposed to use it in the generate interrupt in logic change mode which according to this data sheet is impossible , where as my boss is 100 percent certain that it is possible and he is almost always right:S 

 

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

theusch wrote:
Not very helpful.

Nor am I.

 

--  Indeed, that model has external interrupts 0 through 7.  I implied otherwise.

-- There is that difference in the '128 versus '128A datasheets as is under discussion.

-- The Revision History of the Mega128A datasheet gives no hint of a change to that table.  So it was "silent".

 

For OP:  I'd guess it didn't really work either on a mega128?  Remember that that is one of the oldest AVR models.  [lol -- and yet was a new generation/update of the Mega103.]

 

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.

Last Edited: Fri. Jul 12, 2019 - 12:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why would you use a 128 (or 128A) in 2019 anyway? Atmega1281 almost certainly has PCINT on every IO anyway.

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

To answer your question on how to make it work, set it to interrupt on the low to high transition, then...

in the ISR() toggle the interrupt trigger edge via iscn0 bit, since interrupts are disabled during service of the ISR(), your free to change which edge triggers the next interrupt...

You should be good to go!

 

Jim

 

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

share.robinhood.com/jamesc3274