Hi there,
The PS says that a pin configure as a task will get the output overrided, but does it also get the input overrided?
Regards
Hi there,
The PS says that a pin configure as a task will get the output overrided, but does it also get the input overrided?
Regards
Hi,
This figure shows the different override "options" the hardware will apply:
https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=3_0_0_5_8_0#concept_o12_bgv_bs
When configuring a pin as input, and connecting it to GPIOTE, you need to ensure that you set the PIN_CNF field INPUT to '0' to connect the signal internally to the actual pin:
https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=3_0_0_5_8_1_9#register.PIN_CNF-0-31
If you set different pull-configurations, these will not be overridden by the hardware.
Kind regards,
Håkon
Hi Hakon,
I know the figure.
Not entirely sure if you have answer my question here.
So my question is, when I use a pin as a GPIOTE _task_ pin, is it possible to get the input buffer to work by configuring the PIN_CFG.INPUT as 0? i.e. Would the INPUT_OVERRIDE prevent me from that or is that override only used for GPIOTE _event_ pins?
I will be using the pin as a S0D1 (or should it be H0D1) to work in a I2C bus SCL/SDA.
My aim is to forward a master from another set of pins and have the hardware do almost all the work, except when we set a pin to 1, and it reads as 0, where I will have to reverse the direction in GPIOTE and wait for it to be 1 again to set the direction back to what it was.
Regards
If I understand correctly; You'll need to connect that specific signal into another available GPIO to do this, and connect those externally on your design (use a DK for testing for instance).
You cannot override an output (SCL/SDA) to also set it as a input and connect that again to GPIOTE->IN, using only one GPIO.
If I've misunderstood anything, please correct me.
Kind regards,
Håkon
Hi Hakon,
I am not planning on connect the same pin to 2 GPIOTE events.
I only need to connect 2 events to master SCL & SDA, and 2 tasks to slave SCL & SDA, but I need to be able to read the actual state on the task pins.
That is why I am asking about if the task configuration will force the INPUT OVERRIDE or only the DIR OVERRIDE.
Can you confirm that?
By software I can reverse the direction anytime it needs to, and checking the input value of an output task I can decide if the direction reverses or if the master inputs are forced down.
David Fernandez said:I only need to connect 2 events to master SCL & SDA, and 2 tasks to slave SCL & SDA, but I need to be able to read the actual state on the task pins.
Taking two events and triggering two tasks in another peripheral is no problem, using individual PPI channels, so lets forget about that scenario.
You want to read the state of a task pin - what do you mean by this? Do you want to read the actual state of the GPIO taken by a peripheral, or do you want to trigger something when that task occurs?
It still sounds to me like you want to connect several peripherals to the same GPIO, ie: TWIS and GPIOTE to operate on the same pin.
Best regards,
Håkon
Hi Hakon,
What I mean by reading the state of a task pin is that:
1. I want the input buffer to be connected to the pin.
2. I want to get the value seen by the input buffer.
Since the task pin will be configured as S0D1 or H0D1, the interesting thing is to read it when the task sets it.
Hi Hakon,
What I mean by reading the state of a task pin is that:
1. I want the input buffer to be connected to the pin.
2. I want to get the value seen by the input buffer.
Since the task pin will be configured as S0D1 or H0D1, the interesting thing is to read it when the task sets it.
Hi,
If I understand correctly, you want to read the input of an GPIO configured as output (overridden by a peripheral). That is not possible. You need to then connect that specific pin to another GPIO (configured as input) to do this.
Kind regards,
Håkon