-
Notifications
You must be signed in to change notification settings - Fork 10
Getting unexpected value when reading SCAN register #15
Description
Hi everyone,
I'm trying to read what is written in SCAN register after doing the reset and the init. Then I'm sending the value to a Python program that displays it. I'm getting the right exadecimal value for the first 3 bytes I read, but the last byte I receive is a weird 0x17 and I don't understand why. This happens just if I read the SCAN register and the timer register... other registers have the right values.
uint8_t cmd [5] = {0,0,0,0,0};
cmd[0] = MCP3562_SCAN_SREAD;
uint8_t resp [5] = {0,0,0,0,0};
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET);
HAL_SPI_TransmitReceive(&hspi1, cmd, resp, 4, MCP3562_HAL_TIMEOUT);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET);
HAL_UART_Transmit(&huart2, resp, 4, HAL_MAX_DELAY);
Thanks for your help!