ATMEGA328PB datasheet warning

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

I noticed the MEGA328PB 2017 datasheet (doc # 40001906a) says (incorrectly, I believe)  (sections 19.3 & 10.6.1:

Note: To perform a 16-bit write operation, the low byte must be written before the high byte.

For a 16-bit read, the low byte must be read before the high byte.

This doesn't even match their description in prior sentences  (When the low byte of a 16-bit register is written by the CPU, the high byte that is currently stored in TEMP and the low byte being written are both copied into the 16-bit register in the same clock cycle)

 

 

For the past decade, the various old datasheets always said:

To do a 16-bit write, the high byte must be written before the low byte. For a 16-bit read, the low byte must be read before the high byte.

 

the 2015 mega328pb datasheet gives the high followed by low approach

 

...looks like someone did some careless editing on the 2017 update??

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

Last Edited: Mon. Aug 28, 2017 - 09:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

...looks someone did some careless editing on the 2017 update??

That's shockingThat is shocking.

 

Maybe post that here?:

https://www.avrfreaks.net/forum/avr-errata-unpublished-and-other-gotchas?page=all

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

That's shockingThat is shocking.

It only caught my attention since I distinctly remembering read & write needing the opposite sequence...but they spec'd both as low, followed by high registers.  That is, unless there really has been a change (just to break compatibility).

Could mess up a newbie or even compiler creators..that would be a strange mess to figure out.   

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

No wonder we've had a number of threads on getting 'PB to work OK.

 

A dastardly plan by the new overlords -- fake news!

 

Now I have to look to see if anything in the Revision History...

 

"Interesting", at the least.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

They got it right in 10/2015:

 

 

 

And in May 2017:

 

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

Make Xmega Great Again!

 

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

At least the compiler should be unaffected , unless someone at CompilerWorld stoops to using the datasheet to develop it!! 

Screwing up the atomic access can turn the sanest 'Freak into a high power oscillator.

Thankfully, the code examples in the datasheet appear to be in the correct order (at least those I went and looked at). 

 

I submitted a ticket to Microchip/Atmel  (Micratmel)

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

Last Edited: Mon. Aug 28, 2017 - 07:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greg_Muth wrote:
They got it right in 10/2015:

Is that like the "royal We"?  Until the quoted version, they were Atmel datasheets.  Now...

39. Revision History

Doc Rev. Date Comments
A 04/2017 • Change of document style.
• New Microchip document number. Previous version was Atmel document
42397 rev.C.

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

I've reported this to the higher authorities (TPUBSMEGA-294)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

@theusch said:

Is that like the "royal We"?  Until the quoted version, they were Atmel datasheets.  Now...

 

I considered pointing out the company names on the bottoms of the pages...  But decided no to.

 

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

Make Xmega Great Again!

 

Last Edited: Tue. Aug 29, 2017 - 02:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, confirmed my suspicion from reading the same doc. Note also that their accompanying example code uses "out TCNT1H,r17" and "out TCNT1L,r16" but the part header (m328PBdef.inc) lists those as "MEMORY MAPPED" locations outside the range of "in" or "out": they're 0x85 and 0x84 respectively.

Last Edited: Sun. Oct 15, 2017 - 02:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I submitted a ticket & they agreed the datasheet editor had accidentally swapped the required sequence.  It should be corrected before tooooo long (but don't wait around).  

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