Skip to content

Getting unexpected value when reading SCAN register #15

@riccardobastoni97

Description

@riccardobastoni97

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions