pololu 32u4 tft display factory
We recently released the A-Star 32U4 Micro, which we think is the best available AVR breakout board for its size. If you are like us, you enjoy taking factory tours, seeing how things are made on
For more videos like these, see our YouTube playlist: Pololu manufacturing: how our products are made and subscribe to our channel. By the way, you can still get a free A-Star Micro with your order over $100.
That TFT LCD display from Adafruit uses SPI to communicate. You should be able to use the SPI pins on the ISP header on the A-Star to communicate with that display. You might find the diagram below helpful for using those pins (we will try to add this to the user’s guide soon).
We are very excited to announce that the 3pi+ 32U4 OLED Robot is now available! This is an updated version of the original 3pi+ 32U4 Robot that replaces the old LCD with a monochrome 128×64 OLED display, giving it the ability to display fancy high-contrast graphics while following a line course, navigating a maze, or doing whatever it is that you want this compact but versatile mobile platform to do.
For more than 16 years, starting with some of our oldest products (from well before I joined Pololu), we have used HD44780-compatible alphanumeric liquid crystal displays on our robots and robot controllers. These LCDs have been around forever and are limited to displaying simple text on a fixed grid, but they are also ubiquitous: there are plenty of manufacturers still making displays that use the standard HD44780 interface.
It’s unlikely that we would have much difficulty sourcing this kind of display any time soon (as long as the pandemic doesn’t mess things up too badly), so using them in our products has always been a safe option despite their graphical limitations. The original 3pi+ 32U4 that we released late last year was our most recent design to include LCD support.
Meanwhile, monochrome organic light-emitting diode (OLED) displays have become increasingly popular in electronics over the last decade or so, and it’s not hard to see why: you can draw graphics on them, they can fit more information on the screen, they’re easier to read in the dark, and they just plain look cooler. But even though you might be able to go to eBay or Amazon and order a cheap OLED display for your project when you want one, it’s critical that we find a dependable supplier for a component like this before we can start to design it into our products.
That is why the availability of the 1.3″ OLED module we announced recently was actually a pretty big deal for us: it means that we finally have a source that we can rely on for larger quantities of these displays. The 3pi+ 32U4 OLED is the first of what we hope will be many robots and control boards that make use of the graphical capabilities offered by an OLED screen.
For anyone who wants to use different motors than the options above, the 3pi+ 32U4 OLED control board is likewise available separately and can be combined with a 3pi+ chassis and a pair of motors to build a custom robot.
We will be phasing out the original 3pi+ 32U4 robots and kits (they will remain available by special order), but that does not mean the old versions are suddenly obsolete or that you will have to learn an entirely new platform to use the new OLED version. Aside from the display interface, the hardware on the LCD and OLED versions is exactly the same, with features including encoders, line sensors, front bump sensors, and a full IMU (inertial measurement unit).
From a software perspective, it can actually be pretty challenging to work with graphics, especially on a small processor like the ATmega32U4. The simplicity of a text LCD can be an advantage in that you can essentially just ask it to do something like printing the letter “A” on the first column of the second row. On a graphical display, even if you just want to show some text, you have to define the shape of the letter in pixels; optionally composite that shape into a memory buffer; and then send the complete pixel data to the display. That means you have a lot more control over how that letter “A” is shown, but it takes a lot more work to do it.
To help get you started, we’ve developed an LCD compatibility layer as part of our Arduino library for the 3pi+ 32U4. This makes it easier to use the OLED screen for common display tasks, and it’s straightforward to write programs that will work on either version of the robot with minimal changes, since you can update an existing program to run on the OLED version by changing just a single line of code.
We plan to continue improving our libraries to give you more options for efficiently working with both text and graphics on an OLED display; stay tuned for updates!
This diagram identifies the I/O and power pins on the A-Star 32U4 Prime (LV and SV versions); it is also available (along with the power distribution diagram below) as a printable PDF (1MB pdf). For more information about the ATmega32U4 microcontroller and its peripherals, see Atmel’s ATmega32U4 documentation.
The outermost rows of pins of the A-Star 32U4 Prime correspond to the pins on an Arduino Leonardo, and each is duplicated on a second inner row for more convenient access. Printed on the A* circuit board are indicators that you can use to quickly identify each I/O pin’s capabilities: a triangle by the inner through hole means the pin can be used as an analog input, and a square wave symbol next to the hole pair means the pin can be used as a PWM output.
The A-Star 32U4 Prime matches the Arduino Leonardo and the Arduino Uno R3 in the shape of its circuit board and the arrangement of its pins. Furthermore, it uses the same ATmega32U4 microcontroller as the Leonardo, running at the same voltage and frequency, so the A* should generally work with any shield or accessory that is compatible with the Leonardo (including our Zumo Robot for Arduino).
A yellow user LED is connected to Arduino pin 13, or PC7. You can drive this pin high in a user program to turn this LED on. The A-Star 32U4 Bootloader fades this LED on and off while it is waiting for a sketch to be loaded.
A green user LED is connected to PD5 and lights when the pin is driven low. While the board is running the A-Star 32U4 Bootloader or a program compiled in the Arduino environment, it will flash this LED when it is transmitting data via the USB connection.
A red user LED is connected to Arduino pin 17, or PB0, and lights when the pin is driven low. While the board is running the A-Star 32U4 Bootloader or a program compiled in the Arduino environment, it will flash this LED when it is receiving data via the USB connection.
The AStar32U4Prime library contains functions that make it easier to control the three user LEDs. All three user LED control lines are also LCD data lines, so you will see them flicker when you update the LCD. The green and red user LEDs also share I/O lines with pushbuttons (see below).
The A-Star 32U4 Prime has four pushbuttons: a reset button next to the power switch and three user pushbuttons located along the right edge of the board. The user pushbuttons, labeled A, B, and C, are on Arduino pin 14 (PB3), PD5, and Arduino pin 17 (PB0), respectively. Pressing one of these buttons pulls the associated I/O pin to ground through a resistor.
The three buttons’ I/O lines are also used for other purposes: pin 14 is MISO on the SPI interface, PD5 and pin 17 control the green and red user LEDs, and all three pins are LCD data lines. Although these uses require the pins to be driven by the AVR (or SPI slave devices in the case of MISO), resistors in the button circuits ensure that the A-Star will not be damaged even if the corresponding buttons are pressed at the same time, nor will SPI or LCD communications be disrupted. The functions in the AStar32U4Prime library take care of configuring the pins, reading and debouncing the buttons, and restoring the pins to their original states.
The assembled versions of the A-Star 32U4 Prime come with a buzzer that can be used to generate simple sounds and music. The buzzer is not present on the SMT-only versions, but the buzzer driver circuit is still populated, allowing you to solder in your own buzzer or speaker. The stock buzzer is available as part of the A-Star 32U4 Prime accessory pack.
A through-hole jumper next to the buzzer provides a way to connect the buzzer input to digital pin 6 (which also serves as OC4D, a hardware PWM output from the AVR’s 10-bit Timer4). If you alternate between driving the buzzer pin high and low at a given frequency, the buzzer will produce sound at that frequency. You can play notes and music with the buzzer using functions in the AStar32U4PrimeBuzzer library.
Some versions of the A-Star 32U4 Prime include an onboard microSD card connector that enables the microcontroller to read from and write to microSD memory cards. The card socket is connected to the SPI interface on the ATmega32U4 through level-shifting circuits, allowing the 5 V microcontroller to safely communicate with standard 3.3 V SD cards. DI, DO, and SCLK on the card are connected to MOSI, MISO, and SCK on the AVR, respectively. The Arduino SD library can be used to access the file system on an inserted microSD card.
The A-Star 32U4 Prime has a mounting location for a 2×7 header where you can connect a character LCD with the common HD44780 parallel interface (109k pdf). The A* is optionally available with a male header installed here and an 8×2 character LCD (with corresponding female header) included; on other versions, you can add your own display using the connectors of your choice. A larger LCD can be connected with a ribbon cable and optionally a shrouded box header.
The LCD control lines are broken out to a column of through holes next to the LCD connector, labeled on the back side of the board. By default, some of these are connected to I/O lines from the ATmega32U4 to allow control of the LCD in 4-bit mode, but you can remap the connections by cutting the surface-mount jumpers indicated in the picture below and making new connections between I/O lines and LCD control pins.
The AStar32U4PrimeLCD library provides functions to display data on a connected LCD. It is designed to gracefully handle alternate use of the LCD data lines by only changing pin states when needed for an LCD command, after which it will restore them to their previous states. This allows the LCD data lines to be used for other functions (such as pushbutton inputs and LED drivers).
The A-Star 32U4 includes a USB Micro-B connector that can be used to connect to a computer’s USB port via a USB A to Micro-B cable (not included). The USB connection can be used to transmit and receive data from the computer, and a preloaded USB bootloader makes it possible to program the board over USB. The USB connection can also provide power to the A-Star.
The A-Star 32U4 Prime can either be powered directly from the USB 5 V supply or from an external voltage source, which is regulated to 5 V by its onboard switching regulator. The slide switch on A* controls whether the external source is connected to the input of the regulator, providing a convenient way to switch off external power to the A-Star without unplugging any connections. The adjacent set of three pins provides a place to connect your own power switch: to enable external power, connect the middle pin to ground (accessible through the upper pin).
In some situations, it might be undesirable for the A-Star 32U4 Prime to draw power from an external source when it is connected to USB, even if the power switch is left on. If this is the case, the regulator can be disabled by driving the regulator shutdown pin, SHDN, high; this shuts down the regulator and causes the power mux to fall back to USB power. For example, this could allow a battery-powered system to automatically turn off the regulator while it is connected to a computer.
When the A-Star 32U4 Prime is being powered through Power In, the sum of the 5V output current, 3V3 output current, GPIO output current, and current used by the board itself should not exceed the maximum current that the switching regulator can provide.
In a battery-powered application, it might be useful for the A-Star to monitor the battery’s voltage level. The BATLEV pin provides access to a voltage divider that outputs a fraction of the VIN voltage (one-third on the ac03b LV, one-fourth on the ac03e LV, and one-eighth on the SV), and this voltage can be read by connecting it to the adjacent analog pin 1 (A1) (or another analog input). The readBatteryMillivoltsLV3(), readBatteryMillivoltsLV4(), and readBatteryMillivoltsSV() functions in the AStar32U4 library can be used to determine the battery voltage from this reading.
The 3pi+ 32U4 is a versatile, high-performance, user-programmable robot that measures just 9.7 cm (3.8″) in diameter. At its heart is an ATmega32U4 AVR microcontroller from Microchip (formerly Atmel), and like our A-Star 32U4 programmable controllers, the 3pi+ 32U4 features a USB interface and ships preloaded with an Arduino-compatible bootloader, so all you need to program it is a USB A to Micro-B cable (not included). A software add-on is available that makes it easy to program the robot from the Arduino environment, and we have Arduino libraries and example sketches to help get you started. For advanced users who want to customize or enhance their robots with additional peripherals, the robot’s power rails, power system controls, and microcontroller’s I/O lines can be accessed via several 0.1″-pitch expansion ports.
The 3pi+ (or 3