ATmega32U2 PLL Control and Status Register: Datasheet Error

There seems to be an error in the datasheet for ATmega32U2 (and possibly also ATmega8U2 and ATmega16U2). There, the bits of the PLLCSR register are named DIV5, DIV3, PINDIV, PLLE and PLOCK.

Screenshot of the PLL Control and Status Register description from the ATmega32U2 datasheet.

However, it seems in iom32uh.h the prescaler bits are called PLLP0, PLLP1 and PLLP2 respectively. Therefore, these are the correct C statements to start the PLL:

  • For an 8Mhz external clock
    PLLCSR = ((0<<PLLP2) | (0<<PLLP1) | (0<<PLLP0) | (1<<PLLE));
  • For a 16Mhz external clock
    PLLCSR = ((0<<PLLP2) | (0<<PLLP1) | (1<<PLLP0) | (1<<PLLE));

Hope that saved you some time and digging.

Leave a Reply

Your email address will not be published. Required fields are marked *

Hello!

Portrait of Paul Alexandrow I am a freelance IT consultant, software developer and commercial pilot from Vienna, Austria.

In this Blog I post random notes about findings and solutions to technical issues that I encounter during my daily - or sometimes nightly - work.

more about me

Topics

A32NX AR AVR Bourne Shell C# Cg/HLSL DevOps Embedded Development Events Flight Simulator Fly By Wire Microcontrollers Monitoring Open Source Unity3d VR XR

Secured By miniOrange