Problema amb Lpc2148 Uart

M

mrhazard

Guest
Hola nois, estic tractant de crear un codi petit ressò d'un char a HyperTerminal però doesnt seem to work ...aquí està el meu codi espero que vostè em pot ajudar

Codi:

# Include <LPC214X.H>

# Define CR 0x0D

void initialize (void); / / Inicialització de UART0

int putchar (int ch); / / Escriu un caràcter a la porta de sèrie

int getchar (void); / / Llegeix un caràcter a la porta de sèrie
PRINCIPALS /************************* *********************** ** /

int main (void)

(

Inicia ();// inicialització de la UART0

while (1)

(

putchar (U0RBR););)int putchar (int ch) / * caràcter d'escriure en el port sèrie * /

(

if (ch == '\ n') (

while (! (U0LSR & 0x20));

U0THR = CR; / CR * sortida * /

)

while (! (U0LSR & 0x20));

return (U0THR = CH);

)

int getchar (void) / * Llegir el caràcter de port sèrie * /

(

while (! (U0LSR & 0x01));

return (U0RBR);

)

/*************** Inicialització del sistema ***************/

void initialize ()

(

VPBDIV = 0x00;

/ * Inicialitzar Pin Seleccioneu Bloc de Tx i Rx * /

PINSEL0 = 0x5;

/ * Habilita FIFO i reposar-* /

U0FCR = 0x7;

/ * Establir dLab i la longitud de la paraula estableix en 8bits * /

U0LCR = 0x83;

/ * Velocitat establert en 9.600 * /

U0DLL = 0x62;

U0DLM = 0x0;

/ * Clear dLab * /

U0LCR = 0x3;

)

/************************************************* ********/

 
Za sprawą coraz przystępniejszych cen nośników SSD, ich rynek staje się coraz szerszy. Zauważyła to firma Western Digital, która o dziwo, nie dysponuje linią SSD przeznaczoną na rynek konsumencki. W ofercie jej znajdują się nośniki SSD, ale dedykowane dla klientów biznesowych. Lecz w niedalekiej przyszłości ma się to zmienić. Wg serwisu DigiTimes f...

Read more...
 

Welcome to EDABoard.com

Sponsor

Back
Top