beautypg.com

Motors, Pushbuttons, Buzzer – Pololu Orangutan LV-xx8 User Manual

Page 9: Leds

background image

Motors

The motor drivers are controlled by the AVRs hardware PWM outputs on eight-bit timers 0 and 2, which lets you
achieve variable motor speeds using hardware rather than processor-intensive software PWMs on the motor control
lines. The two Timer0 PWM outputs connect to both of motor 1’s direction inputs and the two Timer2 PWM
outputs connect to both of motor 2’s direction inputs. Note that one of the motor control pins (PB3) is also used
during programming as a SPI line (MOSI), which this means that you cannot use SPI on the Orangutan without
unintentionally driving one of the motors. Programming the Orangutan does not drive the motors because the motor
driver circuitry is disabled while the board is reset.

LCD

The Orangutan is supplied with a removable 8×2 character LCD that uses the common

HD44780 parallel interface

[http://www.pololu.com/file/download/DMC50448N-AAE-AD.pdf?file_id=0J71]

(109k pdf); a larger display can be connected

instead with an appropriate cable. The ATmegaxx8 has four I/O lines connected to LCD data lines DB4 – DB7 (i.e.
is configured to use the LCD in 4-bit mode) and three I/O lines connected to the three LCD control lines RS, R/W,
and E. Please see the schematic for more information. Please note that the LCD data lines are also shared by the user
pushbuttons, the green user LED, and the programming connector.

Pushbuttons

The Orangutan has five total pushbuttons: a power on/off button located on the right side of the bottom edge of the
board, a reset button located on the left side of the bottom edge of the board, and three user pushbuttons along the left
edge of the board. Please note that the power button turns off power to the entire board, and the reset button connects
directly to the ATmegaxx8’s reset pin. The user buttons, from top to bottom, are on pins PB5, PB4, and PB1. Pressing
one of these user pushbuttons pulls the associated I/O pin to ground through a 1kΩ resistor, so to use the buttons
you should configure them as inputs with their internal pull-up resistors enabled. Note that pushbuttons physically
bounce when pressed, so make sure you take this phenomenon into account when writing your button-handling code.
Additionally, since the LCD and pushbuttons share I/O lines, the LCD lines must be in high-impedance mode (i.e.
both the AVR and the LCD should not be trying to write to the lines) for you to be able to read the pushbuttons.

Note: The user pushbuttons lines are shared by the programming connector, so you should not press
the user pushbuttons while your Orangutan is being programmed.

Buzzer

The buzzer is on pin PB2, which can be used as a normal digital I/O or configured as a hardware PWM output driven
by the ATmegaxx8’s 16-bit Timer1. If you alternate between driving the buzzer pin high and low at a given frequency,
the buzzer will produce sound at that frequency. By taking advantage of the hardware PWM output on the buzzer pin,
you can have the buzzer playing in the background while the rest of your program executes. Please see the buzzer
section of the

Pololu AVR library

[http://www.pololu.com/docs/0J20]

for more information.

LEDs

The Orangutan comes with a blue power LED (located next to the power button) and two user LEDs: one red and one
green. The red user LED is located next to the reset button and is on the user I/O line PD1; it will light if you set PD1
as a high output. The green user LED is located between the user I/O header and the LCD and is connected to pin
PD7; it will light if you set PD7 as a high output. Note that PD7 is also used as an LCD data line, so you will see the
green LED flicker when you update the LCD.

Pololu Orangutan SV-xx8 and LV-xx8 User's Guide

© 2001–2014 Pololu Corporation

4. Module Pinouts, Component Identification, and Usage Notes

Page 9 of 18

This manual is related to the following products: