Page 1 of 2

quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Sun Dec 20, 2015 2:23 pm
by rudi ;-)
Hi guys

very early and very quick and simple short test with the ADC1.

Work right away very well. Attempts were about Eclipse and the VM Lubuntu with Config & Makefile for the Xtensa esp108-elf.
Terminal was the minicom.

( Click to the picture for the Video )

ESP32 Eclipse Linux.JPG
ESP32 Eclipse Linux.JPG (55.08 KiB) Viewed 16605 times
[/url]


Tested were ADC1_CH0 ..ADC1_CH7
Some pads are not taken out.
(C11, C12 ..)

The Potimeter were GPIO34..GPIO36
Reference voltage, the voltage source,
in this case it was the USB stick TTL.
This has been sufficient for the supply of beta ESP32 and Poti.

Wifi was not turned on. The measurement runs in a continuous loop.

There are in addition to the year 2014 write error errors along with some path errors in my config and Makefile; i do build all two times, there is a path setting wrong, "rm" will not found, i set the .bashrc and the desktop.mak..and change between /bin/sh and /bin/bash so i must order this first time better;
once the matter goes through clean, I'll put it here online.

It will be in the new year, because of Christmas. But the firmware do I uploaded (the thread will be updated with the link)

( right mouse click and save it )
at 0x0 upload this boot.bin
at 0x04000 upload this irom1.bin
at 0x40000 upload this irom0_flash.bin

for 1MB Flash
at 0xFE000 upload this blank.bin

for 2 MB Flash upload the blank.bin to 0xFC000

Here even those who can not taste itself, it can look at who wants to:
On Youtube: https://youtu.be/hVLhqiNS3vU

best wishes
rudi ;-)

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Wed Nov 09, 2016 9:29 am
by LubomirBogdanov
Hello, Rudi!
Can you please share which SDK (on git) did you use to make this example working?

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Wed Nov 09, 2016 6:33 pm
by rudi ;-)
LubomirBogdanov wrote:Hello, Rudi!
Can you please share which SDK (on git) did you use to make this example working?
Hi

this was for ESP31 ( esp32 beta SoC )

and i used this :
https://github.com/espressif/ESP31_RTOS_SDK

hope this helps

best wishes
rudi ;-)

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Thu Nov 10, 2016 10:36 am
by LubomirBogdanov
Thanks! This is very important information to me.

One more question - how do you flash the target? Do you type simply:

make flash_all

Because I tried that and it didn't work. I was setting the correct baud rate with make flash_all ESP_BAUD=... but still didn't work.

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Thu Nov 10, 2016 1:41 pm
by WiFive
LubomirBogdanov wrote:Thanks! This is very important information to me.

One more question - how do you flash the target? Do you type simply:

make flash_all

Because I tried that and it didn't work. I was setting the correct baud rate with make flash_all ESP_BAUD=... but still didn't work.
I think you are missing the fact this is for ESP31 chip only, not ESP32. For ESP32, you have to wait for ADC functions to be added to esp-idf. It should be soon, as pycom already has ADC functions in their firmware so they must have a preview release.

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Fri Nov 11, 2016 8:50 am
by LubomirBogdanov
Ohhhh, OK, now I get it - I have an ESP32 (clearly labeled on the chip) and not ESP31 :-) I thought they might be compatible somehow ...

Anyways, thank you for your help!

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Fri Nov 11, 2016 3:04 pm
by rudi ;-)
WiFive wrote: ..
It should be soon, as pycom already has ADC functions in their firmware so they must have a preview release.
think all other have more infos - only we have it not :

.. do you know the opensrc repo from pycom too or is this closed for "NotPyComUsers"

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Fri Nov 11, 2016 6:50 pm
by rudi ;-)
rudi ;-) wrote:
WiFive wrote: ..
It should be soon, as pycom already has ADC functions in their firmware so they must have a preview release.
think all other have more infos - only we have it not :

.. do you know the opensrc repo from pycom too or is this closed for "NotPyComUsers"

.. We WILL be releasing the source code..

1. Open Source: We WILL be releasing the source code for all our modules under a GPL V3 Licence. We expect to do so no later than 11th November.

...



...


WOW:

Espressif are busy rectifying many of the issues we highlighted and will send us (7th November) a beta version of the IDF with Bluetooth and WiFi coexistency together with a complete Bluetooth Low energy API. This will allow us to deliver on the 11th of November a new software version with BLE support and a Python API to allow the creation of custom profiles and services. Scanning for the presence of nearby BLE devices will also be possible. On the 30th of November we will receive the first official non-beta release of the ESP32 IDF. Bluetooth and WiFi coexistency will be optimized here and most of the peripheral drivers along with the ULP co-processor features will be included..
Ah - nice - in few hour we have it ? hope for the 'HAL' files to fish ADC and more from them.
hope ..Keep firm to their promise.

perhabs they use library's :lol:

:?

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Fri Nov 11, 2016 7:24 pm
by rosimildo
Software releases, nearly 100% has small delays, let's hope it does not happen, but I will be glad to see all that by Nov 30th!

Re: quick ADC1 Test under Eclipse & VM Lubuntu

Posted: Tue Nov 15, 2016 12:00 am
by rudi ;-)
rosimildo wrote:Software releases, nearly 100% has small delays, let's hope it does not happen, but I will be glad to see all that by Nov 30th!

...just in time of this posting: 18 minutes young...
They promised - and they did it
more about
and read the note about the modified Espressif IDF -> "note"

modified ESP-IDF is here

..and the libs :)

missed (just not found - fast searched ) the adc just in time - but you are right, allways small delays and is ok.
edit: ( found )

Code: Select all


int analog_adc1_read(adc_channel_t channel, adc_atten_t atten)
{
    if(channel >= ADC1_CH_MAX) {
        ANALOG_ERROR("ADC CHANNEL ERROR\n");
        return -1;
    }
    if(atten >= ADC_ATTEN_MAX) {
        ANALOG_ERROR("ADC ATTENUATION ERROR\n");
        return -1;
    }
    portENTER_CRITICAL(&analog_mux);
    uint16_t adc_value = adc1_read(channel, atten);
    portEXIT_CRITICAL(&analog_mux);
    return adc_value;
}
analog.c ->
analog.h ->


Thank you Espressif!

ah.. nice found:

Code: Select all


uint8_t analog_temperature_read(void)
{
    portENTER_CRITICAL(&analog_mux);
    uint8_t temp_val = temprature_sens_read();
    portEXIT_CRITICAL(&analog_mux);
    return temp_val;
}

good work guys
and well done Fred!

@WiFive
where are you?
"found" done :)
"testings" next days - we have 01:44 AM here :mrgreen:

best wishes
rudi ;-)