I have a ChipKit Wi-Fire board and using MPIDE 0150 (2015-03-18 build). One reason I picked this board was because the MCU has an ADC which can support sampling rates up to 500 ksps (for my project I would need around 200 ksps, 8 bit resolution). When I do a simple test and capture the time (micros()) before an after the analog read, I end up with a time difference of 2469 us, which means a meager ADC sampling rate of 405 sps. Why is it so slow? How can I achieve rates up to 200 ksps with MPIDE and the built in libraries? I found an article for the Arduino board, where someone has boosted up the sampling rate by going around the analog read
Would I have to do something similar in my case? Has anyone done this for the ChipKit boards and could share some code? I would assume there must be more people than myself who has the need for a fast ADC. The code I wrote to test the analog read speed is as follows:
int sensorPin = A12;
int sensorValue = 0;
int start_time;
int end_time;
void setup() {
Serial.begin(9600);
}
void loop() {
start_time = micros();
sensorValue = analogRead(sensorPin);
end_time = micros();
Serial.println(end_time-start_time, DEC);
while(1);
}
Question
c64
Hi,
I have a ChipKit Wi-Fire board and using MPIDE 0150 (2015-03-18 build). One reason I picked this board was because the MCU has an ADC which can support sampling rates up to 500 ksps (for my project I would need around 200 ksps, 8 bit resolution). When I do a simple test and capture the time (micros()) before an after the analog read, I end up with a time difference of 2469 us, which means a meager ADC sampling rate of 405 sps. Why is it so slow? How can I achieve rates up to 200 ksps with MPIDE and the built in libraries? I found an article for the Arduino board, where someone has boosted up the sampling rate by going around the analog read
library:
http://www.microsmart.co.za/technical/2014/03/01/advanced-arduino-adc/
Would I have to do something similar in my case? Has anyone done this for the ChipKit boards and could share some code? I would assume there must be more people than myself who has the need for a fast ADC. The code I wrote to test the analog read speed is as follows:
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.