Reading Hall Sensor Values from ULP

sslama
Posts: 5
Joined: Tue Feb 06, 2018 10:28 am

Reading Hall Sensor Values from ULP

Postby sslama » Thu Feb 08, 2018 1:48 pm

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

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Reading Hall Sensor Values from ULP

Postby WiFive » Thu Feb 08, 2018 5:52 pm

https://github.com/espressif/esp-idf/bl ... 1627-L1664

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

sslama
Posts: 5
Joined: Tue Feb 06, 2018 10:28 am

Re: Reading Hall Sensor Values from ULP

Postby sslama » Thu Feb 08, 2018 6:20 pm

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

Who is online

Users browsing this forum: Bing [Bot] and 73 guests