
Programming Examples
11-32
ADSP-BF59x Blackfin Processor Hardware Reference
Programming Examples
The subroutine in
Listing 11-1
shows a typical UART initialization
sequence.
Listing 11-1. UART Initialization
/**************************************************************
* Configures UART in 8 data bits, no parity, 1 stop bit mode.
* Input parameters: r0 holds divisor latch value to be
*
written into
*
DLH:DLL registers.
*
p0 contains the UART_GCTL register address
* Return values:
none
*************************************************************/
uart_init:
[--sp] = r7;
r7 = UCEN (z); /* First of all, enable UART clock */
w[p0+UART0_GCTL-UART0_GCTL] = r7;
r7 = DLAB (z);
/* to set bit rate
*/
w[p0+UART0_LCR-UART0_GCTL] = r7;
/* set DLAB bit first */
w[p0+UART0_DLL-UART0_GCTL] = r0; /* write lower byte to DLL */
r7 = r0 >> 8;
w[p0+UART0_DLH-UART0_GCTL] = r7; /* write upper byte to DLH */
r7 = STB | WLS(8) (z);
/* clear DLAB again and config to */
w[p0+UART0_LCR-UART0_GCTL] = r7;
/* 8 bits, no parity, 2 stop bits */
r7 = [sp++];
rts;
uart_init.end:
The subroutine in
Listing 11-2
performs autobaud detection similarly to
UART boot.
Summary of Contents for ADSP-BF59x Blackfin
Page 64: ...Development Tools 1 22 ADSP BF59x Blackfin Processor Hardware Reference...
Page 74: ...Processor Specific MMRs 2 10 ADSP BF59x Blackfin Processor Hardware Reference...
Page 244: ...Programming Examples 6 40 ADSP BF59x Blackfin Processor Hardware Reference...
Page 700: ...Programming Examples 16 78 ADSP BF59x Blackfin Processor Hardware Reference...
Page 738: ...Boundary Scan Architecture B 8 ADSP BF59x Blackfin Processor Hardware Reference...