beautypg.com

Errata, Atmega161 rev. e, Atmega161(l) – Rainbow Electronics ATmega161L User Manual

Page 152

background image

152

ATmega161(L)

1228C–AVR–08/02

Errata

ATmega161 Rev. E

PWM not Phase Correct

Increased Interrupt Latency

Interrupt Return Fails when Stack Pointer Addresses the External Memory

Writing UBBRH Affects both UART0 and UART1

Store Program Memory Instruction May Fail

5.

PWM not Phase Correct

In phase correct PWM mode, a change from OCRx = TOP to anything less than
TOP does not change the OCx output. This gives a phase error in the following
period.

Problem Fix/Workaround

Make sure this issue is not harmful to the application.

4.

Increased Interrupt Latency

In this device, some instructions are not interruptable, and will cause the interrupt
latency to increase. The only practical problem concerns a loop followed by a two-
word instruction while waiting for an interrupt. The loop may consist of a branch
instruction or an absolute or relative jump back to itself like this:

loop: rjmp loop

In this case, a dead-lock situation arises.

Problem Fix/Workaround

In assembly, insert a nop instruction immediately after a loop to itself. The problem
will normally be detected during development. In C, the only construct that will give
this problem is an empty “for” loop; “for(;;)”. Use “while(1)” or “do{} while (1)” to avoid
the problem.

3.

Interrupt Return Fails when Stack Pointer Addresses the External Memory

When Stack Pointer addresses external memory (SPH:SPL > $45F), returning from
interrupt will fail. The program counter will be updated with a wrong value and thus
the program flow will be corrupted.

Problem Fix/Workaround

Address the stack pointer to internal SRAM or disable interrupts while Stack Pointer
addresses external memory.

2.

Writing UBBRH Affects Both UART0 and UART1

Writing UBRRHI updates baud rate generator for both UART0 and UART1. The
baud rate generator's counter is updated each time either UBRR or UBRRHI are
written. Since the UBRRHI regiSter is shared by UART0 and UART1, changing the
baud rate for one UART will affect the operation of the other UART.

Problem Fix/Workaround

Do not update UBRRHI for one UART when transmitting/receiving data on the
other.