Cannot know GPIO level with alt function

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

Cannot know GPIO level with alt function

Jump to solution
1,788 Views
Loadd
Contributor II

I use QTIMER3  input0 to capture a signal. In an interrupt,i'd like to know this signal's logic level.

GPIO alt has to be map to QTIMER3  , it seems like it cannot act like an usual GPIO as well ,because i cannot found any change in GPIO[n]--DR.  Can I get logicl level when i cofigure this pad with alt qtimer3.

I've notice SION already, but setting or not  it both dosen't work.

Tags (1)
0 Kudos
Reply
1 Solution
1,766 Views
mjbcswitzerland
Specialist V

Hi

Unfortunately I don't think that it is possible to directly read the state of an input that is not configured as GPIO.

mjbcswitzerland_0-1616474801304.png

This shows that it is possible to "read back" the value that was written to the DR register (when the GPIO is programmed to be an output) but this is not the pin state. None of the GPIO registers follow the input state when it is not connected (via the IOMUXC).

In most cases it will be necessary to connect the input to both the peripheral pin and also a free GPIO to be able to read its state.

A number of peripherals can however be connected to the XBAR - see this video for details of the XBAR: https://youtu.be/zNWIG-O7ZW0 so there are still some indirect methods of reading the state of various peripheral inputs. One possibility is to internally connect the peripheral input to an ACMP input so that the output of a comparator can signal whether it is low or high at that point in time (beware however that the ACMP may not follow fast signals). In an emergency it may be possible to connect such a peripheral input internally to the FLEXIO block and configure that to allow its logical state to be read.

Note too that the QTIMER inputs don't need to come directly from their pins but instead can be connected via the XBAR to come from other peripheral outputs. That means that a comparator input pin can be used as QTIMER input (passing through a comparator) and thus its state read from the input peripheral too.

These techniques may be a bit fiddly but may allow a certain case to be realised in n emergency. It is a shame that the i.MX RT is not a bit more like the Kinetis parts with respect to their GPIO since these allow a peripheral function to be used in parallel with the GPIO and so also port DMA and port interrupts are possible on the peripheral inputs. Apart from tricks with the XAR I didn't find a method to do this so I would also be happy if someone can correct me and show that it is possible somehow on the i.MX RT parts.

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, solutions to problems or rapid product development requirements

For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html

View solution in original post

0 Kudos
Reply
4 Replies
1,767 Views
mjbcswitzerland
Specialist V

Hi

Unfortunately I don't think that it is possible to directly read the state of an input that is not configured as GPIO.

mjbcswitzerland_0-1616474801304.png

This shows that it is possible to "read back" the value that was written to the DR register (when the GPIO is programmed to be an output) but this is not the pin state. None of the GPIO registers follow the input state when it is not connected (via the IOMUXC).

In most cases it will be necessary to connect the input to both the peripheral pin and also a free GPIO to be able to read its state.

A number of peripherals can however be connected to the XBAR - see this video for details of the XBAR: https://youtu.be/zNWIG-O7ZW0 so there are still some indirect methods of reading the state of various peripheral inputs. One possibility is to internally connect the peripheral input to an ACMP input so that the output of a comparator can signal whether it is low or high at that point in time (beware however that the ACMP may not follow fast signals). In an emergency it may be possible to connect such a peripheral input internally to the FLEXIO block and configure that to allow its logical state to be read.

Note too that the QTIMER inputs don't need to come directly from their pins but instead can be connected via the XBAR to come from other peripheral outputs. That means that a comparator input pin can be used as QTIMER input (passing through a comparator) and thus its state read from the input peripheral too.

These techniques may be a bit fiddly but may allow a certain case to be realised in n emergency. It is a shame that the i.MX RT is not a bit more like the Kinetis parts with respect to their GPIO since these allow a peripheral function to be used in parallel with the GPIO and so also port DMA and port interrupts are possible on the peripheral inputs. Apart from tricks with the XAR I didn't find a method to do this so I would also be happy if someone can correct me and show that it is possible somehow on the i.MX RT parts.

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, solutions to problems or rapid product development requirements

For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html

0 Kudos
Reply
1,757 Views
Loadd
Contributor II

Thank you for reply. I agree with your idea.In an emergency, it’s possible to change iomux alt to GPIO temperarily,in order to read logic value.But there is a risk for some peripheral. Maybe the best choice is to connect two pad to this signal. Occupied more but safe.

0 Kudos
Reply
1,770 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
To provide the fastest possible support, I'd highly recommend you try the below method.

jeremyzhou_1-1616468358041.png


Have a great day,
TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
1,755 Views
Loadd
Contributor II

Thank you for reply. But it still doesn't work. When I coufigure this, the content in PSR is from what I write in DR.

0 Kudos
Reply