KL25Z ADC PORT MUX PCR (0x07)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KL25Z ADC PORT MUX PCR (0x07)

Jump to solution
1,659 Views
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.

0 Kudos
Reply
1 Solution
1,139 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
3 Replies
1,139 Views
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 Kudos
Reply
1,140 Views
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 Kudos
Reply
1,139 Views
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 Kudos
Reply