Quiz of the week: spot the error in AVR datasheet

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

I've noticed an error in the "Instruction Set Summary" table at the end of AVR datasheets. Not a dramatic one, but the error is present in most AVR datasheets, apparently as the result of copy-paste mathod of datasheet "writing". Although all of those I checked contain this error, I don't know how many of them are actually affected - I could not check them all, obviously. At least one datasheet has this error corrected *partially*, but it is present in its "original" uncorrected form even in the most recent ones.

Please don't spoil the fun and don't post answers publicly until Thursday, 10.September, 16:00 GMT. You can PM me if you want, and I can then post here who got it right ;-)

Jan Waclawek

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

Take a closer look. I'm finding a lot more than one error, unless I'm reading it wrong. See PM.

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

[EDIT]ADI8421 got it right[/EDIT]

Well, what I see are multiple instances of the same error. I might be missing something else, of course.

There is then also a minor issue which I would not call an error - it might make it to a footnote rather.

JW

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

no point in keeping it a secret since it has been answered correctly... however I'll play along. It has been talked about here a few times, I think you'll find it has been corrected in the tiny10 data sheet.

On a side note, it has been correct in the actual instruction set reference for quite some time (at least Rev B), only wrong in the reference table in the back of the data sheets. The copy/paste error seems to run all the way back to the 90s1200.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

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

Glitch got it right, too.

glitch wrote:
It has been talked about here a few times,

Honestly, tried to search for it first. I assumed this is no news.
glitch wrote:
I think you'll find it has been corrected in the tiny10 data sheet.

That's what I mentioned in the original post - it is only partially corrected. And it's revision B already of that one. More strikingly, there are newer datasheets revisions still containing the "original" version.

JW

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

wek wrote:
Please don't spoil the fun and don't post answers publicly until Thursday, 10.September, 16:00 GMT.

The time is over, please give the answer.

Peter

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

I apologize, Peter - and others - I forgot about it completely. I believe that - as glitch pointed out - this has been discussed already, so there's no surprising information.

The Flags column in the Instruction Set Summary table contains a lot of errors - in most of arithmetic and all logic instructions the S flag is missing, and in the rotation/shift instructions bot the H, and in some of them the S flag is missing.

Although the Tiny10 datasheet corrects some of the omissions, the errors in rotation/shift instruction remains even in revision B. Sadly, there are newer revisions of other chips' datasheets, still containing the *original* version of the table.

The "Instruction Set" document appears to be correct in this regard.

There's also a minor omission in that the OUT instruction might affect the flags if performed on SREG. Even if it might sound trivial, I think this deserves a mention in the "Instruction Set" document and a footnote in the table.

If I would be an Atmel document writer - which I am not - I would include also a set of footnotes stating register and parameter restrictions where they apply (e.g. d=16-31 for SUBI/ANDI/ORI/LDI and their derivatives etc.) - I use this table printed double-sided on a single sheet as a daily cheatcheet and scribe these restrictions onto each copy I print.

I also suspect that in the >128kB FLASH devices the CALL/RET timing is not given correctly (it's 1 cycle longer due to PUSH/POP of the 3-byte PC), but have no time to check it right now.

JW

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

wek wrote:
There's also a minor omission in that the OUT instruction might affect the flags if performed on SREG. Even if it might sound trivial, I think this deserves a mention in the "Instruction Set" document and a footnote in the table.

Is it actually the OUT instruction modifying the status register? No, of course not. What is changing the status register is the fact that you are writing to the status register itself. The status is not changing as a by-product of the operation, but is rather a result of the operation. I wouldn't consider this an error, or omission, in the document.

If you can't figure out that the status register is going to change when you directly write to it, you need to step away from the keyboard.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

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

I guess then STS and ST will need the same footnote, eh?

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.