-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting unexpected value when reading SCAN register #15
Comments
Hi, However:
|
|
|
|
Hey, 0x17 is status. In the Code: int32_t * MCP3561_ReadADCData_32Bit_Scan(SPI_HandleTypeDef *hspi){ |
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!
The text was updated successfully, but these errors were encountered: