Mastering Microcontrollers Helped by Arduino (3rd Revised Edition)

Page 36

13. 13.1

Elektor Uno R4 Four pins make all the difference

When a manufacturer releases a B version of an existing product the differences between the old and the new are usually small. Not so in the case of the new ATmega328P, the processor at the heart of the Arduino Uno R3. The B-type of this MCU, the ATmega328PB, features new peripherals justifying a new revision of the Arduino Uno R3. Please meet the Elektor Uno R4.

13.2

From A to B

At the end of 2014 Atmel (now Microchip) introduced ‘B’ versions of some of its more popular AVR microcontrollers: the ATmega48PB, -88PB and -168PB. Even though the B-types are not drop-in replacements for the older models, the differences with the non-B versions were not spectacular. The most noticeable new feature – besides the lower price – was the addition of a 4-bit port E, implying that these chips would only be available in 32-pin packages. B-types can run programs compiled for non-B types, but the inverse is not necessarily true. Then, some six months after the introduction of the first three B-types, came the ATmega328PB and things suddenly became interesting. Unlike its three little B-rothers, the B-version of the ATmega328P really does have more to offer than the non-B (see Table 13-1). To start with, the B-type is only available in 32-pin packages and so it has four pins extra compared to the classic 28-pin DIP ATmega328P. These four extra pins now expose the new GPIO port E. On previous 32-pin packages the extra pins were two extra analogue inputs, VCC and GND. As before, the four extra pins also connect to the two additional analogue inputs but now they also connect to a second I²C peripheral, to a part of a second SPI peripheral, to the output of the analogue comparator and to the outputs of timers 3 and 4. The changes do not stop at port E and its multiplexed functions, there is more. Did I mention the second USART? Yes, there are two of these now. Furthermore, the device has gained two 16-bit timers increasing the number of PWM channels to 10, and it has been equipped with an output compare modulator (OCM) for the

389


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.