AnsweredAssumed Answered

Problem reading ADC on K60

Question asked by Ken Armitage on Nov 19, 2017
Latest reply on Nov 21, 2017 by Daniel Chen


I have a requirement to sample one of the analogue inputs every 50us. I am using the lwadc_read() component to do this, but was getting some confusing results. Although the ADC is being clocked at 8MHz, the ADC appeared to be missing key events on the input. So I inserted the _lwadc_wait_next() component to ensure the data from the ADC was valid, before reading the result and although this went some way to fix the "missing" key events on the input, the length of time between samples became very long - approximately 130us..!!.

I tried increasing the frequency at which the ADC was clocked to 12MHz, and this reduced the time between valid samples from 130 to 70us but still significantly longer than expected.

The project is based on MQX4.1 and I am using Codewarrior V10.7.

The board is a custom but my starting point was the TWR-K60D100 and I used the BSP for this board as the starting point for the software.

Why is the ADC conversion time so long and more importantly, how do I change it from within the MQX environment...?

I'd really appreciate some help with this...!