Does anyone have some sample code I can use to output the ECO on my custom board to one of the GPIO on my CY8C4128LQI-BL483?
I'm wanting to check the ECO frequency, to see if I need to trim the ECO capacitance values to get better accuracy on my ECO frequency
Hi. I seemed to run into the same problem figuring out how to get the ECO clock out onto a GPIO pin. In the end I decided that I didn't have any equipment to deal accurately with 24 MHz anyway. So instead I kept the 24 MHz internal to the chip (module), fed it to a 16 bit counter and captured on a GPS PPS 1 Hz coming in on a GPIO. It's all covered here:
It seems that BT BLE ECO trim doesn't get enough attention. It makes a big difference.
The OP is asking for sample code to do just that.
The naive way I tried of connecting a clock source to an GPIO output pin in the schematic editor doesn't seem to work for me.
I get it, you want everyone to use a frequency counter but it doesn't look like anybody ever does. Moreover, in the other thread I was asking people to confirm my GPS/counter measurements with a frequency meter.
Attached is a sample and SIMPLE project that outputs the ECO frequency directly to a GPIO pin.
Tip: Never directly measure ECO pins connected to the crystal. ANY probe capacitance will adversely effect the frequency and in some cases the stability of the oscillation. It is always preferable to push the crystal output through a buffer or other frequency divider.
Any probe capacitance on the output of a buffered output will not affect the crystal frequency.
Using a scope to directly measure the signals on the ECO pins are only useful to verify the crystal is oscillating. This is a GO/NOGO test.
The project I attaches is VERY SIMPLE. This project has no running code in main(). Everything is set up to run before entering main().
It sets up the ECO and routes it to Routed1 path. Then I attach a GPIO pin to Routed1. It's that simple.
I don't have the CY8C4128LQI-BL483 to test this project but it is SO SIMPLE and obvious.
If you have any issues, let me know.
One additional note:
If you are using this in a commercial product, most crystal suppliers will "trim" your ECO design. You give a 'final' PCB with your best guess at the trim caps to the crystal supplier of your target crystal. Make sure there is FW working enabling the ECO 100% of the time. They will use their equipment to measure and, if needed, suggest other trim values to obtain the target frequency and stability.
We do this in automotive to make sure the crystal keeps the target frequency with manufacturer tolerance and stability over the operational temperature range.
Thank you for the explanation.
That part that I didn't find SO SIMPLE (or obvious) is that you can't connect HFCLK (24 MHz) to a GPIO but you can connect a Routed1 (24 MHz). OTOH, you can't connect Routed1 (24 MHz) to the clock on a counter.