Rules | Recent posts | topic RSS | Search | Register  | Log in

How2 programming M16c28 UART by using external clock....

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> Embedded Systems and Real-Time OS
Author Message
brennbar67



Joined: 26 Jul 2004
Posts: 54


Post29 Jul 2004 1:38   How2 programming M16c28 UART by using external clock....

I have problem with my m16c28 serial I/O (UART) by using external clock,115200 baudrate and CTS/RTS enable.
I cant doing any transmit and receive data, although i have initialize all my UART and MCU.
As i know,the m16c28 UART is almost similar with m16c26,right?i can configure c26,but c28 cannot work..why?
Anyone can help me pls...because my final year project due date is coming soon...i worry cant finish on time.
Pls help me....
Back to top
Jason-dong



Joined: 07 Dec 2001
Posts: 51


Post29 Jul 2004 3:12   How2 programming M16c28 UART by using external clock....

Would you please post your configure code here? Let me check it.
Back to top
brennbar67



Joined: 26 Jul 2004
Posts: 54


Post29 Jul 2004 6:35   Re: How2 programming M16c28 UART by using external clock....

Here is my initialize UART by using C programming:

void uart_init (void)
{

u0mr = 0x0D; //UART0 transmit/receive mode register, 8bits
//data,external clk,1 stop bit,parity disable.

UART0_DIR &= ~UART0_CLKIN; // external clock input

u0c0 = 0x24; //UART0 transmit/receive control register 0,
// CTS/RTS enable,RTS fn is selected

u0brg = 6; //set UART0 bit rate generator

u1c0 = 0x20; //UART1 tx/rx control register0, CTS/RTS
//enable, input UART1 CTS

ucon = 0x40; // CTS/RTS separated, CLKS1 not used

u0tb = 0; //clear transmit buffer register

s0ric = 0x07; //UART0 Rx interrupt control register,7 is highest

u0c1 = 0; // UART0 tx/rx control register 1 ,transmit&receive
//enable

}


Am i set the wrong setting? But is impossible,coz i jz follow the datasheet only....would u pls help me correct4me if done some mistake.
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> Embedded Systems and Real-Time OS
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap