Opened 3 months ago

Closed 3 months ago

Last modified 2 weeks ago

#29 closed defect (fixed)

ATMEGA328P: Incorrect TIFR register of Timer/Counter0

Reported by: Dmitry Salychev 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 (3)

comment:1 Changed 3 months ago by Dmitry Salychev

Resolution: fixed
Status: assignedclosed

comment:2 Changed 2 weeks ago by Dmitry Salychev

Milestone: MCUSim-0.2MCUSim 0.2

Milestone renamed

comment:3 Changed 2 weeks ago by Dmitry Salychev

Milestone: MCUSim 0.2mcusim 0.2

Milestone renamed

Note: See TracTickets for help on using tickets.