AnalogIn in 8-bit mode
Topic last updated
09 Jan 2011, by
Nitin Bhaskar.
3 replies
Hello everyone,
My application needs 8-bit AnalogIn data. But the existing lib has 16-bit conversion and no 8-bit conversion(I guess). Can anyone help me on this issue?
Thanks
Nitin
Replies
Hi Nitin,
Does the following give you what you need?
#include "mbed.h"
AnalogIn x(p20);
int main() {
uint8_t byte = x.read_u16() >> 8; // take most significant 8-bits of sample
}
Thanks,
Simon
Hi Simon,
Ya ultimately I have to try your suggestion. But is there a way to get 8-bit ADC without consuming extra CPU clocks? I am trying to build a oscillscope using mbed and a color lcd. So I cant consume more CPU clocks and do plotting of waveform at the earliest! What might be the maximum ADC speed? 200kHz?
Thanks
Nitin
Even at maximum ADC speed you don't have to worry about comsuming some extra CPU clocks.
Please log in to post a reply.
Hello everyone,
My application needs 8-bit AnalogIn data. But the existing lib has 16-bit conversion and no 8-bit conversion(I guess). Can anyone help me on this issue?
Thanks
Nitin