Hello everyone,
Let me preface this by saying I'm quite new to the ESP32 and the ESP-IDF framework, so please bear with me.
Essentially, I've got three ESP32s that I want communicating with each other; one is a 'master' node that acquires field data, and the two others are 'slave' nodes that receive the data from said master. Both devices need to be on the same bus (i.e. common MOSI, MISO and SCLK but different CS), as I'm restricted in terms of GPIO pins. The current setup I've got consists of an interrupt that is triggered by a pulsed signal. The ISR gives a binary semaphore that is received by a background task which is responsible for the SPI transaction(s). This works perfectly fine with a single device, but fails when I introduce the second i.e. I receive no data on one device and garbled data on the other.
In the task, the SPI bus is initialised and slave devices are added before it enters an infinite loop, where the transactions are made. The transaction structure is built once, then using the spi_device_transmit()API function, it is sent to device 1, before the structure is rebuilt and sent to device 2. As the SPI bus is common, both transactions should be made in the same task. I've fiddled around with the clock speeds and I've introduced delays between the two spi_device_transmit() commands, but to no avail.
Perhaps there are timing considerations that need to be made, or perhaps the approach I'm taking isn't correct. I'd appreciate opinions so please feel free to offer any. I apologise for not having any code in this post; I'm currently at work.
Regards,
Mustafa
Multiple SPI Devices
-
- Posts: 3
- Joined: Thu Sep 19, 2019 12:41 am
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 生产支持讨论版
- 硬件问题讨论
- 项目展示
- 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.