This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

related to gpio

  1. If i understand tasks are for outputs and events are for inputs.

  2. Wanted to know relationship between channel and the pin numbers. do they hold the relationship like Channel[(pinnumber/8)] = pinnumber; in other words channel 0 is for pin 0 to 7 channel 1 is for pin 8 to 15 channel 2 is for pin 16 to 23 channel 3 is for pin 24 to 31

  3. If i understand the GPIO pins can be hooked to functions [input events] using this mapping app_gpiote_user_register. so how about outputs, can outputs be normally driven by written value to the GPIO pins ??. or is there a way to pass the arguments to a GPIOTE function and get the output written onto GPIO.

  4. are there any restrictions w.r.t to configuring a pin w.r.t to input [event] and output [task]?

  5. what is task here, is it a seperate task having its own stack and behave like a task ?

  6. Once i configure the GPIO output to a channel, can i call the GPIo write funtion in main() or it has to be done as part of some task...[is that what you mean by task]??

Parents
  • You need to use the Programmable Peripheral Interconnect module (PPI) together with the task and/or event you set at GPIOTE. As said in the datasheet, the GPIOTE has events on Rising edge, Falling edge and Any change.

    1. I think that each GPIOTE channel can control one GPIO pin, so no relation between which pin that channel can control (If you see the GPIOTE example in the SDK, channel 0 controls pin 8).

    2. When setting up GPIOTE for a GPIO register, a write to GPIO will not work, only the task/event system will make any effect. From the datasheet:

    When an OUT[n] task or an IN[n] event has been configured to operate on a pin, the pin can only be written from the GPIOTE module. Attempting to write a pin as a normal GPIO pin will have no effect.

    What do you mean by pass arguments? If connected with GPIOTE, the pin should be controlled by some event in the system, e.g temperature ready, counter overflow, payload event from radio etc. If you do not want to control the pin with regards do event in the system without CPU interruption, you should not configure a GPIOTE channel to that pin.

    1. With GPIOTE, the pin is set to either task or event at initialization, so I will presume only one direction is allowed at a time.

    2. Sorry, I don't understand this question. All I can say is when you have defined a task, this task can be triggered from anywhere in you application through the GPIOTE module (usually triggered by some PPI connection)

    3. See 2. But for clearity; The GPIOTE can assign tasks to a GPIO pin, either set, clear or toggle. To do one of this, you have to initiate the task through the PPI (I don't know if you can do this manually)

    (The system automatically numbers my answers wrong, sorry about that)

Reply
  • You need to use the Programmable Peripheral Interconnect module (PPI) together with the task and/or event you set at GPIOTE. As said in the datasheet, the GPIOTE has events on Rising edge, Falling edge and Any change.

    1. I think that each GPIOTE channel can control one GPIO pin, so no relation between which pin that channel can control (If you see the GPIOTE example in the SDK, channel 0 controls pin 8).

    2. When setting up GPIOTE for a GPIO register, a write to GPIO will not work, only the task/event system will make any effect. From the datasheet:

    When an OUT[n] task or an IN[n] event has been configured to operate on a pin, the pin can only be written from the GPIOTE module. Attempting to write a pin as a normal GPIO pin will have no effect.

    What do you mean by pass arguments? If connected with GPIOTE, the pin should be controlled by some event in the system, e.g temperature ready, counter overflow, payload event from radio etc. If you do not want to control the pin with regards do event in the system without CPU interruption, you should not configure a GPIOTE channel to that pin.

    1. With GPIOTE, the pin is set to either task or event at initialization, so I will presume only one direction is allowed at a time.

    2. Sorry, I don't understand this question. All I can say is when you have defined a task, this task can be triggered from anywhere in you application through the GPIOTE module (usually triggered by some PPI connection)

    3. See 2. But for clearity; The GPIOTE can assign tasks to a GPIO pin, either set, clear or toggle. To do one of this, you have to initiate the task through the PPI (I don't know if you can do this manually)

    (The system automatically numbers my answers wrong, sorry about that)

Children
No Data
Related