Jump to content
  • 0

Changing data rate of Pmod AD5


Mingfei

Question

Hi everyone,

I'm using Pmod AD5 on PYNQ Z1 board. I used the demo code and it works fine. I'm wondering if I can change the data rate of Pmod AD5? By default it is about 6 samples per second and I want to change it to about 50. I checked the AD7193 datasheet and it says the last 10 bits of mode registers control the data rate (FS[0] to FS[9]). I found a function in demo code called "AD5_WriteConfig(PmodAD5* InstancePtr)" . Can I ask that should I change values in Bytes[3] to change data rate? Since I tried some numbers in Bytes[3], it doesn't work.

Function:

image.png.746c1710655c189b7b2a3fbe1ae1d7df.png

Datasheet:

image.png.0413ce0be487f05fe57547e352864cee.pngimage.png.d76bb19a1cf267caeac7e03584153331.png

 

Thank you for your help

Mingfei

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Hi @Mingfei,

Sorry for the delay, to write to the mode register you would want to add an additional XSpi_Transfer in the AD5_WriteConfig

something like this:

void AD5_WriteConfig(PmodAD5* InstancePtr)

{

u8 bytes[4];

bytes[0] = 0x08; //first byte is sent to the communication register which sets communication to

//writing the next 3 bytes to the mode register

//then configure the mode register how you would like it (page 24 of the datasheet)

bytes[1] = 0x00;// you decide mode register configuration

bytes[2] = 0x00;//you decide mode register configuration

bytes[3] = 0x00;//you decide mode register configuration

 

XSpi_Transfer(&InstancePtr->AD5Spi, bytes, bytes, 4);

 

bytes[0] = 0x10; //first byte is sent to the communication register which sets communication to

//writing the next 3 bytes to the Configuration register

//gain is set to 1 and in differential mode

bytes[1] = 0x00;

bytes[2] = 0x01;

bytes[3] = 0x10;

XSpi_Transfer(&InstancePtr->AD5Spi, bytes, bytes, 4);

 

}

 best regards,

Jon

Link to comment
Share on other sites

Hi Jon,

Thank you so much for helping me out! Forgive me for late reply. I was working on my final report recently. Just one more question, in "main" function in demo code. I noticed that there is a sleep(10); function which can set 10 seconds delay before generating the next output. By changing this delay, the output data rate from SDK console can also be changed. So can I ask that if the data rate we set in "mode register" is the maximum data rate that can be achieved?

Mingfei 

Link to comment
Share on other sites

Hi @Mingfei,

We added the sleep(10) to ensure that all of the current processes on the IC are complete before trying to get additional data from the IC. If you are wanting to increase the data rate I would suggest to reduce the sleep delay and or remove it. I would also look through the datasheet for timing constraints with the IC to ensure that you are not giving the IC the needed time to finish current processes.

best regards,

Jon

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...