| ??? 02/13/01 15:22 Read: times |
#9267 - RE: Cygnal C8051 |
Hi Alex,
I ran your code on one of our C8051F000 evaluation boards and it worked fine. There are a couple of differences in my system that could explain some of the behavioral differences you are seeing. I'm assuming that you're using an 11.0592MHz crystal, and trying to communicate at 115.2kbps, given TH1 = -6. Recommendations as follows: 1. Insert a 1ms delay between OSCXCN = 0x65 (which turns the crystal oscillator on) and while (!(OSCXCN & 0x08)) (which polls the XTLVLD bit which goes high when the crystal oscillator stabilizes). In some systems, the valid bit can assert a 'false positive' right after the crystal oscillator is turned on, which can cause you to switch to the external oscillator prematurely, before the clock source is valid. Adding the 1ms delay between enabling the oscillator and polling the valid bit will prevent this. 2. Set OSCXCN to '0x66' instead of '0x65'. This adds a little more power to the crystal oscillator, and may help avoid start up problems. The remaining recommendations are related to 'general use' guidelines and probably are not contributors to the problem: 3. It's best to write the crossbar registers (XBR0-2) in order, in particular writing XBR2, which contains the enable bit for the crossbar, last. This keeps the pinout of the device from changing (potentially resulting in contention) as you write XBR0 and XBR1 to enable other peripherals. 4. Enable Timer1 (TR1=1) after you've configured everything else. Currently, you're setting CKCON (which selects SYSCLK/1 as the counter source) and SMOD=1 while the timer is actually running. Again, I don't think this is causing a problem. 5. As a final note, despite some of the excellent debugging suggestions provided by others in this thread, keep in mind that you have the option of contacting the manufacurer if you have questions about device behavior, in this case 'apps@cygnal.com'. In the future, it might save you some time. Let me know if you have any questions. Best regards, -Brent |
| Topic | Author | Date |
| Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
| RE: Cygnal C8051 | 01/01/70 00:00 | |
RE: Cygnal C8051 | 01/01/70 00:00 |



