I am trying to use the spi, and the chip select is not being held low while transmission in progress. It is bouncining, and not very predictable on how many times or when.
Is there a way to drive the cs low, send and receive all the data and then drive the cs high?
I have tried many different code setups with the spi_master.h and c
currently it is something like:
spi_bus_config_t spiConfig =
{
.miso_io_num = SPI_MISO,
.mosi_io_num = SPI_MOSI,
.sclk_io_num = SPI_CLK,
.quadhd_io_num = -1,
.quadwp_io_num = -1,
.max_transfer_sz = 0, // 0 means that max transfer size is 4k bytes
};
spi_device_interface_config_t deviceConfig =
{
.mode = 0,
.spics_io_num = SPI_ADC_CS, // using cs 0 and 5 and both operate the same
.clock_speed_hz = SPI_MASTER_FREQ_10M,
.queue_size = 1,
.address_bits = 0,
};
ESP_ERROR_CHECK_WITHOUT_ABORT(spi_bus_initialize(SPI_BUS, &spiConfig, SPI_DMA_CH_AUTO));
ESP_ERROR_CHECK_WITHOUT_ABORT(spi_bus_add_device(SPI_BUS, &deviceConfig, &mDeviceList.id));
ESP_ERROR_CHECK_WITHOUT_ABORT(spi_device_transmit(device->id, &device->rxtx));
And I am assigning the pointers to an allocated array.
I have tried using -1 for the cs and driving it with the call backs and it operates the same. Is there any suggestion on how to set up the spi to operate as I am intending other than driving the cs independently and around the spi_device_transmit() function call.
Let me know if there is anything else that would help to solve this issue.
Thank you in advance.
ESP32 SPI Chip Select Not working.
-
- Posts: 10
- Joined: Thu Mar 05, 2020 1:24 pm
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 85 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.