simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Adding ATmega1281


From: Joerg Wunsch
Subject: Re: [Simulavr-devel] Adding ATmega1281
Date: Tue, 31 Jan 2012 21:53:46 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Ahoj Petre,

> I guess ATmega1281 will be similar to ATmega128.

Well, let's say "mostly upwards compatible".

> AVR097 says: "ATmega128 and ATmega1281/2561 are designed to be a pin
> and functionality compatible sub family.".

Yes, compatible, but not identical.

In particular, the timers have been much extended, compared to
previous AVRs.

I don't know about the state of simulated peripherals, but all the
timer blocks of newer AVRs are mostly the same.  So if you've got one
implementation already for another more recent AVR, that could be
reused.  Otherwise, if there's no modern timer around already, the
ATmega1281 implementation has to be the first one to create it, but
then, all other recent AVRs could clone it.  There are a lot more of
PWM modes available in the modern timer blocks.

> TIMSK register changed for timers 1 and 3

There's now one TIMSKn register (and one TIFRn register) per timer,
rather than one or two per device.

> and that timers 0 and 2 are
> completely swapped (I guess those guys at Atmel were smoking pot at
> the time),

Probably not.  Otherwise, things you once realized to be mistakes
could never be fixed.

Starting with the era of the ATmega1281, the diversity that once used
to be among the various AVR types got vastly unified.  Turning timer 2
to be the general RTC-aware timer is part of that story.

Don't know whether simulavr simulates the watchdog timer; if so, the
watchdog implementation of the modern AVRs is another major change.
The most important change is that the watchdog now cannot be disabled
unless the WDRF bit in MCUCSR has been explicitly cleared by the
application.  Also, the watchdog is now capable of generating an
interrupt rather than only triggering a reset.

Other changes involve the CPU clock prescaler, while the better
stability of the internal RC oscillator is probably not of much
concern to the simulator. ;-)
-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]