cancel
Showing results for 
Search instead for 
Did you mean: 

SPI communication with X-NUCLEO-OUT02A1

Zuffouille
Associate II

I order the X-NUCLEO-OUT02A1 and I work with a NUCLEO-F746ZG.

These two boards aren't directly compatible I know.

But they communicate with SPI, so I'm sure that you just can implement the communication with a bit of mapping with some breadboard wires.

It should works.

I saw that there is some library to use with other board but I don't want to install it. Because I don't need all that stuff, Ijust want to implement the SPI communication.

And in the HTML compiled program, nothing.

Impossible to find any documentation about the communication between these two boards !

Were can I find it ?

3 REPLIES 3
Peter BENSCH
ST Employee

Welcome, @Zuffouille​, to the community!

As can be seen from the schematics, the ZIO connector is compatible to the Arduino Uno one used by the X-NUCLEO-OUT02A1.

Examples of communication can be found in the source code package X-CUBE-OUT2, which so far only contains drivers and BSP for STM32F3xx and STM32F4xx. However, it should not be too much of a problem to add the missing parts for STM32F7xx and other families.

Does it answer your question?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Zuffouille
Associate II

Ok thanks, i see

Now i have another problem.

I've implemented the SPI communication and i can transmit and receive the fault byte from the board.

But there isn't any led that turn on...

Here is the code that I add to my project. I didn't add the X-CUBE-OUT2 package.

// Communication with relay shield
uint8_t Iso8200aq_Board_SpiWriteByte(uint8_t *pByteToTransmit, uint8_t *pReceivedByte, uint8_t nbDevices)
{
	HAL_StatusTypeDef status = HAL_OK;
	uint32_t i;
	HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_RESET);
	for (i = 0; i < nbDevices; i++)
	{
		printf("SPI TX : ");
		print_bin(pByteToTransmit);
		printf("\n");
		status = HAL_SPI_TransmitReceive(&hspi1, pByteToTransmit, pReceivedByte, 1, 1000);
		printf("SPI RX : ");
		print_bin(pReceivedByte);
		printf("\n");
		if (status != HAL_OK)
		{
			break;
		}
		pByteToTransmit++;
		pReceivedByte++;
	}
	HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_SET);
 
	return (uint8_t) status;
}
 
void testSpiCom()
{
	uint8_t state1Relays = 0b11001100;
	uint8_t state2Relays = 0b11110000;
	Iso8200aq_Board_SpiWriteByte(&state1Relays, &spiRxByte, 1);
	HAL_Delay(5000);
	Iso8200aq_Board_SpiWriteByte(&state2Relays, &spiRxByte, 1);
	HAL_Delay(5000);
}

And here is the output console :

0693W00000Ns1hCQAR.pngAnd nothing on the output also (i've measured the voltage).

What i'm doing wrong ?

Regards

--

Samuel

Has the ISO8200AQ been fully initialised?

Have you enabled the ISO8200AQ via ISO_OUT EN before writing to the SPI port?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.