Teensy 2.0 and a change in crystal frequency

Status
Not open for further replies.

JFayer

Member
Will USB still function with a clock frequency 7.84% low?
I need to program a Teensy 2.0 to act as a node in a multipoint RS-485 network running at 230,400 baud. But it seems I can not get this baud rate with a 16 MHz system clock--I can't supply an external clock in asynch mode. So I must run the oscillator at 14.7456 Mhz. To do this, I must change out the crystal. It looks like an NDK pn NX3225GA-14.7456M-STD-CRG-2 will drop in and work well with the 10 pF caps on the Teensy.
But does anyone know if USB will still function with a clock frequency 7.84% low? I'm looking into whether it's possible to run USB off the internal 8 MHz RC clock while the UART runs off the crystal, but it's still unclear to me.
Thanks.
 
Don't you think that at long term, porting your project to a modern 32bit T3.2 where you might easily handle that baud rate instead of keeping the almost obsolete 8bit T2.0 could be the smarter solution?
 
Will USB still function with a clock frequency 7.84% low?

No, the USB absolutely will not work with a 14.7456 MHz clock!

In fact, people who have tried using 16 MHz ceramic resonators (approx 1000-2500 ppm accuracy) have found the USB is quite marginal, sometimes working, sometimes having errors or not working at all.

230400 baud is also very fast for such a slow 8 bit processor, just 640 cycles of that clock per byte. While it's theoretically possible to do serial communication at this speed, writing the code to keep up with that data rate would be very challenging and would limit what you could do in many ways.

Teensy 3.2, 3.5 and 3.6 can easily handle this baud rate on Serial1 or Serial2. Those ports have a hardware FIFO which allows for multiple bytes per interrupt, for much better efficiency. Of course the 32 bit processors are also much faster, which allows for much easier software development to actually do something useful.
 
Thanks, all, for the sound advice. Not what I wanted to hear then, as I didn't want to leave C and switch to Arduino. But T3.x is well worth the effort, and C isn't really all that far away. I even got the h/w to control the '485 transmit enable signal, as its timing is more what I need than what Serial1.transmitterEnable( ) furnishes. Again, thanks.
 
Status
Not open for further replies.
Back
Top