4DSP Support Forum

Products => FMC Products => FMC150 => Topic started by: g.feu on July 08, 2014, 11:27 AM

Title: Correct the offset of the FMC151
Post by: g.feu on July 08, 2014, 11:27 AM

Hello,
I am currently working on the ADC / DAC conversion using fmc151 card, I noticed that there is an offset input and output of this card.
In fact, when I put an input signal of the ADC fmc, I notice that my signal is shifted by an offset of 75mV, so that the output is also shifted 75 mv, and it bothers me when I make conversion.
Is it possible to tell me how to correct this offset.
Thank you.
Title: Re: Correct the offset of the FMC151
Post by: arnaudNL on July 10, 2014, 04:44 AM
Dear Sir,


The DC offset is configured through the LTC2657 chip directly by i2c. The FMC151 user manual has some extra details on paragraph 5.6.


There are no guidelines on how to control the chip so please download and check the LTC2657 datasheet and you can look at fmc151_configure_dc_offset() in fmc15x.cpp. There are hardware writes to first the i2c master to define the number of bytes per cycles and then the LTC2657 is configured.


I expect that you should see definitions for registers 0x30, 0x31, 0x32 and 0x33.


Here is the function:


Code: [Select]

int32_t fmc151_configure_dc_offset(uint32_t AddrSipI2cMaster, uint32_t OffsetAdcA, uint32_t OffsetAdcB, uint32_t OffsetDacA, uint32_t OffsetDacB, uint32_t slaveaddress)
{
uint32_t rc;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Configure DC offset of channels
uint32_t AddrSipFMC150Offset = AddrSipI2cMaster + slaveaddress;


// Transform it
OffsetAdcA = ((OffsetAdcA & 0xFF00) >> 8) + ((OffsetAdcA & 0x00FF) << 8);
OffsetAdcB = ((OffsetAdcB & 0xFF00) >> 8) + ((OffsetAdcB & 0x00FF) << 8);
OffsetDacA = ((OffsetDacA & 0xFF00) >> 8) + ((OffsetDacA & 0x00FF) << 8);
OffsetDacB = ((OffsetDacB & 0xFF00) >> 8) + ((OffsetDacB & 0x00FF) << 8);


rc = sipif_writesipreg(AddrSipI2cMaster+0x01, 0x01); Sleep(10); //Number of data bytes in I2C cycle is two
if (rc)
return rc;
rc = sipif_writesipreg(AddrSipFMC150Offset+0x30, OffsetAdcA); Sleep(10); //Write to and update offset ADC A
if (rc)
return rc;
rc = sipif_writesipreg(AddrSipFMC150Offset+0x31, OffsetAdcB); Sleep(10); //Write to and update offset ADC B
if (rc)
return rc;
rc = sipif_writesipreg(AddrSipFMC150Offset+0x32, OffsetDacA); Sleep(10); //Write to and update offset DAC A
if (rc)
return rc;
rc = sipif_writesipreg(AddrSipFMC150Offset+0x33, OffsetDacB); Sleep(10); //Write to and update offset DAC B
if (rc)
return rc;
rc = sipif_writesipreg(AddrSipI2cMaster+0x01, 0x00);  //Number of data bytes in I2C cycle is one (default)
if (rc)
return rc;
Sleep(10);


return FMC15x_ERR_OK;
}


I hope that helps,


Arnaud

Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 10, 2014, 12:18 PM
 Dear Arnaud, we tried several things after your mail.
 
 We are also very concerned about the voltage we measure on the ADCs. They are supposed to be input channels (but when connecting them to a scope or a voltmeter, we measure a DC voltage of few 10s of mW) and having a DC signal without any signal generator connected is most disturbing for input channels !
 
 Finally, we don't understand why you mention a LTC2657 DAC whereas the card is supposed to have a TI3283 DAC. Anyway LTC doc did not help either.

Could you please propose us some other ideas of investigation.
Title: Re: Correct the offset of the FMC151
Post by: arnaudNL on July 15, 2014, 05:05 AM
Dear Sir,


I have forwarded that topic to our design team.


They will come back to you shortly.


Best Regards,
Arnaud
Title: Re: Correct the offset of the FMC151
Post by: peter on July 16, 2014, 10:42 AM
Dear Sir,


There is no need to be concerned, we use a standard differential opamp circuit to drive the ADC. One side of the opamp is driven by the input signal from the connector. The other side is driven by a small I2C DAC on the board. This is the DC offset correction. Not to confuse with the DAC3283, which is the DAC for the analog outputs. See block diagram Figure 1 in the User Manual.


If you have I2C access to the FMC151 you can use the DC offset correction feature. Please refer to section 5.6 in the User Manual to find the slave address of the offset correction DAC (LTC2657).


