diff --git a/examples/system/app_trace_to_host/README.md b/examples/system/app_trace_to_host/README.md index 6ea19b0475..b540cd4a90 100644 --- a/examples/system/app_trace_to_host/README.md +++ b/examples/system/app_trace_to_host/README.md @@ -1,6 +1,3 @@ -| Supported Targets | ESP32 | -| ----------------- | ----- | - # Application Level Tracing Example (Logging to Host) (See the README.md file in the upper level 'examples' directory for more information about examples.) @@ -30,11 +27,13 @@ This example will assume that that an ESP-WROVER-KIT is used. #### Pin Assignment: -The sinusoidal signal of 50 to 60 Hz ranging from 0 V ~ 3.1 V should be input into `GPIO34` (`ADC1_CHANNEL_6`). Users may provide this signal themselves, our use the DAC generated signal by bridging GPIO34 with `GPIO25` (`DAC_CHANNEL_1`). +The sinusoidal signal of 50 to 60 Hz ranging from 0 V ~ 3.1 V should be input into `ADC1_CHANNEL_6`. Users may provide this signal themselves, or use the example-generated signal in `DAC_CHANNEL_1`. Listed below are the corresponding DAC/ADC channel pins +for supported targets. -| DAC Output | ADC Input | -| ------------------ | ------------------ | -| Channel 1 (GPIO25) | Channel 6 (GPIO34) | +| Target | DAC Output | ADC Input | +| ------------------ | ------------------ | ------------------ | +| ESP32 | Channel 1 (GPIO25) | Channel 6 (GPIO34) | +| ESP32S2 | Channel 1 (GPIO17) | Channel 6 (GPIO7) | #### Extra Connections: diff --git a/examples/system/app_trace_to_host/main/app_trace_to_host_example_main.c b/examples/system/app_trace_to_host/main/app_trace_to_host_example_main.c index 36ac767e9e..074df95142 100644 --- a/examples/system/app_trace_to_host/main/app_trace_to_host_example_main.c +++ b/examples/system/app_trace_to_host/main/app_trace_to_host_example_main.c @@ -16,8 +16,11 @@ #include "soc/sens_periph.h" #include "driver/adc.h" #include "driver/dac.h" +#include "soc/adc_channel.h" +#include "soc/dac_channel.h" #define ADC1_TEST_CHANNEL (ADC1_CHANNEL_6) + #define TEST_SAMPLING_PERIOD 20 /* @@ -41,7 +44,7 @@ static const char *TAG = "example"; /* * Enable cosine waveform generator (CW) - * on channel 1 / GPIO25 to provide sinusoidal signal + * on DAC channel 1 to provide sinusoidal signal * It can be used instead of a live signal for testing * of speed of logging to the host * sequentially with data retrieval from ADC @@ -65,7 +68,7 @@ static void enable_cosine_generator(void) } /* - * Sample data an ADC1 channel 6 / GPIO34 + * Sample data an ADC1 channel 6 * over specific 'sampling_period' in milliseconds. * Print out sampling result using standard ESP_LOGI() function. * Return the number of samples collected. @@ -87,7 +90,7 @@ static int adc1_sample_and_show(int sampling_period) */ void app_main(void) { - ESP_LOGI(TAG, "Enabling ADC1 on channel 6 / GPIO34."); + ESP_LOGI(TAG, "Enabling ADC1 on channel 6 / GPIO%d.", ADC1_CHANNEL_6_GPIO_NUM); #if CONFIG_IDF_TARGET_ESP32 adc1_config_width(ADC_WIDTH_BIT_12); #elif CONFIG_IDF_TARGET_ESP32S2 @@ -95,7 +98,7 @@ void app_main(void) #endif adc1_config_channel_atten(ADC1_TEST_CHANNEL, ADC_ATTEN_DB_11); - ESP_LOGI(TAG, "Enabling CW generator on DAC channel 1 / GPIO25."); + ESP_LOGI(TAG, "Enabling CW generator on DAC channel 1 / GPIO%d.", DAC_CHANNEL_1_GPIO_NUM); enable_cosine_generator(); while (1) {