FRDM-KL25z pinouts

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

FRDM-KL25z pinouts

4,066 Views
MihaelF
Contributor II

Hi.

I'm using FRDM-KL25z and slowly start moving from existing examples to my own applications.

I have trouble understand the pinout chart of the board.

For example, i don't get which pins can be used as digital IO and which as analog?

In those which can be used as DIO, every port can be defined to be used with internal pull-up?

I know from the tutorial that the PWN pins are connected to the RGB LED. But how can I see from the pinout table which pins are the PWM? (i know which are, because i know which pins are connected to the LED, but let's say i don't)

MIhael

0 Kudos
Reply
9 Replies

4,016 Views
MihaelF
Contributor II

Thanks you all,

I'll give it a try and see if it gets better

0 Kudos
Reply

4,041 Views
mjbcswitzerland
Specialist V

Hi

Try also the attached program:
1. Extract and double click on the file FRDM-KL25Z.exe (needs no installation)
2 A simulated FRDM-KL25Z runs and you can hover your mouse over its pins to see which they are connected to on the processor, which functions the pin can have and which function is presently active.

Video attached so you can see it in action too.

Regards

Mark
uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training or product development requirements

 

4,037 Views
myke_predko
Senior Contributor III

Hey @mjbcswitzerland ,

Very cool.  Is this available for all Freedom/Tower boards?  

@MihaelF - you have three ways now of skinning the cat and figuring out how the FRMD-KL26ZF IO connectors are wired.  

0 Kudos
Reply

4,030 Views
mjbcswitzerland
Specialist V

Myke

Yes it is available for all Kinetis and i.MX RT boards and can be added to any custom board as needed - it is one of many features in the uTasker project - see this for adding custom outputs for example: https://www.youtube.com/watch?v=x0oe4kscIDI&list=PLWKlVb_MqDQFZAulrUywU30v869JBYi9Q&index=3

Regards

Mark
uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training or product development requirements

 

4,052 Views
myke_predko
Senior Contributor III

Hey @MihaelF ,

Like you, I found the "pinout" descriptions overwhelming on the Freedom boards.  @ErichStyger is pointing you in the right direction but I would modify the message a bit.  

With the FRDM-K22F, which is what I tend to use for prototyping circuitry connections, I treat it like an Arduino and wire it to an Arduino prototyping shield.  This means that the inner rows of pins aren't available to me, but that's okay as it keeps me from trying to build too much into the circuit.  

Using the schematic I created the attached spreadsheet (image shown) which simply lists the pins which come out to the Arduino shield.

mykepredkomimet_1-1601478680375.png

 

I suggest that you try something like this, it really makes working with the Freedom boards easier.

myke

 

4,059 Views
ErichStyger
Specialist I

Hi Mihael,

that pdf only shows part of the information and does not give you the full picture. For this you would have to consult the device reference manual which might be daunting at first.

For an easy overview and as well as a powerful tool I recommend to have a look at the MCUXpresso IDE pins tool. I wrote a few articles about that tool here: https://mcuoneclipse.com/category/pins-tool/ 

In that tool you can easily identify the pins which have PWM capabilities with the FTM (Flex Timer Modul) hardware, see attached screenshot. Using the pins tool you can see as well which pins have pull resistors (not all have them, and it depends on the device too).

 

I hope this helps,

Erich

4,016 Views
MihaelF
Contributor II

Actually, the reference manual says they all are (or I don't understand it right?).

MihaelF_0-1601535315554.png

 

0 Kudos
Reply

3,998 Views
mjbcswitzerland
Specialist V

There is always a table showing any exceptions - the KL25Z has few exception but one much be careful because not all register bits are implemented on all ports. Sometimes interrupt and DMA are, for example, only possible on certain ports.

Specifically ee table 10-2 in KL25Z user's manual.

 

In the uTasker project macros are used as described here (makes port code compatible with all Kinetis and i.MX RT parts) - https://www.utasker.com/forum/index.php?topic=1875.0

Eg. to configure an input with pull-down

#define  SWITCH_2 PORTA_BIT12
_CONFIG_PORT_INPUT(A, (SWITCH_2), PORT_PS_DOWN_ENABLE);

or outputs with certain drive strengths, open-drain and initial states

#define LED_GREEN   PORTD_BIT3
#define LED_BLUE      PORTD_BIT7
#define LED_RED       PORTD_BIT23
_CONFIG_DRIVE_PORT_OUTPUT_VALUE(D, (LED_GREEN | LED_BLUE | LED_RED), (LED_GREEN), (PORT_ODE | PORT_SRE_SLOW | PORT_DSE_HIGH));

 

The macros handle also automatically configuring clock gating to ports (so that such potential mistakes are avoided) and configure multiple inputs/outputs on a single port with the same characteristics in one go.

Regards

Mark

 

 

0 Kudos
Reply

4,007 Views
myke_predko
Senior Contributor III

Hi @MihaelF ,

All GPIOs *can* be pulled up - when you enable the pin, there is the option (either on the Pin Wizard or when you manually configure the pin).  

Here's the code for enabling a pull up taken from the Pin Wizard generated code:

PORTC->PCR[3] = ((PORTC->PCR[3] &
/* Mask bits to zero which are setting */
       (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_ISF_MASK)))

/* Pull Select: Internal pullup resistor is enabled on the corresponding
pin, if the 
corresponding PE field is set. */
     | (uint32_t)(kPORT_PullUp));

myke

0 Kudos
Reply