- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I want to Blink two LEDs on the intel quark D2000 kit but only the last pin configured working.
There is no example or project provided to use two digital pins.
Please help me and write down the code for me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Just make sure you have the GPIO Direction set correctly - below code will blink 2 LED's on the D2000 Development Platform.
PIN 24 - mapped to DIO9 on the Arduino shield interface on the board (& the onboard LED)
PIN 11 - mapped to DIO2 on the Arduino shield interface
/* The following defines the pin and pin mux details for each SoC. */
# if (QUARK_SE)
# define PIN_OUT 25
# define LED_PIN_ID (QM_PIN_ID_59)
# elif(QUARK_D2000)
# define PIN_OUT 24
# define LED_PIN_ID (QM_PIN_ID_24)
# define PIN_OUT2 11
# define LED_PIN_ID2 (QM_PIN_ID_11)
# endif
# define PIN_MUX_FN (QM_PMUX_FN_0)
# define DELAY 250000UL /* 0.25 seconds. */
int main(void)
{
static qm_gpio_port_config_t cfg;
/* Set the GPIO pin muxing. */
qm_pmux_select(LED_PIN_ID, PIN_MUX_FN);
qm_pmux_select(LED_PIN_ID2, PIN_MUX_FN);
/* Set the GPIO pin direction to out and write the config. */
cfg.direction = BIT(PIN_OUT)| BIT(PIN_OUT2);
qm_gpio_set_config(QM_GPIO_0, &cfg);
/* Loop indefinitely while blinking the LED. */
while (1) {
qm_gpio_set_pin(QM_GPIO_0, PIN_OUT);
qm_gpio_set_pin(QM_GPIO_0, PIN_OUT2);
clk_sys_udelay(DELAY);
qm_gpio_clear_pin(QM_GPIO_0, PIN_OUT);
qm_gpio_clear_pin(QM_GPIO_0, PIN_OUT2);
clk_sys_udelay(DELAY);
}
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Just make sure you have the GPIO Direction set correctly - below code will blink 2 LED's on the D2000 Development Platform.
PIN 24 - mapped to DIO9 on the Arduino shield interface on the board (& the onboard LED)
PIN 11 - mapped to DIO2 on the Arduino shield interface
/* The following defines the pin and pin mux details for each SoC. */
# if (QUARK_SE)
# define PIN_OUT 25
# define LED_PIN_ID (QM_PIN_ID_59)
# elif(QUARK_D2000)
# define PIN_OUT 24
# define LED_PIN_ID (QM_PIN_ID_24)
# define PIN_OUT2 11
# define LED_PIN_ID2 (QM_PIN_ID_11)
# endif
# define PIN_MUX_FN (QM_PMUX_FN_0)
# define DELAY 250000UL /* 0.25 seconds. */
int main(void)
{
static qm_gpio_port_config_t cfg;
/* Set the GPIO pin muxing. */
qm_pmux_select(LED_PIN_ID, PIN_MUX_FN);
qm_pmux_select(LED_PIN_ID2, PIN_MUX_FN);
/* Set the GPIO pin direction to out and write the config. */
cfg.direction = BIT(PIN_OUT)| BIT(PIN_OUT2);
qm_gpio_set_config(QM_GPIO_0, &cfg);
/* Loop indefinitely while blinking the LED. */
while (1) {
qm_gpio_set_pin(QM_GPIO_0, PIN_OUT);
qm_gpio_set_pin(QM_GPIO_0, PIN_OUT2);
clk_sys_udelay(DELAY);
qm_gpio_clear_pin(QM_GPIO_0, PIN_OUT);
qm_gpio_clear_pin(QM_GPIO_0, PIN_OUT2);
clk_sys_udelay(DELAY);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thank you MichelleC_Intel
my mistake as you expected in GPIO direction setup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi
I wanted to use your code, but it did not work, it presents many errors and uses the two quark interface
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi ,
Can you please post the errors you encountered so that we can try to determine the issue.
-Michelle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
/* The following defines the pin and pin mux details for each SoC. */
# if (QUARK_SE)
# define PIN_OUT 25
# define LED_PIN_ID (QM_PIN_ID_59)
# elif(QUARK_D2000)
# define PIN_OUT 24
# define LED_PIN_ID (QM_PIN_ID_24)
# define PIN_OUT2 11
# define LED_PIN_ID2 (QM_PIN_ID_11)
# endif
# define PIN_MUX_FN (QM_PMUX_FN_0) /*Error 'QM_PMUX_FN_0' undeclared (first use in this function)*/
# define DELAY 250000UL /* 0.25 seconds. */
int main(void)
{
static qm_gpio_port_config_t cfg; /* unknown type name 'qm_gpio_port_config_t'*/
/* Set the GPIO pin muxing. */
qm_pmux_select(LED_PIN_ID, PIN_MUX_FN); /*'LED_PIN_ID' undeclared (first use in this function)*/
qm_pmux_select(LED_PIN_ID2, PIN_MUX_FN); /*'LED_PIN_ID2' undeclared (first use in this function)*/
/* Set the GPIO pin direction to out and write the config. */
cfg.direction = BIT(PIN_OUT)| BIT(PIN_OUT2); /*'PIN_OUT2' undeclared (first use in this function)*/
qm_gpio_set_config(QM_GPIO_0, &cfg);/*'QM_GPIO_0' undeclared (first use in this function)*/
/* Loop indefinitely while blinking the LED. */
while (1) {
qm_gpio_set_pin(QM_GPIO_0, PIN_OUT);
qm_gpio_set_pin(QM_GPIO_0, PIN_OUT2);
clk_sys_udelay(DELAY);
qm_gpio_clear_pin(QM_GPIO_0, PIN_OUT);
qm_gpio_clear_pin(QM_GPIO_0, PIN_OUT2);
clk_sys_udelay(DELAY);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
You will need to ensure you include the qm_pinmux.h
# include "clk.h"
# include "qm_gpio.h"
# include "qm_pinmux.h"
-- regards,
Michelle.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page