Best Regards,
Peter




Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 17, 2014, 04:45 AM
 we just realized that we were using the wrong version of the code (i.e. the one provided for the FMC150).
 with the correct code for FMC151,  the function  fmc151_configure_dc_offset function has an effect but we were not able to get offset on the ADC below +50mV neither  a negative offset.
 
Title: Re: Correct the offset of the FMC151
Post by: peter on July 17, 2014, 09:21 AM
Dear Sir,


I would need to know what kind of carrier platform you use and whether this carrier platform ties the signals GA0 and GA1 on the FMC connector high or low. With this information you can find the slave address from the look up table in the user manual.


Please do not change the addresses 0x30, 0x31, 0x32 and 0x33, because these are the internal addresses of the LTC2657; one address for each channel. In order to write to the LTC2657 you need to have the I2C slave address correct;


uint32_t AddrSipFMC150Offset = AddrSipI2cMaster + slaveaddress;


Have you tried to change the offset values to 0x0000 or 0xFFFF? Since the step size is small, you need to change the value significantly to see effect. 


Best Regards,
Peter
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 17, 2014, 10:14 AM
our board is a KC705.
 I think the function works OK with the setting of the FM151 code now but we did a loop scanning the offset values from 0x0000 to 0xFFFF.
 The smallest value is for 0x0000 and it corresponds to a 50 mV offset on the scope. The higher value is for 0xFFFF and corresponds to 100 mV while the mid value  0x7FFF correspond to 75 mV
Title: Re: Correct the offset of the FMC151
Post by: peter on July 17, 2014, 12:09 PM
Hello,


Please note there is a byte swap required for the value written in the register:


OffsetAdcA = ((OffsetAdcA & 0xFF00) >> 8) + ((OffsetAdcA & 0x00FF) << 8);


This does not explain the behavior you see because the byte swap should not matter for values 0x0000 and 0xFFFF. Please make sure you change all the channels to make sure you are not changing one channel and measuring the other.


Best Regards,
Peter
Title: Re: Correct the offset of the FMC151
Post by: arnaudNL on July 21, 2014, 05:31 AM
Dear Sir,


Have you obtained the required information? Can I go ahead and close this topic?


Best Regards,
Arnaud
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 21, 2014, 05:59 AM
Not yet. please don't close the topic
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 21, 2014, 06:00 AM
We did as you suggested by modifying both channels A and B at the same time but the pb remains



Hello,


Please note there is a byte swap required for the value written in the register:


OffsetAdcA = ((OffsetAdcA & 0xFF00) >> 8) + ((OffsetAdcA & 0x00FF) << 8) ;


This does not explain the behavior you see because the byte swap should not matter for values 0x0000 and 0xFFFF. Please make sure you change all the channels to make sure you are not changing one channel and measuring the other.


Best Regards,
Peter
Title: Re: Correct the offset of the FMC151
Post by: peter on July 22, 2014, 01:20 PM
Dear Sir,


The last thing I can think of is that the I2C multiplexer on the KC705 is not configured properly. Is the following code used in your main.cpp?



      if( constellation_id == CONSTELLATION_ID_FMC151_KC705) {
         sipif_writesipreg(AddrSipI2cMaster+0x7400, 0x04); // Switch set to LPC      
         Sleep(10);   
      }


Best regards,
Peter
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 23, 2014, 11:55 AM
yes this code is used and the program go through it.

Title: Re: Correct the offset of the FMC151
Post by: peter on July 23, 2014, 12:26 PM
Hello,


Please provide me with the following information:


- serial number of your FMC151


