How to config serial pins in A-Star 328PB?

I've begun using this chip (from Pololu) as I needed extra pins - ran out on the Nano.

Now I'd like to use one of the built in serial ports on this chip, but have found no info on how to do this in the Arduino IDE. From the Atmega datasheet - I see there are pins for USART0 and USAR1 but don't know how to set their baud rate or access Rx/Tx data.

Ideas?

=A.

Please post a link to the Atmega datasheet.

...R

If you're using minicore, uart0 is Serial and uart1 is Serial1, they work the same as on normal arduino boards

If you're using some other core, it's probably the same, but I can only speak to minicore

:slight_smile: Heh - just found this on the Pololu site:

Here are some details about what Arduino features work when programming the A-Star 328PB in the Arduino IDE:

The Serial and Serial1 objects both work, providing access to USART0 and USART1, respectively.

There is no library support for accessing the ATmega328PB’s second I2C module (TWI1), or its second SPI module (SPI1).

However, you can access the registers for those new modules and define ISRs for them.

pinMode, digitalRead, and digitalWrite should work on every I/O pin (including A6, A7, SDA1, and SCL1).
analogRead should work on every analog pin (A0 through A7).
analogWrite should work on every pin with PWM (including 0, 1, and 2).

Robin2:
Please post a link to the Atmega datasheet.

...R

Here is the link: http://ww1.microchip.com/downloads/en/DeviceDoc/40001906A.pdf
It only shows the surface-mount pin out, so go to the Pololu site for a nice diagram of the boar

Full datasheet
Summary

You need a core/board package as well.

DKWatson:
Full datasheet
Summary

You need a core/board package as well.

Yes- I am using the A-Star 328PB from Pololu. I have set up a quick test and AM sending data on pin 11 (PB3). Nice board - but be sure your USB port for programming connection has good power - I fought using USB from the front panel for quite a while... They just seemed to constantly disconnect. Now working at 56700 Baud - all is well.

Harrzack:
:slight_smile: Heh - just found this on the Pololu site:

Here are some details about what Arduino features work when programming the A-Star 328PB in the Arduino IDE:

The Serial and Serial1 objects both work, providing access to USART0 and USART1, respectively.

What a shocker.

Pololu provide the documentation on how to use their own products !