ya, I am trying not to use an xtal clock cos alot of the code is written and when I do the maths TH1 should be 0xFD to be transmitting at 9600 but its not. Maybe there is some register I miss'd out or value in something else I got wrong? Internal clock is 7.363MHz
Samuel
Samuel
From: finn_li <li_finn@...>
To: lpc900_users@yahoogroups.com
Sent: Tuesday, April 7, 2009 11:09:48 PM
Subject: [lpc900_users] Re: LPC938 Baudrate generator
Hi Samuel;
What is your system clock? If the internal oscillator cannot make ikt, try xtal or external clock.
Feng
--- 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/