Dear Friends,
I have written Serial communication program for cypress CY7C68013A which is not working, Please find the code below, if there is any more registers to be set please tell me,
CPUCS = bmCLKSPD1; // 48 MHz CKCON = 0;// MOVX takes 2 cycles SCON0 = 0x50; TMOD |= 0x20; TH1 = 0xB2;// Baudrate @ 9600bps CLK=48MHz TR1 = 1; TI =1; RI =1; while(1) { printf("Hello World"); }
I have completely read the cypress document and initialized the following registers, still the problem persists, do I need to initialize any more pins for my serial communication to work?? Please help...
void init_uart(void) { CPUCS = bmCLKSPD1; // 48 MHz CKCON = 0x10; // TR1=1 divide factor by 1 SCON0 = 0x50; // 8 bit Auto Reload mode UART EICON |= 0x80; // SMOD1=1 TMOD |= 0x20; // Timer 1 initialized to mode 2 TH1 = 0xEC; // Reload value for 9600 baud rate at TR1 = 1; // Start the Timer 1 TI1 = 1; RI1 = 1; }
I have the same problem, the cpu is always work at 12MHz. why?
cpucs = 0x12; set the cpu clk to 48MHz. but it donot work.
what printf do here? Did you written printf routine in you code, if so send printf code?