Slew rate limiting for SPI

Srx

Member
How can I turn on the advertised "Slew Rate Limiting" that is advertised on the T4.1 product page for SPI?

I have a SPI at 20MHz communicating with an ADC and rather big overshooting on the clock and MOSI. The ADC creates a nice relaxed signal on the MISO line. I want to achieve the same.
 
You can try experimenting changing the settings of the IO pins involved:
I believe by default SPI sets them like:
Code:
	uint32_t fastio = IOMUXC_PAD_DSE(7) | IOMUXC_PAD_SPEED(2);
	//uint32_t fastio = IOMUXC_PAD_DSE(6) | IOMUXC_PAD_SPEED(1);
	//uint32_t fastio = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);
	//Serial.printf("SPI MISO: %d MOSI: %d, SCK: %d\n", hardware().miso_pin[miso_pin_index], hardware().mosi_pin[mosi_pin_index], hardware().sck_pin[sck_pin_index]);
	*(portControlRegister(hardware().miso_pin[miso_pin_index])) = fastio;
	*(portControlRegister(hardware().mosi_pin[mosi_pin_index])) = fastio;
	*(portControlRegister(hardware().sck_pin[sck_pin_index])) = fastio;

If you look at the IMXRT reference manual that can be downloaded from the product page, you will find what all of the settings are for the PAD.
In this case pin 12 is B0_01 and the register I believe is shown on page 696 in the current version I have.
In addition to the DSE and SPEED fields, there is the Slew Rate Field (either fast or slow)
 
I've tried to set these pin modes. Unfortunately SR flag and SPEED settings did nothing to the signal. But DSE did:

dse_comp_h.jpg

Grid: 10ns; 1V; 20MHz SCLK

Maybe Paul could add something convenient to the API like:

Code:
pinStrength(pinNumber, strength & 7);

Thank you for the hint. Now I don't need to put resistors on the board. (DSE 2 looks fine to me)
 
Back
Top