Datasheet interpretation question

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


 

Hi guys.

 

I have a quick question about the register naming in datasheets. I'm looking at the datasheet of the mega328pb.

 

My question is how do I interpret the braces? I've highlighted them below. I see COM0A has [1:0] and WGM0 has [2:0]. They both only have two bits though, what makes them different?

 

 

 

 

 

Last Edited: Thu. Nov 7, 2019 - 07:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

WGM has got 3 bits. However only WGM00, WGM01 are in TCCR0A.
WGM02 is in TCCR0B (from my memory)

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

Typographic misprint - unneeded braces.

This paragraph in datasheet for ATmega48A/PA/88A/PA/168A/PA/328/P

(document DS40002061A):

WGM02 = 0: Normal Port Operation, OC0A Disconnected.
WGM02 = 1: Toggle OC0A on Compare Match.

and WGM02 bit lays in TCCR0B register.

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

You really need to inspect where all of the bits are located.....just to mess with us, a few AVR chips here & there will move one or 2 bits from their "typical" location to a completely different register.

Not knowing that has happened can lead to utter chaos & late night debugs....only to find out you've been setting the bit to call Aunt Matilda by mistake.

 

Having the datasheets "reek" with typos, makes it an even more exciting opportunity (sometime looking at the tool chain register def files is a better option). 

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

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

Thanks guys.

 

These things still manage to get me even though I've been using the datasheet for sometime now.