From cb8ab7c6a8c4909f66cd267355f441e2dcf58de0 Mon Sep 17 00:00:00 2001 From: hou wen xiang Date: Wed, 27 Jun 2018 19:27:56 +0800 Subject: [PATCH 1/3] driver(rmt): update README.md file of rmt related example. --- examples/peripherals/rmt_nec_tx_rx/README.md | 79 +++++++++++++++++++- examples/peripherals/rmt_tx/README.md | 51 +++++++++++-- 2 files changed, 122 insertions(+), 8 deletions(-) diff --git a/examples/peripherals/rmt_nec_tx_rx/README.md b/examples/peripherals/rmt_nec_tx_rx/README.md index f38116e2a8..fd3c16a785 100644 --- a/examples/peripherals/rmt_nec_tx_rx/README.md +++ b/examples/peripherals/rmt_nec_tx_rx/README.md @@ -2,7 +2,82 @@ This example uses the remote control (RMT) peripheral to transmit and receive codes for the NEC infrared remote protocol. -Configuration (pin numbers, etc.) can be modified in top of the main/infrared_nec_main.c file. +# _RMT NEC_TX_RX Example_ -By default, this example runs a self test which assumes the TX and RX GPIO pins are connected together. To disable this, comment RMT_RX_SELF_TEST in infrared_nec_main.c. +(See the README.md file in the upper level 'examples' directory for more information about examples.) +This example uses the remote control (RMT) peripheral to transmit and receive codes for the NEC infrared remote protocol. + +## How to Use Example + +### Hardware Required + +To run this example, you need to prepare a development board with esp32 SoC(e.g., ESP32_Core_board, ESP-WORVER_KIT etc) and a USB cable for power supply and programming. + +By default, this example runs a self test which assumes the TX pin (GPIO18) and RX pin (GPIO19) are _connected together_. + +To disable self-test mode, comment out RMT_RX_SELF_TEST in infrared_nec_main.c, after which, you need to connect a IR transmitter and a receiver to GPIO18 and GPIO19. + +The TX pin and RX pin can be modified in top of the main/infrared_nec_main.c file. + +``` +#define RMT_TX_GPIO_NUM 18 /*!< GPIO number for transmitter signal */ +#define RMT_RX_GPIO_NUM 19 /*!< GPIO number for receiver */ +``` + +### Configure the Project + +``` +make menuconfig +``` + +* Set serial port under Serial Flasher Options. + +### Build and Flash + +Build the project and flash it to the board, then run monitor tool to view serial output: + +``` +make -j4 flash monitor +``` + +(To exit the serial monitor, type ``Ctrl-]``.) + +See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects. + +## Example Output + +Run this example, you will see the following output log: +``` +NEC: RMT TX DATA +NEC: RMT RCV --- addr: 0xee11 cmd: 0xff00 +NEC: RMT RCV --- addr: 0xed12 cmd: 0xfe01 +NEC: RMT RCV --- addr: 0xec13 cmd: 0xfd02 +NEC: RMT RCV --- addr: 0xeb14 cmd: 0xfc03 +NEC: RMT RCV --- addr: 0xea15 cmd: 0xfb04 +NEC: RMT RCV --- addr: 0xe916 cmd: 0xfa05 +NEC: RMT RCV --- addr: 0xe817 cmd: 0xf906 +NEC: RMT RCV --- addr: 0xe718 cmd: 0xf807 +NEC: RMT RCV --- addr: 0xe619 cmd: 0xf708 +NEC: RMT RCV --- addr: 0xe51a cmd: 0xf609 +NEC: RMT RCV --- addr: 0xe41b cmd: 0xf50a +NEC: RMT RCV --- addr: 0xe31c cmd: 0xf40b +NEC: RMT RCV --- addr: 0xe21d cmd: 0xf30c +NEC: RMT RCV --- addr: 0xe11e cmd: 0xf20d +NEC: RMT RCV --- addr: 0xe01f cmd: 0xf10e +NEC: RMT RCV --- addr: 0xdf20 cmd: 0xf00f +NEC: RMT RCV --- addr: 0xde21 cmd: 0xef10 +NEC: RMT RCV --- addr: 0xdd22 cmd: 0xee11 +NEC: RMT RCV --- addr: 0xdc23 cmd: 0xed12 +NEC: RMT RCV --- addr: 0xdb24 cmd: 0xec13 +NEC: RMT RCV --- addr: 0xda25 cmd: 0xeb14 +``` + +## Troubleshooting + +* Programming fail + + * To check whether the hardware connection of UART is correct, you can run `make monitor` and reboot your board to see if there are any output logs. + * Your download baud-rate is too high. please lower your download baud-rate in menuconfig and try again. + +If any problems that can't be resolved, please open an issue in GitHub(https://github.com/espressif/esp-idf/issues), we will reply to you soon. \ No newline at end of file diff --git a/examples/peripherals/rmt_tx/README.md b/examples/peripherals/rmt_tx/README.md index 5e63859845..e1eebf2036 100644 --- a/examples/peripherals/rmt_tx/README.md +++ b/examples/peripherals/rmt_tx/README.md @@ -1,12 +1,39 @@ -# RMT Transmit Example +# _RMT Transmit Example_ -This example shows how to configure and operate the remote control (RMT) peripheral to transmit a sample message in the [Morse code](https://en.wikipedia.org/wiki/Morse_code). +(See the README.md file in the upper level 'examples' directory for more information about examples.) -Configuration (pin number, etc.) can be modified in the top of the `main/rmt_tx_main.c` file. +This example will shows how to configure and operate the remote control (RMT) peripheral to transmit a sample message in the [Morse code](https://en.wikipedia.org/wiki/Morse_code), it also shows how to transmit custom format of data. -To be able to see and hear the message output by the RMT, connect a LED and a speaker or an earphone (be careful - it may be loud) to the GPIO configured under `RMT_TX_GPIO` define (default is GPIO 18). +## How to Use Example + +### Hardware Required + +To run this example, you need to prepare a development board with esp32 SoC(e.g., ESP32_Core_board, ESP-WORVER_KIT etc), a LED, a speaker or an earphone and a USB cable for power supply and programming. + +### Configure the Project + +``` +make menuconfig +``` + +* Set serial port under Serial Flasher Options. + +### Build and Flash + +Build the project and flash it to the board, then run monitor tool to view serial output: + +``` +make -j4 flash monitor +``` + +(To exit the serial monitor, type ``Ctrl-]``.) + +See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects. + +## Example Output + +To be able to see and hear the message output by the RMT, connect a LED and a speaker or an earphone (be careful - it may be loud) to the GPIO18(the pin can be changed by modify the definition of `RMT_TX_GPIO` in `main/rmt_tx_main.c`). -Example connections: ``` 330R LED @@ -21,5 +48,17 @@ GPIO18 +----/\/\/\----+------|>|-----+ GND +--------------+ GND ``` +Run this example, you will see the following output log: +``` +RMT Tx: Transmission complete +RMT Tx: Sample transmission complete +``` -See the README.md file in the upper level 'examples' directory for more information about examples. +## Troubleshooting + +* Programming fail + + * To check whether the hardware connection is correct, you can run `make monitor` and reboot your board to see if there are any output logs. + * Your download baud-rate is too high. please lower your download baud-rate in menuconfig and try again. + +If any problems that can't be resolved, please open an issue in GitHub(https://github.com/espressif/esp-idf/issues), we will reply to you soon. \ No newline at end of file From fe238af249d91d01bcf61c48c8aa4f2fd876daa0 Mon Sep 17 00:00:00 2001 From: Hou Wen Xiang Date: Sun, 15 Jul 2018 12:52:55 +0800 Subject: [PATCH 2/3] Update README.md --- examples/peripherals/rmt_nec_tx_rx/README.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/peripherals/rmt_nec_tx_rx/README.md b/examples/peripherals/rmt_nec_tx_rx/README.md index fd3c16a785..bdaa8253f3 100644 --- a/examples/peripherals/rmt_nec_tx_rx/README.md +++ b/examples/peripherals/rmt_nec_tx_rx/README.md @@ -1,8 +1,4 @@ -# Example: rmt_nec_tx_rx - -This example uses the remote control (RMT) peripheral to transmit and receive codes for the NEC infrared remote protocol. - -# _RMT NEC_TX_RX Example_ +# _RMT NEC_TX_RX Example_ (See the README.md file in the upper level 'examples' directory for more information about examples.) @@ -12,7 +8,8 @@ This example uses the remote control (RMT) peripheral to transmit and receive co ### Hardware Required -To run this example, you need to prepare a development board with esp32 SoC(e.g., ESP32_Core_board, ESP-WORVER_KIT etc) and a USB cable for power supply and programming. +* A development board with ESP32 SoC (e.g., ESP32-DevKitC, ESP-WORVER-KIT, etc.) +* A USB cable for Power supply and programming By default, this example runs a self test which assumes the TX pin (GPIO18) and RX pin (GPIO19) are _connected together_. @@ -77,7 +74,7 @@ NEC: RMT RCV --- addr: 0xda25 cmd: 0xeb14 * Programming fail - * To check whether the hardware connection of UART is correct, you can run `make monitor` and reboot your board to see if there are any output logs. - * Your download baud-rate is too high. please lower your download baud-rate in menuconfig and try again. + * Hardware connection is not correct: run `make monitor`, and reboot your board to see if there is any output logs. + * The baud rate for downloading is too high: lower your baud rate in the `menuconfig` menu, and try again. -If any problems that can't be resolved, please open an issue in GitHub(https://github.com/espressif/esp-idf/issues), we will reply to you soon. \ No newline at end of file +For any technical queries, please open an [issue] (https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon. \ No newline at end of file From 733f73067c87c463bd13b4d65c4ed2bf20b1bca8 Mon Sep 17 00:00:00 2001 From: Hou Wen Xiang Date: Sun, 15 Jul 2018 12:56:23 +0800 Subject: [PATCH 3/3] Update README.md --- examples/peripherals/rmt_tx/README.md | 41 ++++++++++++++------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/examples/peripherals/rmt_tx/README.md b/examples/peripherals/rmt_tx/README.md index e1eebf2036..9749381f04 100644 --- a/examples/peripherals/rmt_tx/README.md +++ b/examples/peripherals/rmt_tx/README.md @@ -1,4 +1,4 @@ -# _RMT Transmit Example_ +# _RMT Transmit Example_ (See the README.md file in the upper level 'examples' directory for more information about examples.) @@ -8,7 +8,24 @@ This example will shows how to configure and operate the remote control (RMT) pe ### Hardware Required -To run this example, you need to prepare a development board with esp32 SoC(e.g., ESP32_Core_board, ESP-WORVER_KIT etc), a LED, a speaker or an earphone and a USB cable for power supply and programming. +* A development board with ESP32 SoC (e.g., ESP32-DevKitC, ESP-WORVER-KIT, etc.) +* A USB cable for Power supply and programming +* A LED, a speaker or an earphone + +Connection : + +``` + 330R LED +GPIO18 +----/\/\/\----+------|>|-----+ GND + | + | /| + +-+ | Speaker + | | | or + +-+ | earphone + | \| + | + +--------------+ GND +``` ### Configure the Project @@ -34,20 +51,6 @@ See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/l To be able to see and hear the message output by the RMT, connect a LED and a speaker or an earphone (be careful - it may be loud) to the GPIO18(the pin can be changed by modify the definition of `RMT_TX_GPIO` in `main/rmt_tx_main.c`). - -``` - 330R LED -GPIO18 +----/\/\/\----+------|>|-----+ GND - | - | /| - +-+ | Speaker - | | | or - +-+ | earphone - | \| - | - +--------------+ GND -``` - Run this example, you will see the following output log: ``` RMT Tx: Transmission complete @@ -58,7 +61,7 @@ RMT Tx: Sample transmission complete * Programming fail - * To check whether the hardware connection is correct, you can run `make monitor` and reboot your board to see if there are any output logs. - * Your download baud-rate is too high. please lower your download baud-rate in menuconfig and try again. + * Hardware connection is not correct: run `make monitor`, and reboot your board to see if there is any output logs. + * The baud rate for downloading is too high: lower your baud rate in the `menuconfig` menu, and try again. -If any problems that can't be resolved, please open an issue in GitHub(https://github.com/espressif/esp-idf/issues), we will reply to you soon. \ No newline at end of file +For any technical queries, please open an [issue] (https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon. \ No newline at end of file