Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RM48L952: SPI1 and SPI2 have same HalCoGen settings, but different outputs

$
0
0

Part Number:RM48L952

I am trying to use the RM48L952 HDK board's SPI2 peripheral in Master mode. I originally used SPI1 and was able to verify the code and the HalCoGen settings as working. However, because this system also requires the Ethernet on the board and the HDK board has Ethernet and SPI1 muxed, I had to switch over to SPI2. I replicated the settings for SPI2 in HalCoGen, but the output is different. Attached are screenshots of my HalCoGen tabs for SPI1 and SPI2.

The code below are functions I am using to interact with my SPI slave. This code works when using SPI1, with the HalCoGen settings attached.(Please visit the site to view this file)

void init_spi_interface() {
	spiInit();

	data_config.CS_HOLD = 1;
	data_config.WDEL    = 0;
	data_config.DFSEL   = SPI_FMT_0;
	data_config.CSNR    = SPI_CS_0;
}

void send_spi_message() {

	uint16_t txBuf[] = {0x03U, 0x60U, 0xF4U, 0x6CU};

	spiTransmitData(spiREG2, &data_config, 4, txBuf);
}

The (correct) output of SPI1 is 03 60 F4 6C, whereas the (incorrect) output of SPI2 is 03 07 10. (Notice I only get a byte and a half rather than two bytes)

Is there something inherently different about SPI2 and SPI1 that would cause this?

Thank you,

John


Viewing all articles
Browse latest Browse all 262198

Trending Articles