• 0

Pmod AD5_Out data rate



I bought one PmodAD5, and tried to change its output data rate.

I know sample rate can be changed by mode register value;However, how can i make changes to highest value(4.8kHz) of mode register in code.


Share this post

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @Yenyulu,

If you look at the AD5_WriteConfig in the PmodAD5.c it shows how to access the CONFIGURATION REGISTER along with how to set the 24-bit register. Here is the data sheet. The configuration register is 0x10(page 27 of data sheet). The mode register can be accessed in the same way the AD5_WriteConfig accesses the CONFIGURATION REGISTER along with setting the 24-bit register. The mode register is 0x01(page 24 of data sheet). Page 24, 25 and 26 discusses how to set the 24 bit register to get your desired output data rate along with other mode settings. On page 25 it shows that there is more than one way to set the output data rate to the 4.8 KHz based on how you set some of the other settings.

As for the code you could make your own mode function that should be called in the begin function. Something like this:

void AD5_WriteModeConfig(PmodAD5* InstancePtr)
    u8 bytes[4];
    bytes[0] = 0x01; //first byte is sent to the mode register which sets communication to
     //writing the next 3 bytes to the mode register

    //you will need to determine how you want the mode register set up.
    bytes[1] = 0x00;
    bytes[2] = 0x00;
    bytes[3] = 0x00;

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




thank you,


Share this post

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