Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
1,385 Views

Sensor Subsystem: GPIO Not Working as expected

Hi All,

I am writing an application for reading the digital input through GPIO pins in sensor subsystem but it is not working.

I am attaching my code. Please have a look and suggest appropriately.

Attachment:

1. main.c: Code written in sensor subsystem. using GPIO_SS[14] for getting input.

2. quark_pin_configuration.jpg : Image to show the quark pin and function configuration.

3. schematic : Image to show the input data source. IN image on pin 4 (GPIO_PLT_LS_CLK_0) I am getting the digital input.

ERROR: IN this code I am just reading the input coming on pin4 of grove connector. It should be High low toggling but I found it always low.

Can anyone help me debug this issue?

Thanks & Regards,

Rohit

8 Replies
Highlighted
Employee
15 Views

Hi Rohit,

Thank you for contacting us. We'll try to help you resolve this issue. First, which board are you using?

We'll be waiting for your response.

-Sergio

0 Kudos
Highlighted
15 Views

Hi Sergio,

First of thanks for giving your valuable time.

I am working on board which is still under development. Its name is Mini Peak Island.

Regards,

Rohit

0 Kudos
Highlighted
Employee
15 Views

Thank you for replying back. What we meant with our previous post was what Quark microcontroller are you using? Are you using a Quark D2000 a Quark C1000 or other?

We'll be waiting for your response.

-Sergio

0 Kudos
Highlighted
15 Views

Hi Sergio,

It uses the Quark C1000 Micro controller. In D2000 there is nothing like Sensor Sub System.

Regards,

Rohit

0 Kudos
Highlighted
15 Views

Hi Rohit,

On the C1000 Sensor Subsystem there are 16 GPIO's. We have had some reports of issues with GPIO's 8 - 15 on the Sensor Subsystem which we are currently looking into.

You should be able to use GPIO's 0 - 7 though. Can you try one of those and let me know if you see the same problem.

-- Michelle.

0 Kudos
Highlighted
15 Views

Hi Michelle,

Thanks for your help.

I tested sensor subsystem GPIO's 0-7. Yes these are working properly, problem is only with GPIO's 8-15.

Regards,

Rohit

0 Kudos
Highlighted
Community Manager
15 Views

Hi Michelle,

We are dealing with the same problems in a custom board with the SS GPIOs between the 8 and 15. Did you find the solution or workaround about this?.

We are using:

  • Curie Module (Quark SE C1000)
  • QMSI Drivers 1.3.1
  • Zephyr 1.6

Thank you in advance. Best regards,

fluiss

0 Kudos
Highlighted
15 Views

Apologies for the delay responding on this. The issue was in the documentation - which implies all 16 SS GPIO's belong to SS block 0 - SS_GPIO_0

In fact :

SS GPIO pins 0-7 belong for SS_GPIO_0

SS GPIO pins 8-15 belong to SS_GPIO_1

Pins 8-14 become 0-6 from the point of view of GPIO block 1 so you need to take this into account when reading the pin state

e.g. qm_ss_gpio_read_pin(QM_SS_GPIO_1, PIN_OUT-8, &state)

Let me know if you have any questions. Example below for SS GPIO pin 12 ....

# include "qm_ss_gpio.h"

# include "qm_pinmux.h"

# include "qm_common.h"

# include "qm_uart.h"

# include "clk.h"

# include "ss_clk.h"

# define PIN_OUT 12

int main(void)

{

qm_ss_gpio_state_t state;

qm_ss_gpio_port_config_t conf;

QM_PUTS("Starting: SS GPIO\n");

/* Set GPIO mux mode. */

qm_pmux_pullup_en(QM_PIN_ID_65, true);

qm_pmux_select(QM_PIN_ID_65, QM_PMUX_FN_0);

qm_pmux_input_en(QM_PIN_ID_65, true);

/* Request IRQ and write SS GPIO port config. */

conf.direction = BIT(0);

ss_clk_gpio_enable(QM_SS_GPIO_1);

qm_ss_gpio_set_config(QM_SS_GPIO_1, &conf);

/* Clear PIN_OUT to trigger PIN_INTR interrupt. */

//qm_ss_gpio_set_pin(QM_SS_GPIO_0, PIN_OUT);

//qm_ss_gpio_clear_pin(QM_SS_GPIO_0, PIN_OUT);

while(1){

if (qm_ss_gpio_read_pin(QM_SS_GPIO_1, PIN_OUT-8, &state)) {

QM_PUTS("Error: read pin failed\n");

return -EIO;

}

QM_PRINTF("state is %d\n",state);

}

QM_PUTS("Finished: SS GPIO\n");

return 0;

}

0 Kudos