simulavr-devel
[Top][All Lists]
Advanced

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

[Simulavr-devel] Making simulavr more device independent


From: Hermann Kraus
Subject: [Simulavr-devel] Making simulavr more device independent
Date: Mon, 31 Mar 2003 19:30:37 +0200
User-agent: KMail/1.4.3

Hi!

While checking my patch for the mega16 I found out that the registers often 
have other function than those which are implemented at the moment. 
e.g.: 
>    bit_CTC  = 3,               /* clear timer/counter on compare match */
>    bit_ICES = 6,               /* input capture edge select */
>    bit_ICNC = 7,               /* input capture noise canceler (4 CKs) */
in timers.h but in the datasheet of the atmega it is 
Bit 7   FOC0: Force Output Compare
Bit 6, 3   WGM01:0: Waveform Generation Mode

Bit 3 isn't really wrong, but it is extended by bit 6 and so it only works 
when bit 6 is 0. Otherwise (bit3:6=11) fast PWM should be activated, but 
Simulavr interprets this as a normal CTC operation and changes the edge of 
the input capture function which is not present in this device.

And as this is not only a problem for the mega16 device, but for most of the 
other devices, too we have to find a more flexible solution for handling 
this. I thought about creating a new file (or adding to to devsupp) to hold 
all the device specific information about where to find the bits AND if the 
device has a feature or if it doesn't have it. 
I know this causes a little more cpu usage, but it's the only way to keep the 
code clear and simulavr flexible.

If you want I can try and code this for the timer example mentioned above.

Hermann




reply via email to

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