Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hi,
I have instal the simple link example , but it not work, the program stops after call the function sensorTmp007Init, i don't understand what it's happend..
Can anyone help me?
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.
Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hi,
I have instal the simple link example , but it not work, the program stops after call the function sensorTmp007Init, i don't understand what it's happend..
Can anyone help me?
Armando,
OK. It's not a problem to have sensors that aren't in a boosterPack! If you could also steer me to where you got the example. I don't recognize the code snippet or project name as one of the I2C examples that can be found on TI Resource Explorer under the MSP432 SimpleLink SDK examples.
What may be happening is that you simply aren't using the right combination of LaunchPad pin to Peripheral pin assignment. If you send me the location of the example, then I can help you run down the issue.
Regards,
Bob L.
Bob Landers
I am glad to wear that(" OK. It's not a problem to have sensors that aren't in a boosterPack!"), I follow the example that can be fond on TI Resource Explorer in this link boostxl_sensors_sensorgui_msp432p401r . The only modification I made it was on main.c .
The conections:
MSP432 TMP006
5V ----------------->VCC
GND---------------->GND
P6.5---------------->SCL
P6.4---------------->SDA
GND---------------->AD0
GND---------------->AD1
#include <stdio.h> #include "msp.h" #include "main.h" #include "driverlib/driverlib.h" #include "HAL_I2C.h" #include "TMP006.h" // TMP007 uint16_t rawTemp; uint16_t rawObjTemp; float tObjTemp; float tObjAmb; bool TMP_on = true; void main(void){ WatchDogHold(); /* Initialize I2C communication */ initI2C(); /* Initialize TMP006 temperature sensor */ sensorTmp007Init(); while(1){ /* Obtain temperature value from TMP006 */ if(TMP_on){ sensorTmp007Enable(true); sensorTmp007Read(&rawTemp,&rawObjTemp); sensorTmp007Convert(rawTemp, rawObjTemp, &tObjTemp, &tObjAmb); sensorTmp007Enable(false); } } } void WatchDogHold(void ){ WDTCTL = WDTPW | WDTHOLD; /*STOP WATCHDOG TIMER*/ }
One immediate question is, do you have the Bosch Sensor Sensor Hub BoosterPack (which has a clear BOSCH on the silkscreen), or do you have the BOOSTXL-SENSORS BPack as shown in this link? The code required for the 2 will differ, so to use the demo code you reference will require having that boosterpack installed. I just confirmed that the code will go past the sensorTmp007Init(); call for the demo code in question.
-Bob
Bob
I have already tested both the tmp006 and tmp007 codes, both do not work. I already know what to do. as I mentioned earlier I have an adafruit board, which contains the tmp006, as I have seen that some users also have problems when trying to connect with this sensor, I tried the code of tmp007, and it works until entering the following part:
sensorTmp007Read(&rawTemp,&rawObjTemp);
sensorTmp007Convert(rawTemp, rawObjTemp, &tObjTemp, &tObjAmb);
on the base both codes are similar should it work ... the code hangs on booleans
Armando,
Were you able to make any more progress on this? I took a look at the base code for sensorTmp007Read and sensorTmp007Convert() and you look to be using them correctly in your code. From this point the only other thing I would try is to use the sensors BoosterPack along with the boostxl_sensors_sensorgui code you referenced to see if everything works correctly for your board when using the hardware for which this example was designed.
For your future reference, here is what else I might suggest to get this working:
That's all the help I can provide for now. If you do get this working, or have some additional debugging data, please followup on this post.
Regards,
Bob L.
Hi Bob Landers,
I have implement many other codes, to make the sensor work. But all work is unsuccessful, I dont now what I have to do, to get the goal. i send to you my digital analyzer capture
I need a code that has already been tested and is working for someone to check if the problem is sensor or implementation. I start to question everything
Your diagram looks OK- I can see the START condition and STOP condition in the output. Here's an example pair to use to see if I2C is working on your launchPad. You would need 2 LPads for Master/Slave pair.
The examples below are in TI Resource Explorer under the MSP432P4 SDK:
1. i2c_master_w_multibyte-master_code
2. i2c_master_w_multibyte-slave_code
An alternative would be to run the TMP007 example from the SENSORS boosterpack while it is attached and see if you get the results mentioned in the SimpleLink Academy (SLA) Module.
(NOTE- at this moment the SLA link is down. I'll update this post when that is available).
Regards,
Bob L.
Hi Bob Landers
I've been able to get values, however, the code only runs the first time. After that the read value "freezes". I leave my written function of my I2C code
void I2C_write16(unsigned char pointer, unsigned int writeByte){ /**/ while(EUSCI_B1->CTLW0 & EUSCI_B_CTLW0_TXSTP); /*START I2C WRITE OPERATIONS*/ EUSCI_B1->CTLW0 |= EUSCI_B_CTLW0_TR + EUSCI_B_CTLW0_TXSTT; /**/ EUSCI_B1->IFG &= ~(EUSCI_B_IFG_TXIFG0); /**/ while(EUSCI_B1->STATW & EUSCI_B_STATW_BBUSY_OFS); /**/ EUSCI_B1->TXBUF = pointer; /**/ EUSCI_B1->TXBUF = ((unsigned char)(writeByte>>8)); /**/ EUSCI_B1->TXBUF = ((unsigned char)(writeByte&0xFF)); /**/ EUSCI_B1->CTLW0 |= EUSCI_B_CTLW0_TXSTP; /**/ }
**Attention** This is a public forum