Arcachofo / SimulIDE-Components

Subcircuits and other custom components for SimulIDE.
GNU General Public License v3.0
0 stars 2 forks source link

Incorrect Clock Select Options for Timer0 of ATmega32 #3

Open kshaker97 opened 3 months ago

kshaker97 commented 3 months ago

Description:

The clock select options for Timer0 of the ATmega32 microcontroller appear to be incorrect. According to the ATmega32 datasheet, the clock select bits (CS02:0) should provide the following options:

CS02:0 = 000: No clock source (Timer/Counter stopped)
CS02:0 = 001: No prescaling
CS02:0 = 010: Clock/8
CS02:0 = 011: Clock/64
CS02:0 = 100: Clock/256
CS02:0 = 101: Clock/1024
CS02:0 = 110: External clock source on T0 pin, clock on falling edge
CS02:0 = 111: External clock source on T0 pin, clock on rising edge

However, the current implementation/documentation lists the options incorrectly as follows (example of the error):

CS22:0 = 000: No clock source (Timer/Counter stopped)
CS22:0 = 001: No prescaling
CS22:0 = 010: Clock/8
CS22:0 = 011: Clock/32
CS22:0 = 100: Clock/64
CS22:0 = 101: Clock/128
CS22:0 = 110: Clock/256
CS22:0 = 111: Clock/1024
Arcachofo commented 3 months ago

Nice thanks. But the options for external clock are missing. I think it should be exactly as Timer1.

Can you correct it to merge the PR?