Hi everybody. I have a problem to use SPI trasmission protocol using S7G2-SK. I made a test program for to use SPI so: Open SCI2_b port and use SPI protocol make a uint8_t variable to sent Send variable change variable Send the same variable and this is a part of code that I have used: errSPI = g_spi_cyclone.p_api- open(g_spi_cyclone.p_ctrl, (spi_cfg_t *)g_spi_cyclone.p_cfg); uint8_t src = 0; errSPI = g_spi_cyclone.p_api- write(g_spi_cyclone.p_ctrl, &src, 1,SPI_BIT_WIDTH_8_BITS); / if(errSPI != SSP_SUCCESS) { while(1) } src = 1; errSPI = g_spi_cyclone.p_api- write(g_spi_cyclone.p_ctrl, &src_buffer, 1,SPI_BIT_WIDTH_8_BITS); if(errSPI != SSP_SUCCESS) { while(1) } This is the problem: the first data is sent correctly, but when I try to send the second the program enter in the trap cycle, but when I debug this slice the program works. Someone can help me to find where I mistake?
↧