Timer datasheet errors, or am I mad?

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,

 

Just needed to refresh my memory on timer registers, and whilst doing so noticed something odd in a datasheet, that or I'm being thick...

 

Page 149 of the Atmega1284P datasheet has the following text in it, and ref the part that relates to the COM2x1:0 bits, I agree - three is inverted output. The part about TOP is defined as 0xFF when WGM2:0 = 3, I don't think I agree. Table 15-8 shows mode 1 as Phase Correct PWM, TOP = 0xFF, which requires the WGM0 bit only set.

 

In phase correct PWM mode, the compare unit allows generation of PWM waveforms on the
OC2x pin. Setting the COM2x1:0 bits to two will produce a non-inverted PWM. An inverted PWM
output can be generated by setting the COM2x1:0 to three. TOP is defined as 0xFF when
WGM2:0 = 3, and OCR2A when MGM2:0 = 7 (See Table 15-4 on page 154). The actual OC2x
value will only be visible on the port pin if the data direction for the port pin is set as output.

 

Am I mad, or is this a peculiarity of the fact that the 3rd WGM bit resides in TCCRnB whereas WGM1:0 reside in TCCRnA? Surely WGM2:0 = 3 would be mode 3 in which TOP does == 0xFF, but it's Fast PWM, not Phase Correct.

 

If it is an error, is there an error reporting system for datasheet errors like this? 

 

I thought I spotted another one earlier, but now can't find it... EDIT - just re-seen the other error. MGM bits, they're WGM bits!?

Last Edited: Wed. May 13, 2020 - 06:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First, make sure your datasheet is the latest version.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jtw_11 wrote:
Am I mad, or is this a peculiarity of the fact that the 3rd WGM bit resides in TCCRnB whereas WGM1:0 reside in TCCRnA? Surely WGM2:0 = 3 would be mode 3 in which TOP does == 0xFF, but it's Fast PWM, not Phase Correct.

Table 17-8 shows modes 1 and 5 being the PC modes, not 1 and 3....

DataSheet errors are unfortunately common, yes, open a support ticket and let MC know of the error, but before you do, make sure you have downloaded the latest DS from the product page and verify the error still exists.  

I tend to look at the tables to find the PWM mode I wish to use, so far that source seems to be correct in most cases, but copy/paste errors can and do happen there as well.

Jim

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kabasan wrote:

First, make sure your datasheet is the latest version.

 

Indeed, I was bitten by this and looking as you posted.

 

My version was the last Atmel datasheet, looking at the latest Microchip datasheet, this has moved to Page 154, and they've fixed the WGM/MGM mixup. However, the error regarding the WGM2:0 = 3 bits remains.

 

Interestingly, the first paragraph of this section has it right in both the old and new datasheet, and then get's in wrong when the information is repeated a few paragraphs later. If you look on page 153, 17.7.4, paragraph 1:

 

TOP is defined as 0xFF when WGM22:0 = 1, and OCR2A when WGM22:0 = 5.

then look at paragraph 4 in the same section, page 154. Also just noticed Table 17-4 is the wrong table too as you point out ki0bk.

TOP is defined as 0xFF when WGM2:0 = 3, and OCR2A when WGM2:0 = 7
(See Table 17-4 on page 160)

 

Good to know I'm not losing it just yet... Hope you're all staying safe.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm sure the people creating START & other tools love all that.  Then they have their own bugs and/or doc errors to add to the mix.

I spent a while trying to get a MCHP serial port working to finally look up an errata that showed I wasn't insane (that day).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!