Consequences of unstable external oscillator and switching to internal oscillator?
We have been experiencing dropped bytes during UART communications and have determined the root cause to be an unstable external oscillator.
The external oscillator placement does not follow the recommended guidelines and is resulting in the PLL desynchronization, which in turns leads to a 10-20us transient on the main clock. If this transient occurs while we are reading or writing UART data we will get 'NF' and 'FE' noise/framing errors on the UART bus register and subsequently lose information.
This image shows our bad oscillator placement/design
There are several solutions we found to this problem:
- Switch to the internal oscillator. Accuracy is 1% over temperature range of the STM32F429 MCU. This is in comparison to 30-50ppm of the ATS08ASM-1E external oscillator. This fixes the issue and appears to be working without comm issues.
- Implement retry logic that allows the bad packets to be re-requested. This works for the most part but it seems that the retry logic will sometimes still fail and we end up never getting the UART data when we are operating from the external oscillator.
- Removing the load capacitors from the external oscillator prevents the clock instability. This is a strange solution but also appears to work.
Our preferred solution is to switch over to the internal oscillator and use the retry logic. So now two questions:
- Switching to the internal oscillator or removing the load caps from the external oscillator appear to be similar in effectiveness of solving the hardware issue. Is there any reason why we should choose one over the other? I figure removing the load caps makes the crystal less precise which is the same issue as using the internal oscillator?
- What other functions should we be concerned with other than UART communications when trying to evaluate a change to the clock architecture?
For reference we are running our MCU at 168 MHz and are communicating UART @ 2 megabaud. The only other thing the board does is run a touchscreen.
Also if anyone has tips on external oscillator design please include since that will be helpful because this board will be redesigned in the near future.
Thanks!
