bandgap enable

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
768件の閲覧回数
Lupo
Contributor III

With ref to a mkl03z32 mcu, kds3.1 and ksdk1.3, when using the fsl_adc16 with the "Vref pair" as Voltage reference, the measure of the bandgap gives erratic measures...

It is so necessary to add the following code

    PMC_REGSC |= PMC_REGSC_BGBE_MASK;

    SIM_SCGC6 |= SIM_SCGC6_ADC0_MASK;

to make it operate.

Imho selecting the measure of the bandgap in the component should enable automatically the bandgap function, or at least show a warning!

ラベル(1)
タグ(2)
0 件の賞賛
1 解決策
474件の閲覧回数
isaacavila
NXP Employee
NXP Employee

Hello Michael,

The instruction SIM_SCGC6 |= SIM_SCGC6_ADC0_MASK; isn't necessary due it is already set in ADC16_DRV_Init function:

/* Enable clock for ADC. */

    CLOCK_SYS_EnableAdcClock(instance);

And for PMC_REGSC |= PMC_REGSC_BGBE_MASK, it is specified in Reference Manual's section 28.1.1 ADC0 connections/channel assignment a small note at the end of the table:

Bandgap note.jpgAnd when you specify A/D channel to be Bandgap (channel AD27) you only configure ADCH field for ADC0_SC1 register, so user should enable PMC bandgap independently because it is related to other module.

I hope this can help you!

Best Regards,

Isaac Avila

元の投稿で解決策を見る

2 返答(返信)
475件の閲覧回数
isaacavila
NXP Employee
NXP Employee

Hello Michael,

The instruction SIM_SCGC6 |= SIM_SCGC6_ADC0_MASK; isn't necessary due it is already set in ADC16_DRV_Init function:

/* Enable clock for ADC. */

    CLOCK_SYS_EnableAdcClock(instance);

And for PMC_REGSC |= PMC_REGSC_BGBE_MASK, it is specified in Reference Manual's section 28.1.1 ADC0 connections/channel assignment a small note at the end of the table:

Bandgap note.jpgAnd when you specify A/D channel to be Bandgap (channel AD27) you only configure ADCH field for ADC0_SC1 register, so user should enable PMC bandgap independently because it is related to other module.

I hope this can help you!

Best Regards,

Isaac Avila

474件の閲覧回数
Lupo
Contributor III

Thanks Isaac, my problem is  (was with ksdk v2) the too easy use of Processor Expert that often makes me forget about hw and manuals...

0 件の賞賛