Hi Luis
>> --------------------------
>> In [41]: fpga.progdev('katadc_alone_2011_Mar_25_1844.bof')
>> Out[41]: 'ok'
>>
>> In [36]: corr.katadc.get_ambient_temp(fpga,0)
>> Out[36]: 0.0
This is not right. Your adc is definitely in ZDOK slot zero? Unfortunately
there's very little error handling in the adc bits of corr at this stage.
>> In [37]: corr.katadc.eeprom_details_get(fpga,0)
>> Out[37]:
>> {'adc_ic_id': 0,
>> 'pcb_rev': 0,
>> 'reserved': (0, 0, 0, 0),
>> 'rf_fe_id': 0,
>> 'serial_number': 0}
>> --------------------------
KATADCs are all shipping with blank EEPROMs. So don't expect sensible values
here unless you've programmed the I2C eeprom using the eeprom_details_set
function.
As Dave suggests, let's first try to see if communications are ok with your
roach:
fpga.write_int('sys_scratchpad',1234)
fpga.read_uint('sys_scratchpad')
This should return 1234. If that's broken then you've got something else wrong.
If it fails, check network settings etc. Useful debug tools: fpga.ping() will
reveal if katcp comms are ok. fpga.status() will report on FPGA programming
status.
fpga.est_brd_clk() is a crude check of your FPGA clock rate and does a read
across the bus/userspace clock domains on the fpga. This will reveal if your
PPC is having trouble talking to your FPGA application or if your FPGA isn't
being clocked correctly.
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)
if that returns a zero value then I'm inclined to say there's something wrong
with your compiled FPGA KATADC IIC controller. But there's also a chance your
temperature sensor is faulty. So you can try'n write/read to another IIC
device: corr.katadc.eeprom_details_set(fpga,0,1234,567,8,9,cal_data='')
followed by corr.katadc.eeprom_details_get(fpga,0) should return those values.
It's unlikely both the EEPROM and temperature sensor are faulty. If neither of
these work, check that your IIC bus on the ADC card isn't faulty (maybe shorted
or something) and that the FPGA IIC controller is doing what it should. Maybe
stick the IIC bus on an oscilloscope.
Jason