KL25Z ADC PORT MUX PCR (0x07)

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

KL25Z ADC PORT MUX PCR (0x07)

ソリューションへジャンプ
2,337件の閲覧回数
Edrianocarlos
Contributor IV

Hi.

I am a little bit confusing with this.

I am using processor expert to configure the ADC and it came up with

  PORTB_PCR0 &= (uint32_t)~(uint32_t)((PORT_PCR_ISF_MASK | PORT_PCR_MUX(0x07)));

why the mux is 07? i have read the manual and the adc would be ALT(0). is this 07 right?

thanks in advance.

ラベル(2)
0 件の賞賛
返信
1 解決策
1,817件の閲覧回数
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Edriano:

Yes, the option for ADC in PTB0 is 0x0. Actually the 0x07 is just a mask for the AND operation ( &= ~(...)). So the written value to PORTB_PCR0[MUX] is 000.


Regards!,
Jorge Gonzalez

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

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,817件の閲覧回数
Edrianocarlos
Contributor IV

Hi thanks.

Ok they like to complicate things. know i see they are doing an & and then inverting everything in order to fit.

why can't they just write thinks like we can follow the manual.

0 件の賞賛
返信
1,818件の閲覧回数
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Edriano:

Yes, the option for ADC in PTB0 is 0x0. Actually the 0x07 is just a mask for the AND operation ( &= ~(...)). So the written value to PORTB_PCR0[MUX] is 000.


Regards!,
Jorge Gonzalez

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

0 件の賞賛
返信
1,817件の閲覧回数
adriancano
NXP Employee
NXP Employee

Hi,

What Jorge is saying is just right. Sometimes the code generated by Processor Expert is not easy to understand and you may think that there is a lot of code for a simple PORTB_PCR0 = 0x00; or nothing because this Pin is by default in its Analog alternative.

Regards,

Adrian

0 件の賞賛
返信