adau1761 selfboot
Please help!! I use stm32f7 and adau1761. When loading over the i2c bus, the code loads without problems and register reading is good, but there is a need to load the code via the SPI interface, but I can't figure out how to do it!!! I tried different versions of the spi configuration but to no avail.
Edit Notes
Switching to SPI mode :
HAL_GPIO_WritePin(clatch_GPIO_Port, clatch_Pin, GPIO_PIN_RESET);
HAL_SPI_Transmit(&hspi2, 0x00, 1, 1000);
HAL_GPIO_WritePin(clatch_GPIO_Port, clatch_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(clatch_GPIO_Port, clatch_Pin, GPIO_PIN_RESET);
HAL_SPI_Transmit(&hspi2, 0x00, 1, 1000);
HAL_GPIO_WritePin(clatch_GPIO_Port, clatch_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(clatch_GPIO_Port, clatch_Pin, GPIO_PIN_RESET);
HAL_SPI_Transmit(&hspi2, 0x00, 1, 1000);
HAL_GPIO_WritePin(clatch_GPIO_Port, clatch_Pin, GPIO_PIN_SET);
void SIGMA_WRITE_REGISTER_BLOCK(uint8_t devAddress,uint16_t address, uint16_t length, ADI_REG_TYPE *pData ) {
HAL_GPIO_WritePin(clatch_GPIO_Port, clatch_Pin, GPIO_PIN_RESET);
HAL_SPI_Transmit(&hspi2, &devAddress, 1, 1000);
uint8_t addr[2];
addr[0] = address & 0xFF;
addr[1] = (address & 0xFF) >> 8;
HAL_SPI_Transmit(&hspi2, addr, 2, 1000);
HAL_SPI_Transmit(&hspi2, pData,length, 1000);
HAL_GPIO_WritePin(clatch_GPIO_Port, clatch_Pin, GPIO_PIN_SET);
}
[edited by: Roman at 12:19 PM (GMT 0) on 3 Jul 2020]
Audio Signal Processors
i2c
sigmastudio
SigmaDSP Audio Processors
adau1761
SigmaDSP
selfboot
Show More
Hello Roman,
Are you sending three dummy writes to set the comms port into SPI mode before sending any real data writes?
You probably need to use an oscilloscope to capture the SPI writes to see if the format is correct.
Dave T
Hello Roman,
I've never used ST micros before but I can see one thing that catches my eye. You write:
addr[0] = address & 0xFF;
addr[1] = (address & 0xFF) >> 8
Whereas I believe you should be writing:
addr[0] = address >> 8;
addr[1] = address & 0xFF;
Joshua
Please log in to reply.