- run the reference app with offset values set to 0xFFFF

         if (fmc151_configure_dc_offset(AddrSipI2cMaster, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, slaveaddress) != 0) {
  Please leave inputs unconnected and provide me with the files adc0.txt and adc1.txt. You find these in the application directory after running the application.



- run the reference app with offset values set to 0x0000
         if (fmc151_configure_dc_offset(AddrSipI2cMaster, 0x0000, 0x0000, 0x0000, 0x0000, slaveaddress) != 0) {
  Please leave inputs unconnected and provide me with the files adc0.txt and adc1.txt. You find these in the application directory after running the application.


Thank you,
Peter
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 24, 2014, 12:12 PM
As requested, we did several experiments.  We also made a copy of the oscilloscope screen
What is the email address I shoud send the data to?
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 24, 2014, 12:17 PM
Please find enclosed the requested data and scope scree copies :
0x000 0x0000 0x7fff 0x7fff
0xffff    0xfffff   0x7fff 0x7fff
0x000 0x0000 0x0000 0x0000
0xffff 0xffff 0xffff 0xffff
Title: Re: Correct the offset of the FMC151
Post by: peter on July 24, 2014, 12:54 PM
Hello,


I don't see any issue. There is a large offset when value 0x0000 is used and a large offset in the other direction if value 0xFFFF is used. So if you want an offset near 0mV its a matter of calibration and find the right value to program to compensate for the offset error in the whole signal chain.


Peter
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 24, 2014, 02:41 PM
 First I don't agree with your analysis: whatever value between 0x0000 and 0xFFFF, the offset on ADC0 and ADC1 is always between 50 and 100 mW and doesn’t change sign as can be seen on channel 1 of the scope screen copies. (channel 1 is the ADC output and channel 2 is the DAC output).
Yes, offset does change sign for DAC0 and DAC1 and yes the accuracy will limit or impact how close we can be from 0 and this is quite acceptable. The DAC outputs are not the concerns. Once more the concern is about the CW voltage on ADC0 and ADC1 channels.
What I understand is that there is an issue with our card but you don’t have any solution for the ADC channels. However, your message seems to mean that I have to live with it and I am sorry to hear that from DSP support.
Having a voltage on the inputs channels is not acceptable as I will not connect the ADC to a scope but to a photodiode and the voltage will not only offset the signal but might well damage it or even reverse polarize it so that I got no/disturbed signal.
Could please transfer the issue to US: maybe they have some other ides that could help.
 
Title: Re: Correct the offset of the FMC151
Post by: peter on July 24, 2014, 03:01 PM
Hello,


I might have misunderstood the information given in earlier posts, but my conclusion based on what I have seen is that the card is working per design. It could be that the input specification does not match your requirements. Our input is 50 ohm matched and is expecting a 50 ohm source impedance, but might also work with other sources. A photodiode might require a different, or additional pre-amplifier of buffer. If you let me know what input characteristics you require we can look into the possibility of a specific build option.


Best Regards,
Peter
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 25, 2014, 06:09 AM
 the offset on the ADC channels doesn’t come from an impedance problem. We did check this by changing the impedance on the scope (1Mohms or 50 Ohms) channels connected to ADC0 and ADC1.Correct me if I misunderstand you but you are writing me that the fact that the card delivers a voltage on the input channels is OK? If I indeed understood you correctly the FMC151 is the only acquisition device (regarding ADC0 and ADC1) that I known that delivers a voltage on the channels where external sources that are supposed to be digitalized are connected. And if this a normal feature, how come it is not mention on any document ?
Title: Re: Correct the offset of the FMC151
Post by: peter on July 25, 2014, 10:23 AM
Hello,


Sorry for the confusion. What I meant to say is that the input of the FMC151 is designed to be driven by a 50 Ohm source. The voltage you see comes from the output common mode of the input stage through the feedback. Please find attached the input circuit of the FMC151. Hopefully which this schematic you will be able to figure out whether this will work with your photodiode, or whether an additional opamp stage is required. I noticed this schematic is not in our User Manaul, we will update this.


Thank you,
Peter
Title: Re: Correct the offset of the FMC151
Post by: arnaudNL on July 28, 2014, 04:20 AM
Dear Sir,


Was the information enough to waive out your concerns and answer your questions?


Can I go ahead and close this topic?


Best Regards,
Arnaud
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 28, 2014, 04:22 AM
Not yet. I will tets this week a gain unity buffer amplifier and check whether it is OK. please keep the post open in the meantime
Title: Re: Correct the offset of the FMC151
Post by: arnaudNL on July 28, 2014, 04:44 AM
Dear Paul,


Okay, lets do that, keep us updated.


Best Regards,
Arnaud
Title: Re: Correct the offset of the FMC151
Post by: g.feu on July 31, 2014, 01:52 PM
 I did try with an amplifier (Thurbly WA301). It is OK meaning that the DC offset is stopped by the amplifier and is not visible on the amplifier input side.
 I can live with this even if I found very disturbing getting a voltage on the ADC channels (frankly speaking I did not completely understood your explanation!). Anyway, we bought a second FMC 151 and we will see whether it is a design characteristic feature.
 
Title: Re: Correct the offset of the FMC151
Post by: arnaudNL on July 31, 2014, 04:08 PM

Dear Paul,


I am sorry to hear that you are disappointed about the characteristics of one of our products. On the other side I am pleased to hear that you will be able to accommodate with that one way or another.


May I go ahead and close this topic? You are free to open any other topic any time you need!


Best Regards,
Arnaud
Title: Re: Correct the offset of the FMC151
Post by: g.feu on August 01, 2014, 04:25 AM
Yes you can close the topic and thank you again for your support.
Title: Re: Correct the offset of the FMC151
Post by: arnaudNL on August 01, 2014, 04:31 AM
Dear Paul,


Feel free to get in touch with us for anything more.


You are welcome.


Best Regards,
Arnaud
Title: Re: Correct the offset of the FMC151
Post by: arnaudNL on August 01, 2014, 04:32 AM
This topic is being closed because the issue is considered as resolved by 4DSP. Feel free to create a new topic for any further inquiries.