Part Number: MSP430FR6047
Hello everyone, I am working with EVM430FR6047 with the application " MSP430FR6047EVM_USS_Water_Demo ". So the idea is sending data from MSP430 to my Arduino board over I2C protocol. However when I implement the I2C function to the main source code, i am losing the connection between EVM430FR6047 board and the USS ( Ultrasonic sensing design center) software. Is this the problem about using I2C because board is communicating with the computer over I2C ?
As far as I see from the datasheet this evaluation board has two I2C peripherals, I thought this would solve the issue.Is there any way to solve this problem ? Now I will provide you my code as well. If this is the problem about using I2C and would not be possible to use the I2C for data sending without losing the communication with USS, would it work with UART ? Thank you for your help. ( UART protocol is commented out)
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
/* EUSCI_A_UART_initParam uartParams = {
.selectClockSource = UCSSEL_2, // SMCLK as clock source
.msborLsbFirst = 0, // MSB first
.numberofStopBits = 0, // 1 stop bit
.parity = EUSCI_A_UART_NO_PARITY, // No parity
.clockPrescalar = 104, // Baud rate control
.firstModReg = 1, // First modulation stage
.secondModReg = 0, // Second modulation stage
.overSampling = 0, // No oversampling
.uartMode = UCMODE_0, // UART mode
};
EUSCI_A_UART_init(EUSCI_A0_BASE, &uartParams);
EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'A');
*/
EUSCI_B_I2C_initMasterParam i2cParams = {
.selectClockSource = EUSCI_B_I2C_CLOCKSOURCE_SMCLK, // Use SMCLK as clock source
.i2cClk = 100000, // I2C clock frequency (Hz)
.dataRate = 10000, // Desired data rate (Hz)
.autoSTOPGeneration = EUSCI_B_I2C_NO_AUTO_STOP, // No automatic STOP generation
.byteCounterThreshold = 0, // No byte counter threshold
};
uint16_t reset_source = 0x00;
// Initializes the basic functionality of the system
hal_system_Init();
// Initialize interfaces to user including buttons, LCD, GUI
HMI_Init();
// Verify the reset source and log/report if there was an error
reset_source = hal_system_GetResetSource();
if(reset_source != 0x00)
{
USSLibGUIApp_send_error(COMMAND_HANDLER_ERROR_FAULT_RESET_ERROR,
reset_source);
}
__enable_interrupt();
// Initialize the USS Lib
USSLibGUIApp_Init();
//EUSCI_B_I2C_initMaster(EUSCI_B0_BASE, &i2cParams);
// EUSCI_B_I2C_setSlaveAddress(EUSCI_B0_BASE, 0x42);
// EUSCI_B_I2C_enable(EUSCI_B0_BASE);
while(1) {
EUSCI_B_I2C_initMaster(EUSCI_B0_BASE, &i2cParams);
EUSCI_B_I2C_setSlaveAddress(EUSCI_B0_BASE, 0x42);
EUSCI_B_I2C_enable(EUSCI_B0_BASE);
EUSCI_B_I2C_masterSendSingleByte(EUSCI_B0_BASE, 'A');
USSLibGUIApp_Engine();
}
}
