Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Slew rate limiting for SPI

  1. #1
    Junior Member
    Join Date
    Feb 2022
    Posts
    6

    Slew rate limiting for SPI

    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.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,151
    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)

  3. #3
    Junior Member
    Join Date
    Feb 2022
    Posts
    6
    I've tried to set these pin modes. Unfortunately SR flag and SPEED settings did nothing to the signal. But DSE did:

    Click image for larger version. 

Name:	dse_comp_h.jpg 
Views:	19 
Size:	27.3 KB 
ID:	29731

    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •