DDRx für serielle Schnittstelle?

Gast #468722
Lesenswert?

Hi,
kommt immer auf den Controller an. Ich initialisiere die UART so, damit 
es geht:

void InitUART( void )
{
    DDR4_D42 = 1;   /* Enable SOT1 as output */
    DDR4_D40 = 0;   /* Enable SIN1 as input  */

    CDCR1 = 0x80;  /* set UART-prescaler, DIV=8 */

    SCR1  = 0x13;  /* 8-data bits, 1-stop bit, no parity,
                     Data frame, Tx/Rx enable  */
    SSR1  = 0x0A;  /* transfer starts with LSB 0x08 -- interrupt 
enable*/
    SMR1  = 0x19;  /* select Mode0, select asynchr.transfer,
                     set Baud rate to 9600, SOE enable */
    ICR13 = 0x04;  // normal interrupt level 4
}

Gruß Marc989

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren