ATMega328PB: some questions

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

While digging through the ATmega328PB datasheet (rev C) some questions came up that i hope someone here might be able to answer:

 

 

  1. Power Reduction Register:
    Looking at "14.11. Register Description" it seems that Timer3 and Timer4 as well as TWI1 can not be powered down.

     

    I wonder if there actually is a second Power Reduction Register that is just missing in the datasheet?

     

  2. Timer Prescaler
    Although "21. Timer/Counter0 and Timer/Counter1,3,4 Prescalers" states that Timers 0, 1, 3 and 4 share the same prescaler,
    the description of "Bit 0 – PSRSYNC: Prescaler Reset" in "21.4.1. General Timer/Counter Control Register" only mentions Timer 0 and 1.

     

    Can anyone confirm that PSRSYNC actually also affects the prescaler of Timer 3 and 4?

 

 

Thanks,

Bertolt

Last Edited: Thu. Jun 2, 2016 - 07:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry but where in the 328P datasheet does it say anything about having Timers 3 and 4 ?? It has 3 timers. Timer 0 and Timer2 are 8 bit and Timer 1 is 16 bit.

 

It's not until you reach the real big models of AVR (or Xmega) that you start seeing more than 3 timers.

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

Cliff, i think the PB is a new device with two uarts and other goodies.

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

The atdf has information about PRR1 so I guess it's there. I'll check why it's not in the datasheet

 

        <register caption="Power Reduction Register 1" name="PRR1" offset="0x65" size="1" ocd-rw="R">
          <bitfield caption="Power Reduction TWI1" mask="0x20" name="PRTWI1"/>
          <bitfield caption="Power Reduction Peripheral Touch Controller" mask="0x10" name="PRPTC"/>
          <bitfield caption="Power Reduction Timer/Counter4" mask="0x08" name="PRTIM4"/>
          <bitfield caption="Power Reduction Serial Peripheral Interface 1" mask="0x04" name="PRSPI1"/>
          <bitfield caption="Power Reduction Timer/Counter3" mask="0x01" name="PRTIM3"/>
        </register>

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

Kartman wrote:
Cliff, i think the PB is a new device with two uarts and other goodies.

Ah ha - missed the "B" there! blush

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

@MannImMond:

 

Ah, yes!

PRR1 is present in iom328pb.h as well as in the I/O viewer!

 

Thanks a lot!

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

MannImMond wrote:
I'll check why it's not in the datasheet

Y'all just need to use the Summary datasheet, I guess. ;)

 

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

I am starting a new project using the ATmega328PB and am having some problems with the datasheet (Rev C-10/2015).
Specific problems are:

  •   XCK1 is not shown in pinout or alternate functions

(XCK0 is shown twice in the pinout, so I expect pin 2 (PD4) 17 (PB5) should be XCK1?)

  •   Table 20-6 Waveform Generation Mode Bit Description (Timers 1, 3 & 4)

For several instances of "TOP", ICR1 and OCR4A are given.
      (I suspect that these should have been ICRn and OCRnA?)

 

Does anyone know if there is an errata for the ATmega328PB datasheet?
Do any freaks have experience with the device?

 

David (aka frog_jr)

Last Edited: Tue. Jun 14, 2016 - 01:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

frog_jr wrote:
Do any freaks have experience with the device?

There are a few threads where stuff like your questions was discussed...

 

Have you looked in the XML file, and/or header files for your toolchain?

 

Some [perhaps] pertinent mention here https://www.avrfreaks.net/forum/i... and here https://www.avrfreaks.net/forum/o...

 

Might be pertinent stuff (e.g. getting the part pack)...

https://www.avrfreaks.net/forum/a...

https://www.avrfreaks.net/forum/e...

https://www.avrfreaks.net/forum/m...

https://www.avrfreaks.net/forum/a...

 

 

 

 

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

@Lee, Thanks for all the links; however, I had seen most of them.

I am in process of defining hardware interfaces and I need 2 UARTs, 1 SPI, 1 TWI a couple of PWMs (at least 1 16-bit) and 10 GPIOs.

This is interfacing to 5V components, so XMEGA and SAM are out...

The 'PB appears to fit the bill, but I don't want to design it in only to find my assumptions about the datasheet are false...

David (aka frog_jr)

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

frog_jr wrote:
This is interfacing to 5V components, so XMEGA and SAM are out...
A few of the SAM C have become in-stock.

http://www.atmel.com/products/microcontrollers/arm/sam-c.aspx

https://octopart.com/search?q=atsamc21&start=0

 

"Dare to be naïve." - Buckminster Fuller

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

gchapman wrote:
A few of the SAM C have become in-stock

I will have to check into these...

David (aka frog_jr)

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

Why do you need more than 8 MHz ? (or 7372800)

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

Reported internally

Xck1 should be pb5 though, the way I read the datasheet

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

MannImMond wrote:
Xck1 should be pb5

You're right, looking at block diagram, I can see that (which I previously missed).

I had been studying the pin configuration which shows XCK0 on PD4 and PB5.

 (I'm not sure why I thought XCK1 on PB5?) (I just edited my original post #8 accordingly.)

David (aka frog_jr)

Last Edited: Tue. Jun 14, 2016 - 01:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

frog_jr wrote:
Specific problems are: XCK1 is not shown in pinout or alternate functions (XCK0 is shown twice in the pinout, so I expect pin 2 (PD4) 17 (PB5) should be XCK1?)

From the datasheet:

I was curious, so downloaded the "part pack".  ATmega328PB.atdf doesn't have any XCK anywhere that search can find.  I guess pin functions are not part of .atdf

 

bmildner wrote:
Can anyone confirm that PSRSYNC actually also affects the prescaler of Timer 3 and 4?

The .atdf doesn't state it.  But I guess that bit could well affect all the prescalers?

  <register caption="General Timer/Counter Control Register" name="GTCCR" offset="0x43" size="1">
          <bitfield caption="Timer/Counter Synchronization Mode" mask="0x80" name="TSM"/>
          <bitfield caption="Prescaler Reset Timer/Counter1 and Timer/Counter0" mask="0x01" name="PSRSYNC"/>
        </register>
     

 

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.