Page 1 of 1

Reading Hall Sensor Values from ULP

Posted: Thu Feb 08, 2018 1:48 pm
by sslama
Hi,

I'm trying to get the current measurments from the hall sensor in ULP Mode.

When I'm reading them from a context outside the deep sleep mode like this:

Code: Select all

adc1_config_width(ADC_WIDTH_12Bit);
hall_sensor_read();
I get values that change when a magnet is getting closer.

When I try to read those values from ULP I just get random values. I followed the ulp_adc example from espressif changed the channel to ADC1_CHANNEL_0 - also tried Channel 3 - as the documentation says the hall sensor is connected to both.

Code: Select all

adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_DB_0);
adc1_config_width(ADC_WIDTH_BIT_12);
adc1_ulp_enable();
I also changed the adc_channel constant in the adc.S file.

Is it even possible to read the values from the hall sensor in deep sleep mode?

Thanks

Re: Reading Hall Sensor Values from ULP

Posted: Thu Feb 08, 2018 5:52 pm
by WiFive
https://github.com/espressif/esp-idf/bl ... 1627-L1664

You have to write some other registers and it's not that useful without LNA

Re: Reading Hall Sensor Values from ULP

Posted: Thu Feb 08, 2018 6:20 pm
by sslama
So I understand, that the function

Code: Select all

hall_sensor_read();
does a lot more than I tried to do in the code I posted.

The thing is - when I call the hall_sensor_read() function from the ULP context it returns the same value as the one I get calling the functions from my seconds code snippet.

What do you mean by "it is not that usefull without an LNA"- sorry - I'm quite new here and in electronics... :)

thanks