ARDUINO UNO R3 MICROCONTROLLER (uC) BOARD
Arduino Uno R3 is a 5v board.
Arduino Uno R3 with the ATmega328P uC chip supports 20mA of current per pin (200mA for the board).
Exceeding this, i.e. 40+mA per pin, may cause unusual operation or device failure.
Arduino Uno R3 (ATmega328P microcontroller) specs:
- Flash memory: 32KB for your programs, bootloader uses 0.5KB
- SRAM: 2KB for global variables defined before your "void setup()" statement
- EEPROM: 1KB for permanent storage between reboots, like high scores, etc.
- Speed: 16MHz
- Digital I/O pins: 14 (6 can provide PWM output)
- Analog Input pins: 6 (can be used as Digital I/O pins)
Inexpensive Nokia 5110 graphic displays are 3.3v.
Do NOT connect the Nokia to Uno unless you're using a logic level shifter for each pin.
There are different types of level shifters (5v to 3.3v and 3.3v to 5v): one vendor may use a chip like the CD4050 and another may use a small breadboard-compatible board.
- Example 1: https://learn.adafruit.com/nokia-5110-3310-monochrome-lcd/wiring
- Example 2: https://solarbotics.com/product/50550
Note: The Nokia displays are taken out of dated Nokia phones and attached to a circuit board with the pins broken out and labelled. Very seldom do two vendors agree on the pin layout.
Right now I am staring at 3 different SPI-based Nokia 5110 graphic display boards; their pinouts are different. This matters if you decide to follow Example 1 above because some of the pins have changed position.
Here are their pinouts:
- Adafruit #338, left to right from rear side:
- 1 GND
- 2 VCC
- 3 CLK (SCLK)
- 4 DIN (MOSI)
- 5 D/C
- 6 CS (SS)
- 7 RST
- 8 LED (Backlight) Make sure this pin has a 220ohm to 470ohm current limiting resistor between it and your Arduino.
- Sparkfun #LCD-10168, right to left from rear side:
- 1 VCC
- 2 GND
- 3 SCE (SS)
- 4 RST
- 5 D/C
- 6 DN (MOSI)
- 7 SCLK
- 8 LED (Backlight)
- China, right to left from rear side:
- 1 RST
- 2 CE (SS)
- 3 DC
- 4 DIN (MOSI)
- 5 CLK (SCLK)
- 6 VCC
- 7 BL (Backlight)
- 8 GND
SHRINK YOUR PROJECT
Sparkfun/Arduino Pro Mini 328 is available as a 3.3v (or 5v) board, has most of the Uno R3 features, is considerably smaller in size, and fits in a breadboard.
This makes it ideal for portable projects including connecting to a cheap Nokia display.
Note: The Pro Mini does not have a USB connector like on the Arduino Uno R3 so you'll need either a 3.3v FTDI cable or a 3.3v FTDI basic breakout board. You attach a USB Mini cable to the breakout board that you attached to the Pro Mini board.
SHRINK YOUR PROJECT FURTHER WITH THE ATTINY85
The Atmel ATtiny85 is a tiny 8-pin chip-only version of the Arduino Uno. If you only need basic functionality, then this may be right for you.
When you connect your Uno to your PC, the program you create on your PC/MAC, etc., is compiled into a binary form and then is sent to the Uno over the USB cable.
Arduino Uno R3 has a separate chip that does the USB conversion to hardware serial UART for the ATmega328P uC chip.
- Note that the newest generation of Arduino compatibles using the n ew SAMD21 or ESP32 chipsets have built-in USB support so a separate USB chip is not needed.
- Also, they only support 3.3v which is ideal for the peripherals becoming available.
The Atmel ATtiny85 chip does not have USB functionality so you will need to program it some other way. Typically, this is done by using an Arduino Uno R3 as an ISP, an in-system programmer.
- This link will illustrate what you need to do; follow it exactly. http://highlowtech.org/?p=1706
- The process can be modified slightly to accommodate the 14-pin ATtiny84 chip
Once you have created the ISP, you will then need to connect it to a breadboard containing the ATTiny85 or 84 you wish to program.
- This link will illustrate what you need to do; again, follow it exactly. http://highlowtech.org/?p=1695
Several vendors make Tiny AVR Programmers so you don't have to configure your Uno to do the job.
- Here's a link to one of them: https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/attiny85-use-hints
Here's a great reference doc for the ATtiny85: https://cdn.sparkfun.com/assets/2/8/b/a/a/Tiny_QuickRef_v2_2.pdf
RUNNING OUT OF ROOM
There are many graphics libraries out there. Many gobble up your Flash RAM which may make it hard for your programs to work reliably.
Take the time to assess your needs - do you really need graphics? Will just three text font sizes work? Will you be building your own text fonts?
- Can you get by with just the built-in LiquidCrystal.h/.cpp library?
- Do you need the display chip driver, e.g. PCD8544, and Adafruit GFX graphics library?
- Here's a link to a video comparing LCD display libraries, size and speed: Adafruit 30ms/10.5KG, U8GLIB 22ms/8.2KB, Basic 7ms/4KB
Using the standard SD card library may use up a lot of your SRAM that is needed for global variables. You may want to look at smaller SD card storage libraries.
- Examples: https://forum.arduino.cc/index.php?topic=121753.0
2018-12-14: I just found about this very small and very fast colour graphic driver for the ATtiny85. See the article and code here.
If your Arduino Uno R3 just doesn't have the program storage or global variables storage you need, it's time to think about upgrading to the next generation uC.
- Uno uses the Atmel ATmega328 microprocessor.
Next generation boards include Atmel (now Microchip) SAMD21 and Espressif ESP-WROOM-32 or ESP32 for short.
Several vendors have stuck with the Atmel product line and are now using the ARM Cortex-M0+ based MCU. Some specs include:
- 48MHz not 16MHz (M4 is 120MHz)
- 3.3v not 5v
- 256KB Flash not 32KB
- 32KB SRAM not 2KB
- Lower power consumption
- Up to 6 serial communication modules (not 1) for I2C, SPI, I2S
- Full-speed USB device and embedded host, no separate USB/UART chip needed
- Many 12-bit ADCs
- Hardware touch support