>> fpga.est_brd_clk()
>
> Out[81]: 100.16248349999999.
>
> FPGA clk ok!, sys_clk/100MHz
FWIW, you can't use sys_clk for an ADC. You need an external adc_clk.
>> Assuming that worked ok, you can try and read the raw values from the ADC's
>> IIC temperature sensor:
>> corr.katadc.iic_read_register(fpga,0,0x4C,0x00)
> In [275]: corr.katadc.iic_read_register(fpga,1,0x4C,0x00)
> Out[275]: 30
>
> In [276]: corr.katadc.iic_read_register(fpga,1,0x4C,0x10)
> Out[276]: 160
>
> In [277]: corr.katadc.get_ambient_temp(fpga,1)
> Out[277]: 40.0
Yay! IIC works! Looks like you were trying for ZDOK zero instead of one last
time.
> I noted that the ambient temp. must be: 30.625°C instead of 40°C. The LT11:4
> register of the TI TMP421 is the direct reading of the temp in °C (30 =
> 0x1E). And LT3:0 (4MSB of the register in addr. 0x10) is the decimal
> representation of the temperature: 0.625 = (160 / 16) / 16. The first
> 4bit-right-shift is to right justify the 8bit register, and the second
> 4bit-right-shift is for the "fixed-point" representation of the number.
This may well be true. I coded that in about 2 minutes with only cursory
glances at the datasheet. Thanks for the correction.
> After connecting the JP1 jumper (AT24C02B, Write Protect (WP) pin to ground,
> write enable):
>
> In [207]: corr.katadc.eeprom_details_set(fpga,1,1234,567,8,9,cal_data='')
>
> In [208]: corr.katadc.eeprom_details_get(fpga,1)
> Out[208]:
> {'adc_ic_id': 65535,
> 'pcb_rev': 65535,
> 'reserved': (65535, 65535, 65535, 65535),
> 'rf_fe_id': 65535,
> 'serial_number': 65535}
This looks like the write protect is not being disabled. Are other things on
the board working? RF frontend attenuator (hangs off an IO breakout chip on the
IIC bus)?
> Finally, is there "corr" documentation similar to "katcp" (sphinx), taking
> advantage of the docstrings in the python code?
The correlator parts of the code are all commented with docstrings for each
function.
In [17]: corr.katadc.reset?
Type: function
Base Class: <type 'function'>
String Form: <function reset at 0x1021ab410>
Namespace: Interactive
File: /usr/local/lib/python2.7/site-packages/corr/katadc.py
Definition: corr.katadc.reset(fpga, katadc_n, reset=False)
Docstring:
Reset the ADC and FPGA DCM. Set "reset" to True to hold in reset, False to
clear.
That's about as far as I'm likely to take any documentation. It does what I
need it to do already (that is, remind me what each function does and its call
looks like). Feel free to mail me any add-ons that you'd like and I'll roll
them into the next release. I'll try'n get a proper RCS in place if you're
interested in helping develop corr.
Jason