I am using the PMODAD5, and was trying to get bipolar results out. My settings are config = 0x840150 for bipolar, and 0x840158 for unipolar, and mode = 0x080402. I assumed the U/B* bit in the config register would control the data format, linear or "unipolar" vs 2s compliment or "bipolar". I expected that with a 2.5 volt reference, and about 2.5 volt input signal, that unipolar would result in numbers close to the unsigned mid-scale, like a lot of numbers around 7FFFFF and 800000, and that the bipolar setting would yield 2s complement versions of the same values, so I would get a lot of numbers around 000001 (+1) and FFFFFF (-1). Instead I found bipolar mode gives me unipolar numbers around zero like 800000 and 7FFFFF and unipolar mode gives me half zeros, and half small numbers like 000001. The data sheet is very vague on this topic and does not describe the encoding at all, so I have had to make some assumptions on what this does. I am hoping that others can confirm similar results or provide a better explanation of the control bit than is provided in the data sheet.
Note: I am seeing numbers much greater than +- 1, but simplified this for the explanation. The numbers I am getting are +- 2^16, probably because the ADC is run off of my computer's USB power supply.
Question
SkeptoLogic
I am using the PMODAD5, and was trying to get bipolar results out. My settings are config = 0x840150 for bipolar, and 0x840158 for unipolar, and mode = 0x080402. I assumed the U/B* bit in the config register would control the data format, linear or "unipolar" vs 2s compliment or "bipolar". I expected that with a 2.5 volt reference, and about 2.5 volt input signal, that unipolar would result in numbers close to the unsigned mid-scale, like a lot of numbers around 7FFFFF and 800000, and that the bipolar setting would yield 2s complement versions of the same values, so I would get a lot of numbers around 000001 (+1) and FFFFFF (-1). Instead I found bipolar mode gives me unipolar numbers around zero like 800000 and 7FFFFF and unipolar mode gives me half zeros, and half small numbers like 000001. The data sheet is very vague on this topic and does not describe the encoding at all, so I have had to make some assumptions on what this does. I am hoping that others can confirm similar results or provide a better explanation of the control bit than is provided in the data sheet.
Note: I am seeing numbers much greater than +- 1, but simplified this for the explanation. The numbers I am getting are +- 2^16, probably because the ADC is run off of my computer's USB power supply.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.