User Manual

}
}
}
// Local Variables: **
// mode: C **
// c-basic-offset: 4 **
// tab-width: 4 **
// indent-tabs-mode: t **
// end: **
3.j. Orangutan SVP Functions
Overview
The Orangutan SVP [https://www.pololu.com/product/1325] is based on the AVR ATmega324 or ATmega1284
processor. It has an auxiliary processor that provides the USB connection, five configurable input lines, and
battery voltage reading. Several parts of the Pololu AVR C/C++ Library have built-in support for using the
auxiliary processor, so you will not need to worry about the details of the Serial Peripheral Interface (SPI)
protocol used to talk to the auxiliary processor. If you are curious about the details of the SPI protocol, you can
read the C++ source code of the library.
Complete documentation of the SVP-specific functions can be found in Section 13 of the Pololu AVR Library
Command Reference [https://www.pololu.com/docs/0J18].
An overview of the analog input functions, which support reading the analog inputs on the SVP’s auxiliary
processor, can be found in Section 3.a. An overview of the serial port communication functions, which support
sending and receiving bytes from the computer via the auxiliary processors USB connection, can be found in
Section 3.h.
Setting the mode
One of the first things to think about when writing a program for the SVP is what mode you want the auxiliary
processor to be in.
If you want to use quadrature encoders, you can use the SVP_MODE_ENCODERS mode and let the auxiliary
processor handle the readings from two quadrature encoders on lines A, B, C and D/RX.
If you want to maximize the number of analog inputs available, you can use the SVP_MODE_ANALOG mode
which makes A, B, C, and D/RX be analog inputs. The ADC/SS line is also available as an analog input. It is
hardwired to a user trimpot, but you can cut the labeled trace between ADC/SS and POT on the bottom of the
board to disconnect the pot, and then connect something else to that pin. This allows you to use a total of 13
analog inputs: eight on the AVR and five on the auxiliary processor. All 13 inputs can be read using the same
functions (see Section 3.a), so you don’t need to worry too much about which processor is converting them.
If you want to receive TTL-level serial bytes on your computer, you can use the SVP_MODE_RX mode (the
default) which makes A, B, and C be analog inputs and D/RX be the serial receive line. In this mode, TTL-
level serial bytes received on the RX line will be sent to the computer on the Pololu Orangutan SVP TTL Serial
Port. The RX line, along with the TX line (which is always the serial transmit line) make the Orangutan SVP’s
auxiliary processor function as a USB-to-TTL-serial adapter for your computer, allowing you to control serial
devices from your computer. Alternatively, you can control the serial devices directly from the AVR using the
functions in Section 3.h and you can use the RX line to monitor and debug the bytes that are being transmitted
(or received) by the AVR.
Pololu AVR C/C++ Library Users Guide © 2001–2015 Pololu Corporation
3. Functional Overview and Example programs Page 31 of 43