Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/19/07 23:59
Read: times


 
Msg Score: -1
 -1 Message Not Useful
#145950 - UART1 problem in P89LPC952
I have MCB950 evaluation board and i am trying to use UART1 but i am not able to get it done..Please help me.

#include "P89LPC952.h"
#include <stdio.h>

void UART_Init()
{
  P1M1 = 0xFE;                    	// Configure P1.0 (TxD) as Output (UART0)
  
  	// configure baud rate generator
  	BRGR0_0 = 0x70;
  	BRGR1_0 = 0x01;
  	BRGCON_0 = 0x03;
	S0CON = 0x52;	  	
}


  void uart1_init (void)
{
  // TxD = push-pull, RxD = input
  P4M1 &= ~0x04;
  P4M2 |= 0x04;
  P4M1 |= 0x08;
  P4M2 &= ~0x08;

  // configure baud rate generator
  BRGCON_1 = 0x00;
  BRG0_1 = 0x70;
  BRG1_1 = 0x01;
  BRGCON_1 = 0x03;

  S1CON = 0x50;
 
} // uart_init

void main(void)
{
	DIVM = 0x01;
	TRIM &= ~0x40;
	AUXR1 |= 0x80;

	P5M1 = 0x00;
	P5M2 = 0x00;
   	
	UART_Init();
	uart1_init();
  	EA = 1;
	 
	P5 = 0xFF;

	printf("Hello World\n");
	
	S1CON = S1CON & 0xFD;
	P5 = S1CON;
	S1BUF = 'A';
	while(!(S1CON & 0x02));

	printf("1\n");

	while(1);
}


List of 19 messages in thread
TopicAuthorDate
UART1 problem in P89LPC952            01/01/70 00:00      
   What ?            01/01/70 00:00      
   Compare with other examples            01/01/70 00:00      
      Compare with other examples ... and            01/01/70 00:00      
         Re: Compare with other examples            01/01/70 00:00      
            now you have two            01/01/70 00:00      
               Don't trust anything            01/01/70 00:00      
                  Re:Don't trust anything            01/01/70 00:00      
                     its working            01/01/70 00:00      
                        how?            01/01/70 00:00      
                           Re:how?            01/01/70 00:00      
                              Yep : Don\'t trust anything!            01/01/70 00:00      
                              Whose header?            01/01/70 00:00      
                                 Re:Whose header?            01/01/70 00:00      
   MCB950 board is working            01/01/70 00:00      
      UART1 S1BUF doesn't use std SFR            01/01/70 00:00      
         Check the header file            01/01/70 00:00      
            Re:Check the header file            01/01/70 00:00      
            Overcomplicated?            01/01/70 00:00      

Back to Subject List