Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

LPC2129 & UART1

2005-11-16 by tsyrjala2

Hello,

I am quite new with these ARM based controllers. I've been trying to
get the uart working with code from Philips application note AN10369.

-------------cut-------------------------cut-----------------

#include "lpc21xx.h"

void Initialize(void);

#define TEMT          (1<<6)
#define LINE_FEED     0xA
#define CARRIAGE_RET  0xD

int main()
{
    int i;
    char c[]="Philips";

      PINSEL0=0x5;
  
  U0FCR=0x7;
  
  U0LCR=0x83;
  
  U0DLL=0x18;
  U0DLM=0x0;

  U0LCR=0x3;

    while(1)
    {
      i=0;
      
      while(c[i])
      {
        U0THR=c[i];
        i++;
      }
      
      U0THR=LINE_FEED;
      U0THR=CARRIAGE_RET;
      
            while(!(U1LSR & TEMT)) {}
    } //end of while(1)

}   //end of main

-cut--------------------------cut-----------------

Getting uart working should be simple job, but I'm unable get any life
into it.

--
Tim

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.