Hi,
@Jörg: vielen Dank für die schnelle Antwort.
@Pete: Dafür muss ich mich entschuldigen, denn diese sind nicht auf dem
Schaltplan verzeichent, weil ich für die Stromversorgung den
SMPS2Dynamixel(http://www.trossenrobotics.com/store/p/5886-SMPS2Dynamixel-Adapter.aspx)
benutze.
Es scheint also doch ein Softwarefehler zu sein, da ich keine
Kommunikation zum Diplay bekomme, sobald ich den 2. UART aktiviere.
Hier der Initialisierungscode für den Motor UART:
1 | void usartMotorInit() {
|
2 | MAX485_PORT_DIR_OUTPUT;
|
3 |
|
4 | //Disables transmitter & receiver
|
5 | //UART_MOTOR_STATUS_CONFIG_B &= ~(UART_MOTOR_ENABLE_RECEIVER | UART_MOTOR_ENABLE_TRANSMITTER);
|
6 |
|
7 | usartMotorFlushReceiver();
|
8 | uint16_t baud = (uint16_t)((FREQUENZ_OF_CPU / UART_MOTOR_BAUDRATE / 16) - 1);
|
9 | UBRR1H = (uint8_t) (baud >> 8);
|
10 | UBRR1L = (uint8_t) baud ;
|
11 |
|
12 | // FIXME configure double speed check
|
13 | // if the setbaud.h macros set USE_2X, we need to enable double speed
|
14 |
|
15 | UCSR1A |= (1 << U2X1);
|
16 |
|
17 | // enable tranmitter & receiver
|
18 | UCSR1B = ((1 << RXCIE1) | (1 << TXCIE1) | (1 << RXEN1) | (1 << TXEN1));
|
19 |
|
20 |
|
21 | // set 8n1
|
22 | UCSR1C = (3<<UCSZ10);
|
23 |
|
24 | // set MAX485 to receive data
|
25 | MAX485_RECEIVER_ENABLED;
|
26 | }
|
Die Makros sind wie folgt definiert:
1 | #define MAX485_PIN (1 << PC3)
|
2 | #define MAX485_PORT_ADDRESS (PORTC)
|
3 | #define MAX485_PORT_DIR_ADDRESS (DDRC)
|
4 | #define MAX485_PORT_DIR_OUTPUT (MAX485_PORT_DIR_ADDRESS |= MAX485_PIN)
|
5 | #define MAX485_RECEIVER_ENABLED (MAX485_PORT_ADDRESS &= ~(MAX485_PIN))
|
6 | #define MAX485_TRANSMITTER_ENABLED (MAX485_PORT_ADDRESS |= MAX485_PIN)
|
Erkennt ihr hierin irgendeinen Fehler?