Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.

brennbar67

Member level 3
Joined
Jul 26, 2004
Messages
54
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
580
initialize uart 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....
 

how to initialize uart in programming?

Would you please post your configure code here? Let me check it.
 

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.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top