ADC and DAC Gain Select Pins 250-12

dedicated to the FPGA topics for all Red Pitaya programmers
Post Reply
taylor_levaur
Posts: 4
Joined: Mon Mar 14, 2022 9:58 pm

ADC and DAC Gain Select Pins 250-12

Post by taylor_levaur » Thu Oct 13, 2022 5:57 pm

I have a 250-12 RP. I am working in Vivado 2020.1 for this. The customer doc, which I have reported to have errors before, listed the following pins:

K1 = IN_1 AC / DC Select
K2 = IN_2 AC / DC Select
K3 = IN_1 Gain Select (Attenuator Select)
K4 = IN_2 Gain Select
K5 = OUT_1 Gain Select
K6 = OUT_2 Gain Select

The problem is when I try to build an implementation in Vivado. It says these pins are reserved for something else. What pins on the XC7020 are this signal actually connected? If these are the correct pins, how can I at least select the gain using the monitor command?

Right now, I have to use the oscilloscope app to maually change the gains. This solution is an absolute pain, and it does not always work. I am trying to use custom RTL code as much as possible, so being able to toggle the gain selects from my configuration register would be optimal.

Thanks,
Taylor

juretrn
Posts: 104
Joined: Tue Nov 16, 2021 11:38 am

Re: ADC and DAC Gain Select Pins 250-12

Post by juretrn » Fri Oct 14, 2022 12:03 pm

K1 ... K6 does not refer to FPGA pins, if that is what you mean.
In fact, it refers to the relays that are used to switch gains/modes. The pins K1 ... K6 of a Zynq 7020 in CLG400 package are not user accessible. (see Xilinx's UG865, page 38)

The relays are switched using an I/O expander that is connected via I2C. (250-12 customer schematic, page 6)
Those I2C pins are part of PS's MIO bank (B13 and B9).
That means that without hardware changes, gains cannot be set through programmable logic, but only through software.

taylor_levaur
Posts: 4
Joined: Mon Mar 14, 2022 9:58 pm

Re: ADC and DAC Gain Select Pins 250-12

Post by taylor_levaur » Fri Oct 14, 2022 4:42 pm

Yes, I saw that the K1-K6 "Pins" were both input and output for MAX7311. I am in the process of figuring out how to exactly use the MAX7311 to change gain selections. For example, K1 is connected to both I/O0 and I/O1 of the MAX7311. One issue I do not know which of those two pins is acting as the input and which is the output. I am still using the scope app to manually toggle the selects to hopefully see a change in the data read back from the MAX7311. So far, I have not been able to see this change.

I am currently playing with the i2c.c and i2c_switch_max7311.c example codes to try to figure out how to do this. Also, it is perfectly fine that the gain select are chosen by software, as long as I can make that change from C code.

My understanding of the readout process for the MAX7311 so far.
1. Open /dev/i2c-0 for r/w
2. Set the slave address to that of the MAX7311. The customer doc lists the I2C address as 0100000, or 0x20. Note that for reading from the MAX7311, this address needs to be 0x21, 0x20 is only for writes to the appropriate registers of the MAX7311.
3. Write two bytes to the MAX7311. The first byte being its slave address, so 0x20 or 0x21. The second byte is the command. For example, if we wish to read the values of the I/O7 - I/O0 pins, then we send 0x00 for the second byte.
4. Read data from the MAX7311.

I know that the direction of the I/O pins are set using the configuration register, but in the process of figuring out things, I overwrote this register, so I really have no idea what the correct configuration should be. Any advice on this would be greatly appreciated.

juretrn
Posts: 104
Joined: Tue Nov 16, 2021 11:38 am

Re: ADC and DAC Gain Select Pins 250-12

Post by juretrn » Mon Oct 17, 2022 8:42 am

AD0, AD1 and AD2 being tied to GND results in address 0100000 padded with R/W bit, meaning the read address is 0x41 and write 0x40.

Looking at the full schematic, it looks like all IO pins of MAX7311 are outputs.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 4 guests