Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ad2s1210.C configuration issue concerning 10 bits resolution #1

Open
blotfi opened this issue Nov 21, 2023 · 0 comments
Open

ad2s1210.C configuration issue concerning 10 bits resolution #1

blotfi opened this issue Nov 21, 2023 · 0 comments

Comments

@blotfi
Copy link

blotfi commented Nov 21, 2023

Dear authors

I found your ad2s1210 code and I am adapting it to F28379D
may I show you an issue in your
ad2s1210.C file

 void ad2s1210_conf(void) {
//Setting excitation frequency to 4.5KHz
  gpio_clear(GPIOA, GPIO2);
  spi_write(SPI2, AD2S1210_REG_EXC_FREQ);
  spi_read(SPI2);
  gpio_set(GPIOA, GPIO2);
  gpio_clear(GPIOA, GPIO2);
  spi_write(SPI2, 0x12); // 4.5KHz
  spi_read(SPI2);
  gpio_set(GPIOA, GPIO2);

  //Setting resolution to 10bits
  gpio_clear(GPIOA, GPIO2);
  spi_write(SPI2, AD2S1210_REG_EXC_FREQ);
  spi_read(SPI2);
  gpio_set(GPIOA, GPIO2);
  gpio_clear(GPIOA, GPIO2);
  spi_write(SPI2, 0x12); // 4.5KHz
  spi_read(SPI2);
  gpio_set(GPIOA, GPIO2);

}

As you can see, you omit the 10 bits resolution part
in order to do that
you should address the correct register
#define AD2S1210_REG_CNTRL 0x92
and the correct value
0x7F for 16 bits
0x7E for 12 bits which is the default value
0x7C for 10 bits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant