how to do ADC sequencing on the SAMD21?

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,


My group is using the SAMD21 to read voltages from 4 phototransistor for a school project. I've used the ADC on the L21 before, so I thought it would be trivial to separate out the 4 values, but the D21 is missing the SEQSTATUS register that the L21 has.


How do I guarantee that if the processor is putting the right values into the right variables? If the thing runs slow enough, can I just assume it won't skip a reading and screw things up? I don't know enough about the MCU to feel comfortable doing that.


I guess a ring buffer might help, but I think there would still be the same problem. If the adc skips a value for some reason, the whole thing will be off.


Actually, I forgot about the ADC overrun interrupt. Maybe I can still do a counter, but just have the counter increment on the overrun as well as when it reads the value, just to be safe.


Any other advice would be greatly appreciated though!