• 0

PMODAD5 bipolar mode


Question

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 post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @SkeptoLogic,

Welcome to the forums! Unfortunately, We have not had time as of yet to make a library/demo for the PmodAD5. Here is a couple of projects done by analog devices for the PmodAD5 one with mplabx and one in MPIDE that might be helpful. Looking at the reference manual for the AD7193 here on page 26 under modes it discusses that a full-scale calibration is recommended each time the gain of a channel is changed. Have you done a full-scale calibration?  Also are you following the grounding and layout suggestions it discusses on page 53. I am not directly seeing anything wrong with your setting. Have you looked at the status register on page 23 making sure that the settings are how you want them? I have also reached out to one of my co-workers that has worked with the PmodAD5 much more recently than I to look into your thread as well.

cheers,

Jon

Link to post
Share on other sites
  • 0

Hey @SkeptoLogic,

Testing the configuration and mode settings you provided, I am getting similar outputs to what you stated you were reading (if I am understanding your post correctly). I am currently working on a library for the pmodAD5, so as I finish it up I should be able to give you some more definitive answers. In my recent experience with the AD5 though, and having read through the datasheet as well, I too have been having some difficulty deciphering differences between certain actual outputs and my expectations.

Sorry for not having a whole lot of info for you at the moment, but I should have something more next week as I look into this further (and hopefully a library to share).

Regards,

Nate

Link to post
Share on other sites
  • 0

Well, the library is still in the works, but I've done a little testing to see how the chip outputs its readings. 

Regarding just the raw data value you will get from a reading, the device seems to set the minimum reading (0x00 or 0) at the bottom of the range determined by the configuration settings and just outputs the data linearly. So your midpoint value would be 0x800000. Now the actual voltage range that is readable by the device is slightly less straight forward.

For an example, lets say you had the device configured for pseudo-differential inputs, bipolar mode, with a gain of 1. In this scenario my current setup is the PmodAD5 with the chipKIT Pro MX4. If i apply a voltage of 2.5V to the AINCOM pin (the reference pin for the analog inputs in pseudo mode), then the range of inputs around that 2.5V AINCOM reference is determined by the gain, which would be +-2.5V for the gain of 1 (so 0V to 5V in theory). With this setup, the applied input voltage of 2.5V gets me around the midrange (approx. 0x7FB500). Setting the device to unipolar mode sets the minimum value of the range to the 2.5V AINCOM reference, so an input of 2.5V should give you roughly 0, and an input of 5V would give the maximum value of 0xFFFFFF. (Side note, since the Pmod is powered by a 3.3V VDD, the upper limit ends up being around 3.3V, roughly 0xA00000/0x400000 bipolar/unipolar, instead of 5V).

So I guess to summarize:

  • the range is linear from min to max being 0x00 to 0xFF.
  • the range boundaries are dependent on your settings as well as your supplied voltage

Hope this is helpful!

Nate

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now