Skip to content
Discussion options

You must be logged in to vote

Allocate an array of sufficient size of 8bit or 16bit unsigned values. (import array)
Use register modification (datasheet) to:

  • Enable ADC on required channel.
  • Set max ADC speed. Divider INT/FRAC.
  • Change ADC to continuous mode.
  • Enable ADC FIFO.

It now spews out a continuous stream of ADC values via the FIFO.

Write a function (viper will do) which constantly checks the FIFO count, reads the values and puts'em into the (indexed) array.
That's basically it.
You'll have to think about trigger conditions, either at the beginning of after the measurement.
You'll also have to hope that a 2µs resolution is quick enough.

In case a pure digital (1/0) decision is enough, use the PIO instead. It'll…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@GitHubsSilverBullet
Comment options

@mendenm
Comment options

@veebch
Comment options

@mendenm
Comment options

Comment options

You must be logged in to vote
3 replies
@veebch
Comment options

@GitHubsSilverBullet
Comment options

Answer selected by veebch
@veebch
Comment options

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