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.

TPS8802: Smoke Detector Example Source Code and Errors

Part Number: TPS8802
Other Parts Discussed in Thread: ENERGIA

Hi,

We are designing a sensor box which contains smoke detector with TPS8802.

We got TPS8802_MSP430_firmware example code and trying to convert it according to the our host controller. But we got below errors, there are more that I didn't copy.

In the "DualRaySmokeAFE_HAL_Config_FR235x_TPS880x_Private.h" file, it is defined as shown below in red line, but  TB0CCTL0, CCIE etc. identifier definitions aren't placed in the project folder. Probably these are related to MSP430 MCU timer registers. But we don't know what these parts do, what is the purpose of these commands, so we don't know how we can convert it according to the our host platform. We need your support at these point.

In this example project that we have, we think there are detailed scenarios as timers, alerts and etc. We basically need just calculating CO level and smoke detection. So I will appreciate if you can share an example code just contains these parts basically.

Thanks.

BR

Burak

#define DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_COMPAREINIT(x)  \

                                            {TB0CCTL0 = CCIE; TB0CCR0 = x;}

 

compiling DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c...

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\tps880x_msp430_i2c/tps880x_msp430_i2c.h(53): warning:  #1295-D: Deprecated declaration tps880x_msp430_i2c_Reset - give arg types

  extern int8_t tps880x_msp430_i2c_Reset();

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(323): error:  #20: identifier "TB0CCTL0" is undefined

      DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_COMPAREINIT(delay_cycles);  // Initialize timer in capture mode

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(323): error:  #20: identifier "CCIE" is undefined

      DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_COMPAREINIT(delay_cycles);  // Initialize timer in capture mode

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(323): error:  #20: identifier "TB0CCR0" is undefined

      DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_COMPAREINIT(delay_cycles);  // Initialize timer in capture mode

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(324): error:  #20: identifier "TB0CTL" is undefined

      DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_LPCOMPARESTART();             // Start timer

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(324): error:  #20: identifier "TBSSEL__ACLK" is undefined

      DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_LPCOMPARESTART();             // Start timer

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(324): error:  #20: identifier "MC__UP" is undefined

      DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_LPCOMPARESTART();             // Start timer

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(324): error:  #20: identifier "TBCLR" is undefined

      DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_LPCOMPARESTART();             // Start timer

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(329): warning:  #223-D: function "__bis_SR_register" declared implicitly

          __bis_SR_register(LPM3_bits + GIE);

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(329): error:  #20: identifier "LPM3_bits" is undefined

          __bis_SR_register(LPM3_bits + GIE);

..\TPS8802\Src\DualRaySmokeAFE_HAL\MSP430FR235x_TPS880x\DualRaySmokeAFE_HAL_Timing_FR235x_TPS880x.c(329): error:  #20: identifier "GIE" is undefined

          __bis_SR_register(LPM3_bits + GIE);

  • Hi Burak,

    Thanks for your question. Today is a US holiday, please expect some delays in answering your questions.

    If you are looking for basic code to do smoke and CO measurements, we do have energia code available. This is high level MSP430 code for basic evaluation.

    www.ti.com/.../slvc813

    Best,

    Grant

  • Hi Grant,

    Thanks for your feedback and sharing. I will quickly check if this project gives an idea where we were stuck. Thanks.

    BR

    Burak

  • Hi Grant,

    We checked project you have shared but it doesn't contain source code, it has .ino file. Could you please share source code of this project? Or it would be enough for us having CO and smoke detection init and calculation parts. Thanks in advance.

    BR

    Burak

  • Hello,

    I will appreciate if I could get support about .c file source code example.

    BR

    Burak

  • Hi Burak,

    Apologies for the delay, I have just returned from vacation.

    The .ino file is for basic smoke and CO evaluation using MSP430 and Energia. I do not have any variations of this code (i.e. .c code).

    Here is the feedback from our software engineer:

    "The demo has a HAL to try to modularize the hardware layer, but they are going to have to migrate some of these functions themselves.

     

    I.e. they mention:

    #define DUALRAYSMOKEAFE_HAL_TIMING_GPTIMER_COMPAREINIT(x) 

    This macro initializes the TimerB in compare mode, and this is very specific for MSP430, but it’s required for a more generic APIs:

    DualRaySmokeAFE_HAL_Timing_GPTimer_BlockingLPDelayms

    DualRaySmokeAFE_HAL_Timing_GPTimer_BlockingHPDelayus

    These functions will implement a General Purpose Timer delay of ms and us, which is used for several purposes in the application, and they’ll probably need something similar. The demo uses these functions to wait for several settling times such as Boost, LDO, VREF, AFE, temperature sensor, etc.

     

    So, they don’t need to migrate the macro, but they’ll probably need to implement their own delays if they want to follow our recommended flow.

     

    That’s just one example, but my point is that removing some HW pieces is not that simple, especially since they are using a different host MCU with its own capabilities.

     

    I think the best approach might be to use the code as a reference and not migrate it directly. I.e. start by migrating the low level i2c functions trying to read/write TPS880x registers, then move to higher level API such as DualRaySmokeAFE_HAL_AFE_Init and DualRaySmokeAFE_HAL_AFE_Measurement."

    I will send you a private message with some more information.

    Best,

    Grant