I am working on a Project with the use of the PSOC 5 LP device. Our goal is to program a device for real time monitoring of a physiological parameter. At the moment, we are simulating the generation of the real signal with the use of the WAVEDAC component. However ,even if the signal is generated within a range of 0-2V, after the conversion of the ADCDELTASIGMA, the signal is remapped into all the dynamics of the ADC component(i.e. 0-5V). The output signal of the ADC is converted in mV using the function ADC_DelSig_Wave_CountsTo_mVolts. This converted signal does not have the original value between 0-2000 mV, but all the values are remapped between about 180-4700 mV.
Since the real device operates on a real signal, we do not know the real range of this signal and hence we can’t digitally convert the output of the ADC in order to obtain said real signal. In other words, despite the simulated signal is between 0-2000mV, the output signal read from the ADC is between 0-5000mV but it cannot be related to the input signal. Therefore, this output signal can’t be used for a further processing.
What I would like to know is how we can maintain the original range between 0-2000mV also after the conversion. May I have your support? Do you have some hints or suggestion on how to proceed?
Thank you in advance for your reply,
Will you be able to share more details about your project ? To share your project , open your project in PSoC Creator , go to File -> Create Workspace Bundle -> Select minimal. Please attach the generated file. Could you also let me know your hardware setup. One more thing I want you to check is the the voltage values in CYDWR -> Systems tab. These values are used by the ADC_DelSig_Wave_CountsTo_mVolts. Could you please check whether these values are proper?
thank you for your reply. i attach the minimal project as you requested. I have set the VDD to 5V because in real case i don't really know the voltage range of my signal(which in any case is lower than 5V).I use a WAVEDAC8 in order to generate a sinus signal between 0-4V which is the input of the ADC delsig(16 bit, clock frequency of 500kHz). The sampled signal is converted into mV and then sent via bluetooth to a display device.
I thank you in advance for your reply
Could you please change the type of the variable from unsigned to signed.
extern int32 value;
ADC_GetResult16 function returns signed result. Please let me know whether this solves the issue.
thank you for your reply. I set the type of the variable from unsigned to signed as you suggested but now my signal is within -2500 and +2500 mV while my input is between 0-4000mV. Considering the offset of the ADC, I set VDD to 4.2V with the variable as the former uint32 and now I obtain the correct output value0-4000mV. I hope this works also with the real signal.
thank you for your support,
I checked your configuration at my end. With correct value at CYDWR -> Systems -> VDDA, I could get right results from the ADC. Please let me know if you face any other issues.