Re: TStik CAN speeds
Edward Hetherington <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.tini |
|---|---|
| Message-ID | <[email protected]> |
I have noticed a lot of discussion about the incompatability of crystal frequences for common serial rates and those for common CAN rates I am also very interested in this topic. Has anyone read the "APPENDUM TO SECTION 11: PROGRAMMABLE TIMERS" section of the "High Speed Microcontroller User's Guide: DS80C400 Supplement"? There seems to be a very nice feature of timers 1 and 2 that has been added to make selection of a clock speed compatible with both serial and CAN communication. To summarize, you can now select a divide-by-13 instead of a divide-by-12 for baud rate generation. The TINI module ships with a 14.7456 MHz crystal, which divides down to the standard set of serial baud rates. It unfortunately does not divide down to produce the popular 125k, 250k, 1000k rates for CAN. Now, 13 * (14.7456 / 12) = 15.974, so using a 16 MHz crystal would enable generating the exact CAN rates AND serial rates well within the required tolerance. So, it is easy to design a system using a 16 MHz crystal that gives standard serial and CAN rates. The biggest question is - is the TINI module reliable at 16 MHz? The next biggest question - What does the TINI board do with it's serial ports on startup (with a 16 MHz crystal)? Does it find a baud rate that works for the downloads? IF it is reliable at 16 MHz, AND it will boot with a reasonable baud rate, then any other problems should be solvable, shouldn't they??? Another possibility is to use something like 12 MHz. I -think- you can get dividers for the desired CAN rates from that, but I'd have to actually look at the manual! The relavant paragraph from the manual, page 107 - Divide-by-13 Option Another change to the timers associated with the DS80C400 is the inclusion of a divide-by-13 option for timer 1 and timer 2. The option is independently enabled for each timer by setting the D13T1 (for timer 1) or D13T2 (for timer 2) bits. When enabled by setting the appropriate bits, the timer input from the T1 or T2 external pins is replaced by a time base equal to the system clock frequency divided by 13. Figure 11-9 illustrates the operation of these bits. The setting of the divide-by-13 bits affects all operations of timer 1 and all operations of timer 2 except baud-rate generator mode. The baud-rate generator mode of timer 2 is not affected by the setting of the D13T2 bit. The divide-by-13 settings of Timer 1 and Timer 2 allow the microprocessor to simultaneously generate standard serial baud rates and standard CAN baud rates within generally acceptable error tolerances. In an original divide-by-12 timer an 11.0592MHz crystal frequency (or multiple thereof) was usually needed to generate standard serial baud rates. The divide-by-13 setting offers the additional option of selecting the microprocessor clock frequency by 12/13. Thus, using a 12MHz crystal and the divide-by-13 setting, the effective baud rate becomes (12/13) x 12 = 11.0769MHz. This differs from the ideal baud rate frequency by only 0.16%, an insignificant dif- High-Speed Microcontroller User s Guide: DS80C400 Supplement ference, but allows the use of a crystal frequency that is acceptable for serial port and CAN operation. Using this feature, standard serial rates of up to 38.4k baud are available with a 16MHz crystal. A 24MHz crystal allows serial rates up to 115.2k baud. _______________________________________________ TINI mailing list TINI-6tN4nzCoH/[email protected] To UNSUBSCRIBE, edit your profile, or see list archives: http://lists.dalsemi.com/mailman/listinfo/tini