Opened 5 months ago

Closed 5 months ago

Last modified 6 weeks ago

#29 closed defect (fixed)

ATMEGA328P: Incorrect TIFR register of Timer/Counter0

Reported by: dsl Owned by: Pawel
Priority: major Milestone: MCUSim-0.2
Component: avr Keywords: planned-in-0.2
Cc:

Description

ATmega328P uses an incorrect TIFR register to set Timer/Counter0 overflow
flag TOV0 at these lines:

mcusim/src/avr/avr_m328p.c:126:5: warning: array index -1 is before the beginning of the array [-Warray-bounds]
mcusim/src/avr/avr_m328p.c:141:5: warning: array index -1 is before the beginning of the array [-Warray-bounds]
mcusim/src/avr/avr_m328p.c:169:4: warning: array index -1 is before the beginning of the array [-Warray-bounds]
mcusim/src/avr/avr_m328p.c:219:4: warning: array index -1 is before the beginning of the array [-Warray-bounds]

This MCU has a special register called TIFR0 which should be updated instead.

Array index -1 means that there is no "TIFR" declaration provided by the
mcusim/avr/iom328p.h header derived from avr-libc project, and it is replaced
by a stub "TIFR" value declared in mcusim/avr/sim/io_regs.h.

Change History (4)

comment:1 Changed 5 months ago by dsl

Resolution: fixed
Status: assignedclosed

comment:2 Changed 3 months ago by dsl

Milestone: MCUSim-0.2MCUSim 0.2

Milestone renamed

comment:3 Changed 3 months ago by dsl

Milestone: MCUSim 0.2mcusim 0.2

Milestone renamed

comment:4 Changed 6 weeks ago by dsl

Milestone: mcusim 0.2MCUSim-0.2

Milestone renamed

Note: See TracTickets for help on using tickets.