HiFive1 Arduino Board With ESP-01 WiFi Module Tutorial

The HiFive1 is the first Arduino-compatible RISC-V based board built with FE310 CPU from SiFive. The board is about 20 times faster than Arduino UNO yet like the UNO board, it lacks any wireless connectivity.

Fortunately, there are several inexpensive modules on the market to mitigate this limitation. This tutorial explains how to enable WiFi connectivity for the HiFive1 using an ESP-01.

For HiFive1 with ESP32 or ESP8266 modules see the WEB and MQTT tutorials.

For Hifive1 Bluetooth example, see this tutorial.

Materials needed for this project:

  • HiFive1 (Can be purchased here)
  • ESP-01
  • 2 * 10k resistors
  • 1k resistor
  • Breadboard
  • 9 jumper cables

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Setup the Environment

  1. Install the Arduino IDE if it is not installed on your computer.
  2. Follow the instructions in https://github.com/westerndigitalcorporation/CincoWinPkg to add HiFive1 support to Arduino IDE.

No need to install the ESP-01 board package in Arduino IDE since the ESP-01 comes preprogrammed with outdated (see the screenshot) but capable to respond to AT commands via a serial connection firmware.

Step 2: Connect ESP-01 Module to HiFive1 Board

Connect the ESP-01 module to the HiFive1 board as shown in the Fritzing Schematics and Breadboard views.

Make sure that IOREF jumper is set to 3.3V as shown in the picture by the red circle.

Step 3: Talking to ESP-01 Module Via Serial Monitor

After connecting everything together we can try to talk to the ESP-01 via Arduino Serial Monitor. For this, we need to program a simple sketch attached below. It's listening to the AT commands coming from the Monitor via HW Serial channel and forwards them to the ESP-01 via SoftwareSerial32 channel. It is listening to the ESP-01 replies from SoftwareSerial32 channel and is forwarding them to the Monitor via HW Serial channel.

  1. Before programming make sure that the "Tools->Board" is set to HiFive1 board, the "Tools->CPU Clock Frequency" to "256MHz PLL" and the "Tools->Programmer" to "SiFive OpenOCD".
  2. Upload the sketch into HiFive1.
  3. Make sure you selected correct Serial port in "Tools->Port".
  4. Open "Tools->Serial Monitor" and select 115200 baud rate and "Both NL & CR".
  5. Type AT in the Monitor. You should get OK from the ESP-01.
  6. Now you can try various AT commands from this link.

Step 4: Talk to ESP Module From Sketch

Now let's issue the AT commands to ESP-01 from within the HiFive1 sketch.

The attached sketch is continuously running the CWLAP+AT command which returns the available WiFi Access Points, their signal strength and their MAC Addresses. The loop is printing the results until either the ESP-01 returns OK as AT command terminator or a certain amount of time has passed since the last character was printed (The default is 2 seconds).

  1. Make sure that the "Tools->Board" is set to HiFive1 board, the "Tools->CPU Clock Frequency" to "256MHz PLL" and the "Tools->Programmer" to "SiFive OpenOCD".
  2. Upload the sketch into HiFive1.
  3. Make sure you selected correct Serial port in "Tools->Port".
  4. Open "Tools->Serial Monitor" and select 115200 baud rate and "Both NL & CR".

The CWLAP+AT command can be changed in the sketch to any AT Command. More commands can be found here.

Step 5: Final Result

If you correctly wired the circuit and uploaded the provided sketch you should get a printed list of the available Access Points in your area such as the one in the attached picture.

Share

    Recommendations

    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    6 Discussions

    0
    None
    danielk457RiscVGeek

    Reply 7 months ago

    I have esp8266 Nodemcu,dont have esp-01. How can i connect with hifive1?
    But here in nodemcu i couldn't find CH_PD pin.What is the solution? when i flashed Hifive1_ESP_01_ATC code ,without CH_PD connection it gives me "Timeout" only.

    0
    None
    danielk457RiscVGeek

    Reply 6 months ago

    Thank you for your instant help.I ll go through it.