ESP32-C3 needs external flash chip?
-
- Posts: 15
- Joined: Wed Feb 01, 2023 3:25 am
Re: ESP32-C3 needs external flash chip?
After long awaiting for chips to arrive finally the chips got here two days ago and I managed to replace the MCU on my custom built board. Now my board has ESP32-C3 FH4.
The board is now accepting the code, but now I found another problem that my PCB fabricator (inspite of giving the correct part number) has put a 32MHz crystal instead of 40MHz.
So is ESP32-C3 FH4 capable of working on 32MHz? I didn't find the option for 32MHz in Arduino IDE (which I'm using for programming). But just in case...
Secondly, which board I need to use to reference the pinouts on my custom board? Like if I make a custom board based on ATmega 328 I will use Arduino UNO for pinout reference. Likewise, which board will be my reference when I select board as ESP32-C3 Dev Module.
I ask this because, when I google for ESP32-C3 Dev Module I can see lot of different boards there and I'm confused as to which one would be right for referencing.
Following is the settings I have adapted in Arduino IDE:
1. Board: ESP32-C3 Dev Module
2.Upload speed: 115200
3. CPU Freq: 40MHz
4. Flash Freq: 40MHz
5. Flash Size: 4MB
Thanks
The board is now accepting the code, but now I found another problem that my PCB fabricator (inspite of giving the correct part number) has put a 32MHz crystal instead of 40MHz.
So is ESP32-C3 FH4 capable of working on 32MHz? I didn't find the option for 32MHz in Arduino IDE (which I'm using for programming). But just in case...
Secondly, which board I need to use to reference the pinouts on my custom board? Like if I make a custom board based on ATmega 328 I will use Arduino UNO for pinout reference. Likewise, which board will be my reference when I select board as ESP32-C3 Dev Module.
I ask this because, when I google for ESP32-C3 Dev Module I can see lot of different boards there and I'm confused as to which one would be right for referencing.
Following is the settings I have adapted in Arduino IDE:
1. Board: ESP32-C3 Dev Module
2.Upload speed: 115200
3. CPU Freq: 40MHz
4. Flash Freq: 40MHz
5. Flash Size: 4MB
Thanks
-
- Posts: 15
- Joined: Wed Feb 01, 2023 3:25 am
Re: ESP32-C3 needs external flash chip?
The major blk of the schematics i.e related to MCU has been picked from makermoe's schematics which is proven to be running really good. The PCBs are already ready and I suppose the changes you suggested although important and necessary and crucial, I'm afraid I may not add them now. So far my initial problem is solved. Fortunately after changing the ESP chip the board is finally accepting the codeESP_LJH wrote: ↑Thu Feb 23, 2023 6:30 amPlease check if power supply is not less than 500 mA. Add RC not only R at CHIP_EN, add a pull-up at GPIO2, add a series inductor 24 nH at XTAL_P, use ESP32-C3F chip and add 1 uF at VDD_SPI.
Then schematic should be basically correct, layout should be designed following hardware guidelines and module reference designs, next you could try to run the board.
But pay attention to what Sprite said, whatever the design looks OK, real tests should be carried out to finally prove the functionality.
BTW, what we provide in the hardware design guidelines, both schematic and layout, is the simplest circuit to work well, it is better not to remove any part.
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3 needs external flash chip?
Yeah, you need a 40MHz crystal indeed, the C3 won't properly work with a 32MHz one. Your Arduino settings look like they should work, however I'm not an expert on that topic.
-
- Posts: 15
- Joined: Wed Feb 01, 2023 3:25 am
Re: ESP32-C3 needs external flash chip?
Thanks for the reply. I have ordered 40MHz crystals from DigiKey. Will drop an update as soon as I made any progressESP_Sprite wrote: ↑Mon Apr 10, 2023 1:08 amYeah, you need a 40MHz crystal indeed, the C3 won't properly work with a 32MHz one. Your Arduino settings look like they should work, however I'm not an expert on that topic.
-
- Posts: 15
- Joined: Wed Feb 01, 2023 3:25 am
Re: ESP32-C3 needs external flash chip?
After long waiting finally I found the perfect 40MHz crystal that matches the footprint on my PCB and I managed to replace it.
After that successful replacement, my board is accepting the code and executing it. I tried uploading serial printing code from Arduino IDE and I can see "Hi" on the serial monitor.
Now I want to blink the LED connected to one of its GPIO, but I can't figure out how the GPIOs are mapped in to Arduino IDE. I have selected ESP32C3 Dev Board as my board in Arduino IDE. So which development board on the market I should refer to know how the GPIOs are mapped into Arduino IDE?
Any help would be of great help!
Thanks in advance
After that successful replacement, my board is accepting the code and executing it. I tried uploading serial printing code from Arduino IDE and I can see "Hi" on the serial monitor.
Now I want to blink the LED connected to one of its GPIO, but I can't figure out how the GPIOs are mapped in to Arduino IDE. I have selected ESP32C3 Dev Board as my board in Arduino IDE. So which development board on the market I should refer to know how the GPIOs are mapped into Arduino IDE?
Any help would be of great help!
Thanks in advance
Re: ESP32-C3 needs external flash chip?
On most ESP32 dev boards, pins are labelled according to GPIO numbers. So to blink an LED attached to GPIOn, you can use digitalWrite(n, ...).
With regard to "esp32c3 dev board" in Arduino IDE, it is defined based on esp32-c3 devkit-m. The default pin definitions are here: https://github.com/espressif/arduino-es ... _arduino.h
Not that on that specific board, the LED is not a simple LED but an addressable one. Therefore a simple digitalWrite wouldn't work. To make it possible to easily blink an addressable LED using digitalWrite, there is a trick implemented in https://github.com/espressif/arduino-esp32/pull/6808.
With regard to "esp32c3 dev board" in Arduino IDE, it is defined based on esp32-c3 devkit-m. The default pin definitions are here: https://github.com/espressif/arduino-es ... _arduino.h
Not that on that specific board, the LED is not a simple LED but an addressable one. Therefore a simple digitalWrite wouldn't work. To make it possible to easily blink an addressable LED using digitalWrite, there is a trick implemented in https://github.com/espressif/arduino-esp32/pull/6808.
-
- Posts: 15
- Joined: Wed Feb 01, 2023 3:25 am
Re: ESP32-C3 needs external flash chip?
I have this PCB custom made that uses ESP32C3 FN4. Initially I had lot of problems like not using the ESP variant with in built flash and using some another crystal instead of 40MHz and I wasn't able to upload any sketches to my custom PCB.
After long long long awaiting, I finally managed to get my hands on proper components and replace them. This custom board is really really tiny. Just 20mmX40mm. While designing this board. I knew I will have to include atleast one LED so I can know if my code is working. I placed it on ESP32C3-FN4 physical pin4.
I'm programming this board using Arduino IDE and I know that Arduino IDE maps the GPIOs with different labels than actually the physical pins of the IC. This is because Arduino IDE refers them with a context of some development board.
So now, I'm bit confused as how my pins are mapped or how Arduino IDE considers them.
After long long long awaiting, I finally managed to get my hands on proper components and replace them. This custom board is really really tiny. Just 20mmX40mm. While designing this board. I knew I will have to include atleast one LED so I can know if my code is working. I placed it on ESP32C3-FN4 physical pin4.
I'm programming this board using Arduino IDE and I know that Arduino IDE maps the GPIOs with different labels than actually the physical pins of the IC. This is because Arduino IDE refers them with a context of some development board.
So now, I'm bit confused as how my pins are mapped or how Arduino IDE considers them.
-
- Posts: 15
- Joined: Wed Feb 01, 2023 3:25 am
Re: ESP32-C3 needs external flash chip?
So according to this link:
https://github.com/espressif/arduino-es ... _arduino.h
Should I write digitalWrite(SCK, HIGH); to turn ON the LED or like how it should be? I'm not asking about what logic I need to pass. What I'm trying to know is, On my custom PCB LED is connected to physcial4 pin of my ESP32-C3 FN4 IC. So to toggle/Access that pin what should be the pin Number in my Arduino code for command...let's say digitalWrite( ,HIGH);
https://github.com/espressif/arduino-es ... _arduino.h
Should I write digitalWrite(SCK, HIGH); to turn ON the LED or like how it should be? I'm not asking about what logic I need to pass. What I'm trying to know is, On my custom PCB LED is connected to physcial4 pin of my ESP32-C3 FN4 IC. So to toggle/Access that pin what should be the pin Number in my Arduino code for command...let's say digitalWrite( ,HIGH);
Re: ESP32-C3 needs external flash chip?
You need to check the chip datasheet, in this case https://www.espressif.com/sites/default ... eet_en.pdf. In chapter 2.2, there is a pinout diagram. For example, for pin 4 of the package, you will find that it corresponds to GPIO0. Therefore you need to pass "0" as the GPIO number in Arduino.
-
- Posts: 15
- Joined: Wed Feb 01, 2023 3:25 am
Re: ESP32-C3 needs external flash chip?
Thanks I'll check and get back to tell you how it goes.
Who is online
Users browsing this forum: pmi2410 and 88 guests