N
nobody
Guest
I have a small design flaw with a new sensor, ICM20948, into a PI device. I need to make the SDA bidirectional and level shift SCL, int, and fsync. Voltage level on the sensor board is 1.8V the PI is 3.3V. I have CPLD hardware that I would like to use to make the bidirectional level shifted SDA as well as level shift the other three.
The VHDL behavior is as simple as:
begin
enable <= '1' when DIR = '1' else '0';
I2C(0) <= SCL;
I2C(1) <= SDA when enable = '0' else 'Z';
SDA <= I2C(1) when enable = '1' else 'Z';
end Behavioral;
I have used this before in another I2C without failure. The hardware seems to be performing the bidirectional communication, but all logic is a ~3.3V level.
The CPLD is a Xilinx XC2CA64 with the 1.8V I2C pins on 11 and 13 and the 3.3V I2C and ancillary pins on 15, 16 and 17. The UCF is as follows:
NET "I2C(0)" LOC = "11" ; #SCL1V8
NET "I2C(0)" IOSTANDARD = "LVCMOS18" ;
NET "I2C(1)" LOC = "13" ;
NET "I2C(1)" IOSTANDARD = "LVCMOS18" ; #SDA1V8
NET "SCL" LOC = "17" ; #PI side
NET "SCL" IOSTANDARD = "LVCMOS33" ; #
NET "SDA" LOC = "15" ; #PI side
NET "SDA" IOSTANDARD = "LVCMOS33" ; #
NET "DIR" LOC = "16" ; #PI side
NET "DIR" IOSTANDARD = "LVCMOS33" ; #
The VHDL behavior is as simple as:
begin
enable <= '1' when DIR = '1' else '0';
I2C(0) <= SCL;
I2C(1) <= SDA when enable = '0' else 'Z';
SDA <= I2C(1) when enable = '1' else 'Z';
end Behavioral;
I have used this before in another I2C without failure. The hardware seems to be performing the bidirectional communication, but all logic is a ~3.3V level.
The CPLD is a Xilinx XC2CA64 with the 1.8V I2C pins on 11 and 13 and the 3.3V I2C and ancillary pins on 15, 16 and 17. The UCF is as follows:
NET "I2C(0)" LOC = "11" ; #SCL1V8
NET "I2C(0)" IOSTANDARD = "LVCMOS18" ;
NET "I2C(1)" LOC = "13" ;
NET "I2C(1)" IOSTANDARD = "LVCMOS18" ; #SDA1V8
NET "SCL" LOC = "17" ; #PI side
NET "SCL" IOSTANDARD = "LVCMOS33" ; #
NET "SDA" LOC = "15" ; #PI side
NET "SDA" IOSTANDARD = "LVCMOS33" ; #
NET "DIR" LOC = "16" ; #PI side
NET "DIR" IOSTANDARD = "LVCMOS33" ; #