Use ADC Bandgap in KL27

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Use ADC Bandgap in KL27

1,487件の閲覧回数
lokuate
Contributor III

Hi!

 

I'm using the reference code from the ADC16 driver example 'adc16_example_frdmkl27z' but cannot get correct conversions, I'm using the code:

 

  pmc_bandgap_buffer_config_t pmcBandgapConfig = {

      .enable = true,

  };

    // Enable BANDGAP reference voltage

    PMC_HAL_BandgapBufferConfig(PMC_BASE_PTR, &pmcBandgapConfig);

 

  ADC16_DRV_ConfigConvChn(FSL_ADCONV1, 0, &Vbgap);

  // Wait for the conversion to be done.

  ADC16_DRV_WaitConvDone(FSL_ADCONV1, 0);

  // Fetch the conversion value.

  adcValue = ADC16_DRV_GetConvValueSigned(FSL_ADCONV1, 0);

  // Pause the conversion.

  ADC16_DRV_PauseConv(FSL_ADCONV1, 0);

 

adcValue is either 0 or a single digit number less than 5, I configured the ADC to work with 12bits single mode.

 

Kindest Regards,

Carlos

ラベル(1)
タグ(3)
0 件の賞賛
返信
2 返答(返信)

1,139件の閲覧回数
lokuate
Contributor III

My project was generated using processor expert, I have spent 2 days trying to make the adc work... Please help.

C

0 件の賞賛
返信

1,139件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Carlos,

      I have a KL27 KSD project based on PE, it can printf the bandgap adc value, you can refer to it.

    Please find the project from the attachment.

Wish it helps you!

If you still have question, please contact me!


Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信