FRDM-K64 PIN Digital Read

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

FRDM-K64 PIN Digital Read

977 Views
antonioangelm24
Contributor I

Hi.

I have a simple question. How do I use the DigtialRead function from Arduino in my FRMD K64 in C?. I need to read either high or low (1 | 0). I was trying this with the GPIOx_PDIR function but this doesn't write you a Logic 0 when the read is 0.

Can anyone help me out?

Thank you very much. 

Labels (1)
2 Replies

850 Views
mjbcswitzerland
Specialist V

Hi Antonio

If a pin is configured as GPIO (with clock gated to it) and its GPIOx_PDDR is '0' you can read its state in the GPIOx_PDIR register.

I don't have the impression that developers using the NXP forum use Arduino so you may find more suitable answers to your environment at the Teensy forum - the TEENSY 3.5 uses the K64.

In case you are making a transition from the Arduino world you can try the uTasker project (open source on Git Hub) since it also supports TEENSy 3.5 (and FRDM-K64F etc.), including simulation of the device/board so that you can more easily learn the internal workings. It doesn't constrain you to a certain environment since it is neutral and includes project for most common IDEs (MCUXpresso, CW, KDS, IAR, Keil, Rowley, Atollic, etc...).

Regards

Mark

850 Views
antonioangelm24
Contributor I

Hello Mark,

Thank you for your answer. I'll get to that, and will check the uTasker you mencioned.

Thanks.

0 Kudos
Reply