0

Feather M0 WINC1500 led
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Feather M0 WINC1500 led

by tpylkko on Sat Sep 07, 2019 4:52 pm

There appears to be a green connection LED on the atwinc module which lights up when it reaches the AP. I wonder if there is a way to turn it off?

tpylkko
 
Posts: 11
Joined: Mon May 15, 2017 2:12 pm

Re: Feather M0 WINC1500 led

by mikeysklar on Sat Sep 07, 2019 8:45 pm

Hi tpylkko,

There is not direct control for disabling the WINC1500 LEDs, but there are some different power mode settings. One or all of these will put the chip into sleep mode when inactive which should disable the green link LED.

https://learn.adafruit.com/adafruit-fea ... management

WiFi.setSleepMode(M2M_PS_H_AUTOMATIC, 1); // go into power save mode when possible!

WiFi.lowPowerMode();

WiFi.setSleepMode(M2M_PS_MANUAL, 1);

WiFi.requestSleep(sleeptimeinmilliseconds)

mikeysklar
 
Posts: 111
Joined: Mon Aug 01, 2016 8:10 pm

Re: Feather M0 WINC1500 led

by tpylkko on Sun Sep 08, 2019 9:29 am

Are you sure? The ATWINC documents seem to indicate that it could be possible. I notice that in WiFi101.cpp the authors use commands like

Code: Select all | TOGGLE FULL SIZE
m2m_periph_gpio_set_val(M2M_PERIPH_GPIO16, 1);


also, those sleep mode macros that you post don't seem to put the led off. I was wondering if the device should be deinitialized to really put it down. But that might mean that upon wake up the entire connection needs to be rebuilt from scratch.

tpylkko
 
Posts: 11
Joined: Mon May 15, 2017 2:12 pm

Re: Feather M0 WINC1500 led

by mikeysklar on Sun Sep 08, 2019 3:24 pm

The gpio values you found look like the ticket. Looking at the schematic for the ATWINC1500 the green LED is on GPIO15.

https://cdn-learn.adafruit.com/assets/a ... 1466018880

I would expect the following code to turn off the Green LED.

Code: Select all | TOGGLE FULL SIZE
m2m_periph_gpio_set_val(M2M_PERIPH_GPIO15, 0);


Please let me know if this worked for you.

mikeysklar
 
Posts: 111
Joined: Mon Aug 01, 2016 8:10 pm

Re: Feather M0 WINC1500 led

by tpylkko on Wed Sep 11, 2019 4:17 am

So, how do you go about calling that function from the driver, when it is not exposed?
Or is it better to just write your own driver?

tpylkko
 
Posts: 11
Joined: Mon May 15, 2017 2:12 pm

Re: Feather M0 WINC1500 led

by mikeysklar on Wed Sep 11, 2019 7:02 pm

I would make a copy of the original WiFi.cpp from ~/Documents/Arduino/libraries/WiFi101/src/WiFi.cpp

Then try modifying the existing WiFi.cpp in particular these two lines to have a value of '1' as it looks like it is using reverse logic for turning the LED on based on the comments.

Code: Select all | TOGGLE FULL SIZE
WiFi.cpp:559:   m2m_periph_gpio_set_val(M2M_PERIPH_GPIO15, 0);
WiFi.cpp:625:   m2m_periph_gpio_set_val(M2M_PERIPH_GPIO15, 0);

mikeysklar
 
Posts: 111
Joined: Mon Aug 01, 2016 8:10 pm

Re: Feather M0 WINC1500 led

by tpylkko on Sat Sep 14, 2019 2:34 am

it is also possible to include and call the functions directly in the sketch using

Code: Select all | TOGGLE FULL SIZE
#include "WiFi101.h"
#include "driver/include/m2m_periph.h"

tpylkko
 
Posts: 11
Joined: Mon May 15, 2017 2:12 pm

Re: Feather M0 WINC1500 led

by mikeysklar on Sat Sep 14, 2019 5:10 pm

Awesome, did including the library and calling directly work for turning off the green LED?

mikeysklar
 
Posts: 111
Joined: Mon Aug 01, 2016 8:10 pm

Re: Feather M0 WINC1500 led

by tpylkko on Sun Sep 15, 2019 8:40 am

Yes it did, however the correct pin was pin 4 and the correct bit value is 1, not 0.

therefore

Code: Select all | TOGGLE FULL SIZE
 m2m_periph_gpio_set_val(M2M_PERIPH_GPIO4, 1)


did it for me. The source code says that "rev b" atwinc uses gpio 4. Also they say there that "turn led off" in the comments when they set value to 1.

The led is nice for debugging, but if you are running off batteries and the led is under a case you cannot even see, it seems a bit purposeless.

tpylkko
 
Posts: 11
Joined: Mon May 15, 2017 2:12 pm

Re: Feather M0 WINC1500 led

by mikeysklar on Sun Sep 15, 2019 1:20 pm

Nicely done. Good point about valuable debugging with the LED.

mikeysklar
 
Posts: 111
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.