| ??? 08/02/03 01:29 Read: times |
#51947 - unable switch C8051F020 to ext. clk |
Hello everyone,
I bought C8051F020 Eva board and tried some programming. But I got problem when I tried to switch to external clock on the board (crystal freq. is 22.1184M). My clock config function is as following: ... void change_to_ext_clk(void){ unsigned int i; OSCXCN=0x67; //crystal as osc, freq>6.7M for(i=0;i<10000;i++) i=i; // wait more than 1ms while((OSCXCN & 0x80)==0); //Poll ext clk valid bit OSCICN=0x80; // switch to external clock } The problem is that the program stuck at check the exteral clock valid bit. I use a oscilloscope to check both ends of the crystal, there are no sine wave at all, but a DC voltage of about 1V at both ends. This DC volage is not present after reset when using interal clock but appears after OSCXCN=0x67 is executed. Because there is no oscillation, the XTLVLD bit never goes up. These four steps follow the suggestion of Cygnal's data sheet on page 138. Did I miss anything at setting things up? Thank you for your help. Simon |
| Topic | Author | Date |
| unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
| RE: unable switch C8051F020 to ext. clk | 01/01/70 00:00 | |
Problem solved! pins of xtal shorted | 01/01/70 00:00 |



