Mkl17 ADC

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

I am trying to read a voltage at pin 3 off of a mkl17z64 32QFN package.  that is PTE16 and the ADC channel is ADC0_SE1.

VDDA is connected to 3.3V.

VSSA is connected to GND.

I enabled ADC0 in SIM.

I configured PortE pin 16 to ALT 0 which is ADC0_SE1.

I configured the registers in the ADC are set to

CFG1 = 0x71

CFG2 = 0

SC2 = 0

SC3  = 0

PG = 0x8000

MG = 0x8000

Then is set

SC1A = 0x01

I wait til the SC1A[COCO] is set to say the conversion is done.

The result from the conversion is FF if the voltage is greater then 0V even if it is 0.013V

The result from the conversion is 00 if the voltage is less then 0V even if it is -0.004V

Is there some thing i am miss or forget to enable.

0 件の賞賛
返信
1 解決策
994件の閲覧回数
murraykevin
Contributor II

found the solution for packages under 36 pin the reference changes from VREFH to PTE30.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
995件の閲覧回数
murraykevin
Contributor II

found the solution for packages under 36 pin the reference changes from VREFH to PTE30.

0 件の賞賛
返信