This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BOOSTXL-SENSORS: BOOSTXL-SENSORS and BOOSTXL-BASSENSORS on MSP430FR5994 and MSP430FR6989

Part Number: BOOSTXL-SENSORS

Hello,

Currently, I am trying to run the BOOSTXL-BASSENSORS boosterpack on the MSP430FR6989 and was attempting to port some I2C driver code from the BOOSTXL-Sensors and MSP430FR5994 OOB code examples.  However, I kept running into an error on the driver where "while(!(UCB0IFG & UCTXIFG0));" during I2C communication, making me think the slave is not registering.  Then, when I tried the OOB code on the BOOSTXL-Sensors and the MSP430FR5994 combination, I received the same error, even though this is example code that is built for these devices.

Is there a reason I am running into this error?  If any more information is needed please let me know, thanks!

  • Hi Domenick,

    Attached is example code using FR6989 to acquire data from the OPT3001 on the BOOSTXL-BASSENSORS boosterpack.

    FR6989_demo.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    //******************************************************************************
    // MSP430FR6989 Demo - BOOSTXL- BASSENSORS BOOSTERPACK
    //
    //
    //******************************************************************************
    #include <msp430.h>
    #include <stdint.h>
    #include <stdbool.h>
    //******************************************************************************
    // General I2C State Machine ***************************************************
    //******************************************************************************
    typedef enum I2C_ModeEnum{
    IDLE_MODE,
    NACK_MODE,
    TX_REG_ADDRESS_MODE,
    RX_REG_ADDRESS_MODE,
    TX_DATA_MODE,
    RX_DATA_MODE,
    SWITCH_TO_RX_MODE,
    SWITHC_TO_TX_MODE,
    TIMEOUT_MODE
    } I2C_Mode;
    /* Used to track the state of the software state machine*/
    I2C_Mode MasterMode = IDLE_MODE;
    /* The Register Address/Command to use*/
    uint8_t TransmitRegAddr = 0;
    /* ReceiveBuffer: Buffer used to receive data in the ISR
    * RXByteCtr: Number of bytes left to receive
    * ReceiveIndex: The index of the next byte to be received in ReceiveBuffer
    * TransmitBuffer: Buffer used to transmit data in the ISR
    * TXByteCtr: Number of bytes left to transfer
    * TransmitIndex: The index of the next byte to be transmitted in TransmitBuffer
    * */
    #define MAX_BUFFER_SIZE 20
    uint8_t ReceiveBuffer[MAX_BUFFER_SIZE] = {0};
    uint8_t RXByteCtr = 0;
    uint8_t ReceiveIndex = 0;
    uint8_t TransmitBuffer[MAX_BUFFER_SIZE] = {0};
    uint8_t TXByteCtr = 0;
    uint8_t TransmitIndex = 0;
    /* I2C Write and Read Functions */
    /* For slave device with dev_addr, writes the data specified in *reg_data
    *
    * dev_addr: The slave device address.
    * Example: SLAVE_ADDR
    * reg_addr: The register or command to send to the slave.
    * Example: CMD_TYPE_0_MASTER
    * *reg_data: The buffer to write
    * Example: MasterType0
    * count: The length of *reg_data
    * Example: TYPE_0_LENGTH
    * */
    I2C_Mode I2C_Master_WriteReg(uint8_t dev_addr, uint8_t reg_addr, uint8_t *reg_data, uint8_t count);
    /* For slave device with dev_addr, read the data specified in slaves reg_addr.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

**Attention** This is a public forum