AD Converter Initialization Bug with Kinetis?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AD Converter Initialization Bug with Kinetis?

Jump to solution
848 Views
Laartoor
Contributor III

I use PE together with a Kinetis K10. When I configure an ADC_LDD component to use analog input pins that need the analog mux to be set, that is SExb pins, and do not use a single SExa pin, Processor Expert (version bundled with CW 10.6) generates the following code:

  /* ADC0_CFG2: MUXSEL=1 */

  ADC0_CFG2 |= ADC_CFG2_MUXSEL_MASK;

  /* ADC0_CFG1: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,ADLPC=0,ADIV=3,ADLSMP=1,MODE=3,ADICLK=0 */

  ADC0_CFG1 = ADC_CFG1_ADIV(0x03) |

              ADC_CFG1_ADLSMP_MASK |

              ADC_CFG1_MODE(0x03) |

              ADC_CFG1_ADICLK(0x00);

  /* ADC0_CFG2: MUXSEL=0,ADACKEN=0,ADHSC=0,ADLSTS=3 */

  ADC0_CFG2 = (uint32_t)((ADC0_CFG2 & (uint32_t)~(uint32_t)(

               ADC_CFG2_MUXSEL_MASK |

               ADC_CFG2_ADACKEN_MASK |

               ADC_CFG2_ADHSC_MASK

              )) | (uint32_t)(

               ADC_CFG2_ADLSTS(0x03)

              ));

That is, it first sets the mux, and then resets it again. The code happily reads the SExa pin, I had to manually set the mux in my initialization function to get the code to reference the right input.

0 Kudos
1 Solution
572 Views
Petr_H
NXP Employee
NXP Employee

Hi,

it's a known problem and there is already a hotfix for it. You can find it in this thread: ADC issue with CW 10.6

Best regards

Petr Hradsky

View solution in original post

0 Kudos
2 Replies
573 Views
Petr_H
NXP Employee
NXP Employee

Hi,

it's a known problem and there is already a hotfix for it. You can find it in this thread: ADC issue with CW 10.6

Best regards

Petr Hradsky

0 Kudos
572 Views
Laartoor
Contributor III

Thank you.

Before I posted it, I checked for updates to make sure I report against the latest version. What is the correct place to check for available updates and hot fixes  to Processor Expert?

0 Kudos