beautypg.com

Pololu Orangutan X2 User Manual

Page 26

background image

13: ADDR_SERIAL_SETTINGS

• bit 7: unused

• bit 6: normal UART functionality if cleared, enables permanent program mode (and overrides all other
serial settings) if set

• bits 5&4: parity (0 = no parity, 1 = reserved, 2 = even parity, 3 = odd parity)

• bit 3: use one stop bit if cleared, two if set

• bit 2: unused

• bit 1: run at normal speed if cleared, at double speed if set

• bit 0: unused

Default value is 0 (normal UART functionality, no parity, one stop bit, normal speed). Character size is always
8-bit and cannot be set to anything else.

14: ADDR_SERIAL_UBRRH — UBRRH register (determines baud). Default value 0. UBRRH is a 3-bit value
that combines with the 8-bit UBRRL to create an 11-bit UBRR value.

in normal mode:

baud = ( 20 MHz / 16 ) / ( UBRR + 1 ) = 1.25 MHz / ( UBRR + 1 ), so

UBRR = ( 1.25 MHz / baud ) – 1

in double-speed mode:

baud = ( 20 MHz / 8 ) / ( UBRR + 1 ) = 2.5 MHz / ( UBRR + 1 ), so

UBRR = ( 2.5 MHz / baud ) – 1

15: ADDR_SERIAL_UBRRL — UBRRL register (determines baud). Default value 10 (UBRR = 10 results in
115.2k baud with -1.4% error).

16: ADDR_SERIAL_READ_READY — the number of bytes the UART read buffer has when the mega168
sets the read-ready status flag. The parameter must be in the range of 1 – 32. If you set it to 32 you won’t get a
read-ready flag until the read buffer is full. If you set it to 1, you will get a read-ready flag every time the mega168
receives a byte over the UART. Default value is 1.

17: ADDR_BUZZER_VOLUME — buzzer volume (must be a 4-bit value). The buzzer pwm duty cycle is set
by generating a compare match at TOP >> (16 – volume). Therefore a volume of 15 results in a 50% duty cycle
and a volume of 5 results in a .05% duty cycle. The volume control is somewhat crude, but it still lets you make
the buzzer quieter if so desired. Volume must be in the range of 0 – 15. Default value is 12.

18: ADDR_STARTUP_MELODY — this parameter determines the melody that plays on startup/reset: 0 – 7 =
melody of that number, 8 = silence (make no sound on startup), else chirp. Default value is 255 (chirp).

19: ADDR_NOTE_GAP — default duration in ms of silent pause inserted after each note (7-bit value). Default
value is 5.

Orangutan X2 Command Documentation v1.01

© 2001–2010 Pololu Corporation

5. ATmega168's EEPROM Addresses

Page 26 of 27