Error in mega328PB datasheet ?! Test

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

As we all know Atmel always have errors in the datasheets, but this one I guess needs a warning.

In the pdf file of the AVR instructionset is very unclear of which (and directly wrong) instructions the different AVR has, but normally you can go the the datasheet and verify the instructions.

 

But if you follow the mega328PB datasheet it doesn't have the MOVW instruction!!! (I hope that's this just an datasheet error because someone found it funny to rearrange the instructions!! ).

 

 

Last Edited: Wed. Jan 13, 2016 - 04:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You'll just have to stick with your mentioned '324PB, then, since that datasheet >>does<< list MOVW. ;)

 

 

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

But that one you can't buy yet!

 

This are a warning for those that buy a 328PB today (perhaps because they need an extra USART).

 

 

 

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

And I can only guess how they have made Fig35-2 (current vs freq), it goes all the way to 20 MHz !, but I have always believed that was made with a crystal, but to fit the datasheet it must be with a external clk.

And that way they can show a lower current than the real one (with a crystal) 

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

In other datasheets, the corresponding figure has >>never<< included oscillator current.

 

From the datasheet for the ATmega48/88/168/328 family:

 

 

Other figures, such as the one showing consumption while operating with one of the internal RC oscillators (the 128 kHz watchdog oscillator, and the 8 MHz calibrated oscillator [both at 1 MHz and at 8 MHz]) of course do include the oscillator current, since it cannot be eliminated during test measurements (although it can be inferred by analysis).

 

Since different components (crystal, caps, and possible parallel resistor [not needed, but often seen in the wild]) will affect the oscillator current (as will different oscillator modes [low power v.s. full swing]), it makes little sense to try to capture that in single a datasheet figure.  It makes more sense to characterise the part under the controlled conditions of an external clock.

"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

sparrow2 wrote:

 

But if you follow the mega328PB datasheet it doesn't have the MOVW instruction!!! (I hope that's this just an datasheet error because someone found it funny to rearrange the instructions!! ).

 

 

I would think that would be a very bad thing. It must be a datasheet error.

The 328pb datasheet claims 131 powerful instructions just like the 328p.

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

Does anyone have the A version of the data sheet? MOVW is NOT shown in the current C version but it is shown in the rev B of the ATmega48PB/88PB/168PB.

 

The "good"?? news is that AS7 will assemble the instruction both for a 328PB and a 48PB of course whether it works it's another story.

 


                 ; Replace with your application code
                 start:
000000 9503          inc		r16
000001 01c8      	movw	r24,r16
000002 cffd          rjmp	start

RESOURCE USE INFORMATION
------------------------

Notice:
The register and instruction counts are symbol table hit counts,
and hence implicitly used resources are not counted, eg, the
'lpm' instruction without operands implicitly uses r0 and z,
none of which are counted.

x,y,z are separate entities in the symbol table and are
counted separately from r26..r31 here.

.dseg memory usage only counts static data declared with .byte

"ATmega48PB" register use summary:
r0 :   0 r1 :   0 r2 :   0 r3 :   0 r4 :   0 r5 :   0 r6 :   0 r7 :   0
r8 :   0 r9 :   0 r10:   0 r11:   0 r12:   0 r13:   0 r14:   0 r15:   0
r16:   2 r17:   0 r18:   0 r19:   0 r20:   0 r21:   0 r22:   0 r23:   0
r24:   1 r25:   0 r26:   0 r27:   0 r28:   0 r29:   0 r30:   0 r31:   0
x  :   0 y  :   0 z  :   0
Registers used: 2 out of 35 (5.7%)

"ATmega48PB" instruction use summary:
.lds  :   0 .sts  :   0 adc   :   0 add   :   0 adiw  :   0 and   :   0
andi  :   0 asr   :   0 bclr  :   0 bld   :   0 brbc  :   0 brbs  :   0
brcc  :   0 brcs  :   0 break :   0 breq  :   0 brge  :   0 brhc  :   0
brhs  :   0 brid  :   0 brie  :   0 brlo  :   0 brlt  :   0 brmi  :   0
brne  :   0 brpl  :   0 brsh  :   0 brtc  :   0 brts  :   0 brvc  :   0
brvs  :   0 bset  :   0 bst   :   0 cbi   :   0 cbr   :   0 clc   :   0
clh   :   0 cli   :   0 cln   :   0 clr   :   0 cls   :   0 clt   :   0
clv   :   0 clz   :   0 com   :   0 cp    :   0 cpc   :   0 cpi   :   0
cpse  :   0 dec   :   0 eor   :   0 fmul  :   0 fmuls :   0 fmulsu:   0
icall :   0 ijmp  :   0 in    :   0 inc   :   1 ld    :   0 ldd   :   0
ldi   :   0 lds   :   0 lpm   :   0 lsl   :   0 lsr   :   0 mov   :   0
movw  :   1 mul   :   0 muls  :   0 mulsu :   0 neg   :   0 nop   :   0
or    :   0 ori   :   0 out   :   0 pop   :   0 push  :   0 rcall :   0
ret   :   0 reti  :   0 rjmp  :   1 rol   :   0 ror   :   0 sbc   :   0
sbci  :   0 sbi   :   0 sbic  :   0 sbis  :   0 sbiw  :   0 sbr   :   0
sbrc  :   0 sbrs  :   0 sec   :   0 seh   :   0 sei   :   0 sen   :   0
ser   :   0 ses   :   0 set   :   0 sev   :   0 sez   :   0 sleep :   0
spm   :   0 st    :   0 std   :   0 sts   :   0 sub   :   0 subi  :   0
swap  :   0 tst   :   0 wdr   :   0
Instructions used: 3 out of 111 (2.7%)
                 ; Replace with your application code
                 start:
