Mkl17 ADC

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Mkl17 ADC

跳至解决方案
1,214 次查看
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 解答
996 次查看
murraykevin
Contributor II

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

在原帖中查看解决方案

0 项奖励
回复
1 回复
997 次查看
murraykevin
Contributor II

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

0 项奖励
回复