I've created dual SPI @16MHz, connected it's output to the controller itself, pins declared as inputs. I've connected SCK and MOSI to oscilloscope and the signal looks awful. I haven't tried to receive SPI message yet, but it's hardly going to work if it looks that bad.
The connection wires are within 20cm, I've also tried terminating it with a resistor and it sill looks awful. I've also tried to decrease the frequency to 4 MHz, and it sill doesn't look too good. Also tried with pull-ups and pull-downs, open drain ... to no avail.
Does anyone have any suggestion how to improve it?
Edit: also tried putting a capacitor in parallel (100 pF and 10 nF, I have nothing in between at home yet). 100pF doesn't do much, and 10nF almost kills the signal. Also tried leaving SPI pins floating and it looks just as bad.
SPI signal @16MHz looks terrible
SPI signal @16MHz looks terrible
- Attachments
-
- 4MHz.jpg (145.61 KiB) Viewed 2021 times
-
- 16MHz.jpg (140.64 KiB) Viewed 2021 times
Re: SPI signal @16MHz looks terrible
OK, I've shortened the length of wires by half and now it looks better. Still far from perfect, but I guess it will be fine when all components are on one PCB.
If anybody have any suggestions on still improving the signal, it would be much appreciated.
If anybody have any suggestions on still improving the signal, it would be much appreciated.
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: SPI signal @16MHz looks terrible
Not a solution to your main problem, but to reduce the ringing you can try lowering the drive strength of the IO pins.
Re: SPI signal @16MHz looks terrible
How can I do that?
Re: SPI signal @16MHz looks terrible
It's ok, found it, gpio_set_drive_capability. It helped a bit.
Re: SPI signal @16MHz looks terrible
For sure. Shortening distance, especially having the signals be on traces on a single PCB, and reducing frequency, if possible, will mitigate the issue. Does the application require that you run SPI at 16MHz?OK, I've shortened the length of wires by half and now it looks better. Still far from perfect, but I guess it will be fine when all components are on one PCB.
Re: SPI signal @16MHz looks terrible
I was hoping for 40Mhz, so yes, 16MHz is a bare minimum.
Who is online
Users browsing this forum: No registered users and 317 guests