| ??? 11/25/06 14:01 Read: times |
#128501 - Not yet Responding to: ???'s previous message |
But why we need to set it to 48Mhz clock.?? ??? I can see signal on RXD0OUT in 12 and 24 MHz CLKOUT. // test_uart0.c
// test for UART0 mode 0
//
// command line to build this file
// c51 test_uart0.c db oe code small moddp2
// bl51 test_uart0.obj TO test_uart0 RAMSIZE(256) XDATA(1900h)
// oh51 test_uart0 HEXFILE(test_uart0.hex)
#define ALLOCATE_EXTERN
#include "fx2.h"
#include "fx2regs.h"
void main(void)
{
// CPUCS = ((CPUCS & ~bmCLKSPD) & ~bmCLKSPD1); // set the CPU clock to 12MHz (default)
CPUCS = ((CPUCS | bmCLKSPD) & ~bmCLKSPD1); // set the CPU clock to 24MHz
// CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1); // set the CPU clock to 48MHz
PORTECFG = 0x08; // enable RXD0OUT
SCON0 = 0x13; // mode 0, receive enabled, baud CLKOUT/12, TI = 1, RI = 1
while(1){
if ( TI ){
TI = 0;
SBUF0 = 0x55;
}
}
}
Tsuneo |



