Search the web
Sign In
New User? Sign Up
lpc900_users
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
LPC938 Baudrate generator   Message List  
Reply | Forward Message #603 of 637 |
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




Tue Apr 7, 2009 11:06 am

emddjava
Offline Offline
Send Email Send Email

Forward
Message #603 of 637 |
Expand Messages Author Sort by Date

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...
SR
emddjava
Offline Send Email
Apr 7, 2009
11:06 am

Hi Samuel; What is your system clock? If the internal oscillator cannot make ikt, try xtal or external clock. Feng...
finn_li
Offline Send Email
Apr 7, 2009
3:10 pm

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....
Samuel
emddjava
Offline Send Email
Apr 7, 2009
4:56 pm

Dear Sameul, Why dont you try the codes with code architect for NXP uC? Sincerely, Dhans Mob:+91-98867-30835 ________________________________ From: Samuel...
M.Dhanasekaran
dhans_g
Offline Send Email
Apr 7, 2009
6:48 pm

This is very old problem This was the problem which has made my visit to China :). Use 0.1uF between VCC and GND. (near to VCC pin of LPC938) Also check your...
Harshal Doshi
dosh_harshal
Offline Send Email
Apr 8, 2009
5:52 am

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; ...
lpc9xxbeginner
Offline Send Email
Apr 7, 2009
3:24 pm

clock is internal clock of 7.363MHz. I tired this code. Didn't work either. ________________________________ From: lpc9xxbeginner <schluchti@...> To:...
Samuel
emddjava
Offline Send Email
Apr 7, 2009
4:52 pm

Hi Samuel You may have got it going by now but here is some info. I used an LPC925 which I believe is similar as far as the UART is concerned. I set the txd...
j.hull49
Offline Send Email
Apr 29, 2009
7:07 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help