Hallo zusammen,
ich versuche bei einem mbed LPC 1768 Board (ARM Cortex-M3) die initiale
Konfiguration für die UART-Schnittstelle hinzubekommen. Ich will die
Schnittstelle später als serielle Konsole (9600 Baud) für Ausgaben
verwenden.
Das Kommunikation soll über die Pins 48/49 bzw. p28 und p27 laufen.
Siehe auch folgender Link:
http://mbed.org/users/Lerche/notebook/lpc1768-pin-functions/
Allerdings setzt es bei mir bei Schritt 3 vom Verständnis komplett aus
:( Kann mir evtl. jemand weiterhelfen?
Anbei noch ein Auszug aus dem Handbuch zum MCU und meine Versuche die
Schritte hinzubekommen:
--- snip ---
The UART0/2/3 peripherals are configured using the following registers:
1. Power: In the PCONP register (Table 46), set bits PCUART0/2/3.
Remark: On reset, UART0 is enabled (PCUART0 = 1), and UART2/3 are
disabled (PCUART2/3 = 0).
1 | // UART2 aktivieren
|
2 | LPC_SC->PCONP |= (1 << 24)
|
2. Peripheral clock: In the PCLKSEL0 register (Table 40), select
PCLK_UART0; in the PCLKSEL1 register (Table 41), select PCLK_UART2/3.
1 | // Clock für UART2 aktivieren
|
2 | // Defaultclock 4 MHz, fixed CCLK/8 ~ 0.5 MHz
|
3 | LPC_SC->PCLSEL1 |= ( 1 << 17) (1 << 16)
|
4 | // Clock nun bei 2 MHz?
|
5 | LPC_SC->PCLK_peripheral |= (1 << 2)
|
3. Baud rate: In register U0/2/3LCR (Table 279), set bit DLAB =1. This
enables access to registers DLL (Table 273) and DLM (Table 274) for
setting the baud rate. Also, if needed, set the fractional baud rate in
the fractional divider register (Table 285).
--- snap ---
- Florian