000000 9503          inc		r16
000001 01c8      	movw	r24,r16
000002 cffd          rjmp	start


RESOURCE USE INFORMATION
------------------------

Notice:
The register and instruction counts are symbol table hit counts,
and hence implicitly used resources are not counted, eg, the
'lpm' instruction without operands implicitly uses r0 and z,
none of which are counted.

x,y,z are separate entities in the symbol table and are
counted separately from r26..r31 here.

.dseg memory usage only counts static data declared with .byte

"ATmega328PB" register use summary:
r0 :   0 r1 :   0 r2 :   0 r3 :   0 r4 :   0 r5 :   0 r6 :   0 r7 :   0 
r8 :   0 r9 :   0 r10:   0 r11:   0 r12:   0 r13:   0 r14:   0 r15:   0 
r16:   2 r17:   0 r18:   0 r19:   0 r20:   0 r21:   0 r22:   0 r23:   0 
r24:   1 r25:   0 r26:   0 r27:   0 r28:   0 r29:   0 r30:   0 r31:   0 
x  :   0 y  :   0 z  :   0 
Registers used: 2 out of 35 (5.7%)

"ATmega328PB" instruction use summary:
.lds  :   0 .sts  :   0 adc   :   0 add   :   0 adiw  :   0 and   :   0 
andi  :   0 asr   :   0 bclr  :   0 bld   :   0 brbc  :   0 brbs  :   0 
brcc  :   0 brcs  :   0 break :   0 breq  :   0 brge  :   0 brhc  :   0 
brhs  :   0 brid  :   0 brie  :   0 brlo  :   0 brlt  :   0 brmi  :   0 
brne  :   0 brpl  :   0 brsh  :   0 brtc  :   0 brts  :   0 brvc  :   0 
brvs  :   0 bset  :   0 bst   :   0 call  :   0 cbi   :   0 cbr   :   0 
clc   :   0 clh   :   0 cli   :   0 cln   :   0 clr   :   0 cls   :   0 
clt   :   0 clv   :   0 clz   :   0 com   :   0 cp    :   0 cpc   :   0 
cpi   :   0 cpse  :   0 dec   :   0 eor   :   0 fmul  :   0 fmuls :   0 
fmulsu:   0 icall :   0 ijmp  :   0 in    :   0 inc   :   1 jmp   :   0 
ld    :   0 ldd   :   0 ldi   :   0 lds   :   0 lpm   :   0 lsl   :   0 
lsr   :   0 mov   :   0 movw  :   1 mul   :   0 muls  :   0 mulsu :   0 
neg   :   0 nop   :   0 or    :   0 ori   :   0 out   :   0 pop   :   0 
push  :   0 rcall :   0 ret   :   0 reti  :   0 rjmp  :   1 rol   :   0 
ror   :   0 sbc   :   0 sbci  :   0 sbi   :   0 sbic  :   0 sbis  :   0 
sbiw  :   0 sbr   :   0 sbrc  :   0 sbrs  :   0 sec   :   0 seh   :   0 
sei   :   0 sen   :   0 ser   :   0 ses   :   0 set   :   0 sev   :   0 
sez   :   0 sleep :   0 spm   :   0 st    :   0 std   :   0 sts   :   0 
sub   :   0 subi  :   0 swap  :   0 tst   :   0 wdr   :   0 
Instructions used: 3 out of 113 (2.7%)

 

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Fri. Jan 8, 2016 - 02:32 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Removing MOVW? Come on, that would be too much. Even for Atmel. (Let's see - there are lots of MOVW's in the .lst file, and the whole thing still seems to work (on 328PB)).

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

js wrote:

Does anyone have the A version of the data sheet? MOVW is NOT shown in the current C version but it is shown in the rev B of the ATmega48PB/88PB/168PB.

 

Atmel- 42397A-8-bit AVR Microcontroller_Datasheet_Preliminary-07/2015

 

Does NOT show MOVW but it states there are 131 instructions.

I would think removing MOVW from the 328PB chip might be a lot of work just to make the chip incompatible.

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

It may just be a broken die so they give you the "new and improved" PB version??

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly