English
Language : 

AMG-XB404 Datasheet, PDF (45/73 Pages) alpha microelectronics gmbh – Fully Integrated Single Motor Controller for Electrical Motors
AMG-XB404
Fully Integrated Single Motor Controller for Electrical Motors
PORTB[0] and PORTB[1] become TX and RX line of the UART if UARTEN is set. The polarity of
the TX line can be inverted by setting PORTBO[0] to 1 for non-inverted operation it needs to be set
to 0. The polarity of the RX line is set via PORTBO[1] in the same way. See section 5.7.3 p. 47 for
a detailed description of the UART.
PORTB[2] and PORTB[3] become the two wire interface's SCL and SDA pins when the TWI is
enabled. See section 5.7.5 p. 49 for a detailed description of the TWI.
PORTB[6:4] are used for the three timers' output compare signals. PORTB[5] is connected to 8 bit
Timer0, PORTB[5] is connected to 8 bit Timer1 and PORTB[6] is connected to 16 bit Timer2. The
value of the output compare flag is xor-ed with the value in PORTBO[6:4] respectively, thus
allowing to invert the signal as required.
PORTC[7:4] are used for the SPI controller's SCLK, SCS, SDI, and SDO pins. The polarity of the
clock can be inverted by setting PORTCO[4] to 1, the standard non-inverting behaviour is achieved
by setting PORTCO[4] to 0. See section 5.7.4 p. 48 for a detailed description of the SPI.
PORTC[2] is connected to Timer2. If PORTCO[2] is set to 0 rising signal edges are detected by the
timer, if set to 1 falling signal edges are detected. See section 5.7.6 p. 52 for a detailed description
of all timers.
PORTE[2:0] is shared with the general purpose ADC channels see section 5.3 page 16 for details.
Note that dedicated GPIO functions may override output pins so these pins are not controlled by
the output buffer register. When reading a port, the actual input is read instead of the buffer
content, even if the port is configured to be an output. This needs to be considered when doing bit-
manipulation on GPIO ports with special functions enabled. For example PORTBO[0] determines
TX polarity when UARTEN is set. When reading back the port, PORTB[0] keeps the actual TX line
instead of the TX polarity setting. So these bits must always be written as intended, not as read.
AMG-XB404
Revision: A
2. Nov. 2012 © All rights reserved
Page 45 of 73