need help with IOMUXC_PAD configuration for I2C on Teensy 4.0

jrdarrah

Well-known member
I'm trying to move my application from a teensy 3.2 using the I2c_t3 library to a teensy 4.0 using the teensy4_i2c-master library. The teensy wire.begin statement has fields to define the I2c pin configuration but it looks like on the teensy 4.0 I will need to define a pad configuration. I read the application note from freescale, AN5078, Influence of Pin Setting on System Function and Performance. It describes some of the fields but not in enough detail to translate my 3.2 settings into what is needed for the 4.0 hardware. I've done some internet searches and can't find detailed information on the PAD_CONFIG statement fields shown below. How would I set it for an I2C Master with an external pull up resistor at a clock speed of 400k?


Code:
// Teensy 3.2 with 

#include <i2c_t3.h>

uint32_t I2CSpeed = 400000;

  // Setup for Master mode, pins 18/19, external pullups, 400kHz
  Wire.begin(I2C_MASTER, 0x00, I2C_PINS_18_19, I2C_PULLUP_EXT, I2CSpeed);

// Teensy 4.0 with teensy4_i2c-master

#include <i2c_device.h>
#include <i2c_driver.h>
#include <i2c_driver_wire.h>


#define PAD_CONFIG IOMUXC_PAD_DSE(4) | IOMUXC_PAD_SPEED(1) | IOMUXC_PAD_PKE | IOMUXC_PAD_PUE | IOMUXC_PAD_PUS(3) | IOMUXC_PAD_ODE | IOMUXC_PAD_HYS
 
Back
Top