clock is internal clock of 7.363MHz. I tired this code. Didn't work either.
From: lpc9xxbeginner <schluchti@...>
To: lpc900_users@yahoogroups.com
Sent: Tuesday, April 7, 2009 11:23:52 PM
Subject: [lpc900_users] Re: LPC938 Baudrate generator
Hi,
if you are using the internal RC oscillator, try this:
void init()
{
BRGCON = 0x00;
BRGR0 = 0xF0;
BRGR1 = 0x02;
BRGCON = 0x03;
PCON &=0xC0;
SCON = 0x50;
SSTAT = 0x40;
P1M1 = 0x00;
P1M2 = 0x01;
P1M2 = 0x001;
TI = 1;
RI = 0;
}
Best Regards
Bernhard
--- In lpc900_users@yahoogroups.com, "SR" <emddjava@...> wrote:
>
> Hi
>
> I am using LPC938, I am trying to get the UART's baudrate to 9600 but nothing seems to work..I the following code and all I see on hyperterm is just various ASCII characters.
>
> EA = 0;
> TR1 = 0; /* stop timer 1 */
> ET1 = 0; /* disable timer 1 interrupt */
>
> TH1 = 0xFC; //(unsigned char) (256 - (clock / (16L * 12L * baudrate)));
>
> PCON |= 0x80; /* 0x80=SMOD: set serial baudrate doubler */
>
> TMOD &= ~0xF0; /* clear timer 1 mode bits */
> TMOD |= 0x20; /* put timer 1 into MODE 2 */
> SCON = 0x50;
>
> TR1 = 1; /* start timer 1 */
>
>
> INT_ENABLE;
>
>
> EA = 1;
>
> Samuel
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/lpc900_users/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/lpc900_users/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:lpc900_users-digest@yahoogroups.com
mailto:lpc900_users-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
lpc900_users-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/