How to turn on LED

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable


On page 13 of BCM20732S Technical Reference Manual on page 13 it shows Pin 39 has having dual functionality.

I want to be able to use GPIO:28 alternate function LED1 from the description

How do I go about getting this to work?

0 Likes
1 Solution
Anonymous
Not applicable

This works with the divide by 16 etc ... thanks!

This can be closed out.

View solution in original post

0 Likes
11 Replies
Anonymous
Not applicable

Let me re-phrase this ...

What simple call do I need to make to keep it powered ON when chip is powered ON?

I got it to blink etc .. .is there a "keep LED ON API"?

0 Likes

You can use one of the GPIO API to always drive the GPIO that is connected to the LED instead of using the bleprofile API.

0 Likes
Anonymous
Not applicable

Is there a simple example of this or a document to reference?

I am using bleprofile_LEDOn and bleprofile_LEDBlink ... seems like the LEDOn function just blinks once

I would have thought that would keep on the LED on

0 Likes
Anonymous
Not applicable

Hello

What I did to get it to work with the bleprofile LED functions was the following … but I am looking to find a way to keep the LED turned on.

How do I go about doing this? It is unclear.

1.

#include "platform.h" // LED

2.

Changed in BLE_PROFILE_CFG

/.status_led_enable =/ 1, // if 1 status LED is enable

3. Added PIN 28 as GPIO_SETTINGS_LED

BLE_PROFILE_GPIO_CFG glucose_monitor_gpio_config =

{

/.gpio_pin =/

{

1, 0, 3, 4, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1

},

/.gpio_flag =/

{

GPIO_OUTPUT | GPIO_INIT_LOW | GPIO_WP,

GPIO_INPUT | GPIO_INIT_LOW | GPIO_BUTTON1 | GPIO_INT,

GPIO_INPUT | GPIO_INIT_HIGH | GPIO_BUTTON2 | GPIO_INT,

GPIO_INPUT | GPIO_INIT_HIGH | GPIO_BUTTON3 | GPIO_INT,

GPIO_SETTINGS_LED,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0

//0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

},

};

4. In the timer … added some code to turn ON LED every seconds as a KEEP ALIVE type of blink. BUT what I want it to do is just stay illuminated when powered up for DEBUG purposes so I know chip is ON. But it just blinks …

if( (blebgm_apptimer_count % 5) == 0)

{

ble_traceprintf("*** BT ALIVE! *** \r\n");

bleprofile_LEDOn();

}

0 Likes

Assuming your LED is connected to P26 and is active low:

1. Don't set up P26 in your BLE_PROFILE_GPIO_CFG structure.

2. Drive P26 low when you want to turn it on.

#include "gpiodriver.h"

void application_create(void)

{

     // all other application initialization

     // Drive P26 low. If the LED is hooked up right, it will turn on

     gpio_configurePin(26/16, 26%16, GPIO_OUTPUT_ENABLE, 0);

}

0 Likes
Anonymous
Not applicable

Should the led_enable on the field in BLE_PROFILE_CFG also be set to “0” or “1” ?

0 Likes

Set it to 0. You are basically controlling the LED yourself instead of letting the SDK do it for you.

0 Likes
Anonymous
Not applicable

So this does not work for me.

When I tried using the other mechanism where I setup GPIO 28 using the BLE_PROFILE_GPIO_CFG I do see the LED light up so I know that it is connected correctly.

The document has pin 39 and GPIO 28 for the LED. Is there some other special setting for the LED on this GPIO that I need to do with this function?

0 Likes
Anonymous
Not applicable

So this does not work for me.

When I tried using the other mechanism where I setup GPIO 28 using the BLE_PROFILE_GPIO_CFG I do see the LED light up so I know that it is connected correctly.

The document has pin 39 and GPIO 28 for the LED. Is there some other special setting for the LED on this GPIO that I need to do with this function?

0 Likes

No, nothing special needs to be done for this LED to function. There was a typo in my message earlier that I corrected to gpio_configurePin(26/16, 26%16, GPIO_OUTPUT_ENABLE, 0); Since your LED is connected to P28, use 28 instead of 26.

Anonymous
Not applicable

This works with the divide by 16 etc ... thanks!

This can be closed out.

0 Likes