On AMB82 MINI, SPI1 MISO (Pin 0 / PF5) always reads 0x00, no matter what data is sent on MOSI. Because of this, hardware SPI communication with peripherals does not work.
Hardware / Software
Board: AMB82 MINI (RTL8735B)
SDK: Realtek Ameba Boards 4.0.9
SPI1 pins:
MISO: Pin 0 (PF5)
MOSI: Pin 2 (PF7)
SCLK: Pin 1 (PF6)
Tests and Observations
Loopback test
MOSI (Pin 2) was physically connected to MISO (Pin 0).
Sending 0xAA always returns 0x00.
This suggests that SPI1 MISO is not actually receiving data.
Pinmux conflict
When initializing SPI1, the following error appears:
[MISC Err] Pin 5[5] is conflicted
[MISC Err] It's using by peripheral F0000000
[SSI Err] PIN a5 cannot be registered.
What was tried
Loopback test (confirms MISO issue)
Removing CS pinMode before SPI.begin()
Setting pinMode(0, INPUT) before SPI1.begin()
Testing SPI0 (MISO on Pin 14) — same result
Disabling FreeRTOS interrupts
Minimal SPI initialization code
All cases behave the same: MISO always returns 0x00.
Current workaround
Software SPI (bit-banging) works reliably, but hardware SPI is preferred for performance and stability.
Questions
Is SPI1 MISO on AMB82 MINI actually supported and usable?
What peripheral is occupying PF5 (shown as F0000000)?
Is there a known fix or recommended workaround for this issue?
The error looks identical to the one before, does your fix for SPI0 not work for SPI1 too? If not, please share what you did to fix your issue with SPI0 so we can try other methods to figure out the problem better.
Meanwhile please give our SPI example a try and check if your SPI0 and SPI1 are working as intended. You can find it within {SDK}\project\realtek_amebapro2_v0_example\example_sources\spi_master_write_read_one_byte\src\main.c", this sets SPI0 as slave and SPI1 as master.
I have also compiled and ran the example with SPI0 as master and SPI1 as slave instead. The example worked both times when SPI0 is connected SPI1 and when both SPIs’ looped back to themselves as in your loopback test.
Hi, Thank you for the example. I understand the FreeRTOS SDK approach.
However, Arduino IDE uses different API (`SPI1.begin()` vs `spi_init()`) and **SPI1 MISO still returns 0x00** in Arduino IDE, even after removing CS pinMode before SPI.begin().
— Can we use FreeRTOS SDK SPI API (`spi_init()`, `spi_format()`) from Arduino IDE, or should we switch to FreeRTOS SDK?
Sorry it slipped my mind to keep it within Arduino. Rest assured you will be fine sticking with our Arduino SDK as we have designed it to be identical to our FreeRTOS’s SDK. I have converted the example to a simpler one to be used with the ArduinoIDE. Please test it with your AMB82-Mini and let me know how it goes!
Master SPI0 and Slave SPI1. The loopback test should pass for both sides too.
#include <SPI.h>
void setup() {
Serial.begin(115200);
delay(2000);
Serial.println("=== SPI1 Test on AMB82 MINI ===");
Serial.println("Initializing SPI0 and SPI1");
SPI.begin(SPI_MODE_MASTER);
SPI1.begin(SPI_MODE_SLAVE);
Serial.println("SPI0 and SPI1 initialized");
Serial.println("Begin Slave Send and Read");
SPI1.slaveWrite(0x44);
uint8_t masterRead = SPI.masterWrite(0x55);
Serial.print("masterRead: 0x");
Serial.println(masterRead, HEX);
uint8_t slaveRead = SPI1.slaveRead();
Serial.print("slaveRead: 0x");
Serial.println(slaveRead, HEX);
}
void loop() {
delay(1000);
}