Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ATMega ports / features - clarification

3 views
Skip to first unread message

Dan Purgert

unread,
Jul 16, 2019, 12:12:14 PM7/16/19
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


I'm about on the brink of expanding past the point of "self-contained
widgets", and into using SPI / I2C / general serial over U(S)ART.

Just to make sure I'm understanding things properly, if we take a look
at the ATMega32u4 datasheet, it says it has

- USB
- 1x USART
- 1x SPI

So, if I was going to use this for something, would it mean that I could
use all three of those features independently? For example,
Communicating to the 32u4 over USB, while having it communicate to some
other chips doing other things via RS485?

Or is it that I can use USB OR USART OR SPI in a project?

Thanks!

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl0t91sACgkQjhHd8xJ5
ooGEqgf/XSIh2EyVgys0EPYM6E87B1yq/+9IJ6Pke32k1ho+zMvs8o9h6luodG2i
btzOk6xcHcDrqtubGF/ywEdI3JVsmUuCs9RDhrQ+dXxvWcF7vFQN5wJ08AFIXXXO
GkdgaSrAJBpjIB3d1RLiebwAgApxQom7WY8WrZqa9pL3/m3XJJ0Ce7hh1LuWpqkg
XM6bZ2CAj1uF5G7o2bm8ylhO66DXwjajtJJpSYUECnWEgoe6JF7isropPa9SbHMp
tvJNw94EegzfCmEGjD3x6AZqTWzjBJ+EvHdUtgVnr485ucSq3s8ySB5hh0ilHCRG
N0Y6QLlqown8eSwuMiNucE1mepdP1Q==
=NKu+
-----END PGP SIGNATURE-----

--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281

Josef Moellers

unread,
Jul 17, 2019, 4:09:01 AM7/17/19
to
>
> I'm about on the brink of expanding past the point of "self-contained
> widgets", and into using SPI / I2C / general serial over U(S)ART.
>
> Just to make sure I'm understanding things properly, if we take a look
> at the ATMega32u4 datasheet, it says it has
>
> - USB
> - 1x USART
> - 1x SPI
>
> So, if I was going to use this for something, would it mean that I could
> use all three of those features independently? For example,
> Communicating to the 32u4 over USB, while having it communicate to some
> other chips doing other things via RS485?

That is correct (but the data sheet has the last word)!

USB: D- and D+ are separate pins.
USART: RXD1 and TXD1 are special functions of port D bits 2 and 3
SPI: MISO, MOSI and SCK are special functions of port B bits 1, 2, and 3

So: yes, you can use all three independently and "at the same time".

(but: no, you couldn't use port D bits 2 and/or 3 together with the UART
and/or port B bits 1, 2, and/or 3 together with SPI).

Josef

signature.asc

Dan Purgert

unread,
Jul 17, 2019, 10:27:39 AM7/17/19
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Josef Moellers wrote:
>>
>> I'm about on the brink of expanding past the point of "self-contained
>> widgets", and into using SPI / I2C / general serial over U(S)ART.
>>
>> Just to make sure I'm understanding things properly, if we take a look
>> at the ATMega32u4 datasheet, it says it has
>>
>> - USB
>> - 1x USART
>> - 1x SPI
>>
>> So, if I was going to use this for something, would it mean that I
>> could use all three of those features independently? For example,
>> Communicating to the 32u4 over USB, while having it communicate to
>> some other chips doing other things via RS485?
>
> That is correct (but the data sheet has the last word)!

Yeah, my main confusion stems out of generally sticking to ATTiny x5
chips, which only have that "USI" port (so SPI OR TWI OR ...), as
opposed to the more feature-rich chips.

So, figured it better to ask, before making misinformed errors.

Thanks again!

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl0vMFoACgkQjhHd8xJ5
ooGIHQf8DiuWlMs2X0wjWiGYNgvX8J4eIJyHQ6KopMOy3w1wW9Hn61LkPIb6iNqU
oX7V4cwvQX66nBnK8GDpdyYQdSAu9nBcVM525ImiSHdyfQwEnEnktoupm2dQEOkg
BgTECGmGP4V7Q/FrQLHoq9yn6NvHtJJekEt7v7S5VSS0+MxQIEXJl4VEpssOJ3cR
BjzUMmLPVQqsOf0G3jcqIixfuKlzskWxfqKI7LP7XpBnU35TviB0T6T+lZCYAv+2
D6x4vhHgz+y+yZxUu0sCPGUkABYfn4xfrYxzU6ioknqU0Znx4nPgmie7VJ/2enig
LkHH9s5h6juN4wl4MKmAoK0IWCKiKQ==
=mICz
0 new messages