Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all 22077 articles
Browse latest View live

MSP430FR2311: Strange Behavior with Debugger, ADC10 reading and LPM0

$
0
0

Part Number: MSP430FR2311

Hello,

Sorry for the horrible title of this thread, but it is hard to describe the problem.  I've seen some strange behavior.  Sometimes when I run my code the debugger always seems to stop on one of the "__bis_SR_register(LPM0_bits + GIE);" in one of the ADC reading calls.  If it hit play it will just loop through the code once more and stop again.  I have no breakpoints set.  The strange part is if I remove one of the adc reading calls it goes away (e.g adc0_sample()).  I dug into this further and started toggling P2.3 when the CPU is awake and notice when it does this strange behavior that GPIO P2.3 will be high all time time which somewhat implies the CPU never goes back to sleep.  I even detach the debugger and see the same behavior.   Like I said before if I remove one of the adc reading calls, it goes away.  So then I added more code in each of the adc_sample() calls that sets the P2.3 low before it goes to sleep waiting for the ADC conversion to finish.  After the conversion is finished I set P2.3 high again.  Once I did this the problem went away again.  I see what I would expect.  P2.3 high for short time and then sleep.  It does this three times and then stays high for a longer interval to process everything else and then finally goes back to sleep for a longer interval until the next RTC interrupt kicks off the next cycle through the while(1).

So I'm really confused if I have a race condition of some sort or if I have an implementation bug.  Below I've attached the general idea of my code. It is worth noting I'm running the highest level of optimization for size in the compiler.

#include "driverlib.h"
#include <msp430.h>

/*
 * main.c
 */
int main(void) {
    //Stop WDT
    WDT_A_hold(WDT_A_BASE);
    initClockTo16MHz();
    initUART();

/* Initialize peripherals */
    initGPIO();
    initRTC();

    __delay_cycles(10000);

    EUSCI_A_UART_enable(EUSCI_A0_BASE);

    while(1){
	
		//woken by RTC interrrupt

        P2OUT |= BIT3;  //check CPU usage

    	adc1Sample();
    	adc1_reading = ADC_Conversion_Result;

        adc0Sample();
        adc0_reading = ADC_Conversion_Result;

        tempSample();
		temperature_reading = ADC_Conversion_Result;

		do_other_processing();

    	P2OUT &= ~BIT3;  // check cpu usage

        __bis_SR_register(LPM0_bits + GIE);  // change to LPM0

	}

}

void enable_ADC10(uint8_t adc_channel){
	//Initialize the ADC Module
	/*
	 * Base Address for the ADC Module
	 * Use internal ADC bit as sample/hold signal to start conversion
	 * USE MODOSC 5MHZ Digital Oscillator as clock source
	 * Use default clock divider of 1
	 */
	ADC_init(ADC_BASE, ADC_SAMPLEHOLDSOURCE_SC, ADC_CLOCKSOURCE_ADCOSC, ADC_CLOCKDIVIDER_1);


	ADC_enable(ADC_BASE);

	ADC_setupSamplingTimer(ADC_BASE, ADC_CYCLEHOLD_1024_CYCLES, ADC_MULTIPLESAMPLESDISABLE);

	if(adc_channel == ADCINCH_12)
	{
	    ADC_configureMemory(ADC_BASE, adc_channel, ADC_VREFPOS_INT, ADC_VREFNEG_AVSS);
	}
	else
	{
	    ADC_configureMemory(ADC_BASE, adc_channel, ADC_VREFPOS_AVCC, ADC_VREFNEG_AVSS);  
	}

	ADC_clearInterrupt(ADC_BASE, ADC_COMPLETED_INTERRUPT);

	//Enable the Memory Buffer Interrupt
	ADC_enableInterrupt(ADC_BASE, ADC_COMPLETED_INTERRUPT);
}

void disable_ADC10(void){
	ADC_disableConversions(ADC_BASE,0);
	ADC_disable(ADC_BASE);
}

void adc1Sample(void)
{
    enable_ADC10(ADCINCH_1);

    __delay_cycles(15);

    //Enable and Start the conversion
    //in Single-Channel, Single Conversion Mode
    ADC_startConversion(ADC_BASE, ADC_SINGLECHANNEL);
    //LPM0, ADC conversion complete will force exit
    __bis_SR_register(LPM0_bits + GIE);

    disable_ADC10();
}

void adc0Sample(void)
{
    enable_ADC10(ADCINCH_0);  // should be 0

    __delay_cycles(15);

    //Enable and Start the conversion
    //in Single-Channel, Single Conversion Mode
    ADC_startConversion(ADC_BASE, ADC_SINGLECHANNEL);
	//LPM0, ADC conversion complete will force exit
    __bis_SR_register(LPM0_bits + GIE);

    disable_ADC10();
}

void tempSample(void)
{
    enable_ADC10(ADCINCH_12);

    __delay_cycles(15);

    //Enable and Start the conversion
    //in Single-Channel, Single Conversion Mode
    ADC_startConversion(ADC_BASE, ADC_SINGLECHANNEL);

	//LPM0, ADC conversion complete will force exit
    __bis_SR_register(LPM0_bits + GIE);

    disable_ADC10();
}

void initGPIO(void){

    P1DIR |= 0b01000000; 

    P2DIR |= 0b00001111;  // P0-P3 all outputs
    P2OUT = 0x00;

    PMM_enableTempSensor();  // enable temperature sensor
    PMM_enableInternalReference();

    P1SEL1 |= GPIO_PIN6;    // PWM mode

    P1SEL1 &= ~(BIT7);                 // USCI_A0 UART operation TX only
    P1SEL0 |= BIT7;

    // I2C pins
    P1SEL0 |= BIT2 | BIT3;
    P1SEL1 &= ~(BIT2 | BIT3);

    //ADC Pins
    P1SEL0 |= BIT0 | BIT1;
    P1SEL1 |= BIT0 | BIT1;
    /*
     * Disable the GPIO power-on default high-impedance mode to activate
     * previously configured port settings
     */
    PMM_unlockLPM5();
}

// ADC interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=ADC_VECTOR
__interrupt void ADC_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(ADC_VECTOR))) ADC_ISR (void)
#else
#error Compiler not supported!
#endif
{
    ADC_Conversion_Result = ADCMEM0;  // AP

	__bic_SR_register_on_exit(LPM0_bits);              // Exits LPM0
}

void initClockTo16MHz()
{
    // Configure one FRAM waitstate as required by the device datasheet for MCLK
    // operation beyond 8MHz _before_ configuring the clock system.
    FRCTL0 = FRCTLPW | NWAITS_1;

    __bis_SR_register(SCG0);    // disable FLL
    CSCTL8 |= MODOSCREQEN;      
    CSCTL3 |= SELREF__REFOCLK;  // Set REFO as FLL reference source
    CSCTL0 = 0;                 // clear DCO and MOD registers
    CSCTL1 &= ~(DCORSEL_7);     // Clear DCO frequency select bits first
    CSCTL1 |= DCORSEL_5;        // Set DCO = 16MHz
    CSCTL2 = FLLD_0 + 487;      // set to fDCOCLKDIV = (FLLN + 1)*(fFLLREFCLK/n)
                                //                   = (487 + 1)*(32.768 kHz/1)
                                //                   = 16 MHz

    __delay_cycles(3);
    __bic_SR_register(SCG0);                        // enable FLL
    while(CSCTL7 & (FLLUNLOCK0 | FLLUNLOCK1));      // FLL locked

    CSCTL4 = SELMS__DCOCLKDIV | SELA__REFOCLK;
}


// RTC interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=RTC_VECTOR
__interrupt void RTC_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(RTC_VECTOR))) RTC_ISR (void)
#else
#error Compiler not supported!
#endif
{
    __bic_SR_register_on_exit(LPM0_bits);              // Sleep Timer Exits LPM0

   switch(__even_in_range(RTCIV,RTCIV_RTCIF))

   {
       case  RTCIV_NONE:   break;          // No interrupt
       case  RTCIV_RTCIF:                  // RTC Overflow
           break;
       default: break;
   }
}

void initRTC()
{
    RTCMOD = 16-1;  // setup for 256Hz
    SYSCFG2 |= RTCCKSEL;                    // Select ACLK as RTC clock
    RTCCTL = RTCSS_1 | RTCSR | RTCPS__16 | RTCIE;
}



MSP430F5529: Back channel UART on the MSP430F5529

$
0
0

Part Number: MSP430F5529

I am attempting to communicate with a terminal (I'm using Windows 10) through the back channel UART feature of the MSP-EXP430F5529LP.

This is my code for setting up the UART using USCI_A1:

UartSetup(void)
{
    UCA1CTL1 |= UCSWRST; // Put state machine in reset state

    UCA1CTL0 = 0x00; // Asynchronous mode, UART mode, stop bit = 1 bit stop, 8 bit data, LSB first, Odd parity (parity disabled)

    UCA1CTL1 |= UCSSEL__SMCLK;				// SMCLK clock source

    UCA1BR0 = 0x41;					// Baud Rate = 9600  (UCA0BR0 + (UCA0BR1 * 256) == 833 @ 8MHz)
    UCA1BR1 = 0x03;

    UCA1MCTL = 0x92;					// Modulation UCBRSx = 2 (Required for baud rate 9600 @ 8MHz)

    P4SEL |= BIT4; // UART over USB TX

    UCA1CTL1 &= ~UCSWRST;
}

This is my TX code:

void
UartPutChar(uint8_t tx_char)
{
	while(!(UCB1IFG & UCTXIFG))				// wait till UART Transmit buffer is empty
	{
	}

	UCA1TXBUF = tx_char;						// send the character
}

I am only trying to TX to the terminal; but I'm not seeing anything (I'm using uCon).

I tried seeing if pin P4.4 is transmitting anything through an oscilloscope, and it is. I'm not sure what I'm doing wrong.

MSP432P401R: ARM architecture Architecture and Assembler Instructions

Compiler/MSP430FR5964: FRAM memory address over 0x10000 useing SRAM issue

$
0
0

Part Number: MSP430FR5964

Tool/software: TI C/C++ Compiler

Hi Sir,

Using MSP430FR5964 & IAR compiler. We need use FRAM memory the address 0x10000- 0x1ffff to store JPG file.

But we cannot defines as following:

#pragma location  = 0x10000

 __persistent unsigned char Picture[40960];  
unsigned char Picture[40960];

Please help me to slove this issue,

HC

Thanks 

Best regards

Jacky Xu

MSP430AFE253: How to read the 24bits ADC result?

$
0
0

Part Number: MSP430AFE253

How long does it take for our customers to complete an AD conversion using the 24-bit analog sampling function of msp430afe253? Fixed? How does it calculate? When reading data, a total of 24 bits can only read high 16BIT (sD24LSBACC = 0), then set D24LSBACC to 1, and then read low 16BIT. Is that right?

MSP-EXP432P4111: MSP432P4x1x

$
0
0

Part Number: MSP-EXP432P4111

Hi, we busy with both the EXP-MSP432P401R and EXP-MSP432P4111. We are using them using, as a start, with "oad_firmware_update_MSP_EXP401R(MSP_EXP432P4111).

We noticed that for the MSP-EXP432P401R updating the SAP works, but for the MSP-EXP432P4111 not! Using debug we see that something goes wrong with the CRC32, which is used from ROM. This could just be an indication that something else goes wrong in the first place. Comparison of the code of both projects gives no solution. So now we want to see if there are differences in the bootladers. The question is now, where can we find the source projects for the bootloader? Is it "oad_bootloader_source_MSP_EXP432P401R(4111)_nortos_ccs? For these we use the following basic settings:

- Compiler: TI v18.12.2.LTS
- SimpleLink MSP432P4 SDK: 3.20.0.06
- SimpleLink SDK BLE plugin: 3.2024

We noted several errors here, one of which:


Please advise, do we have the right source projects for the bootloader(s)?

regards,

Laurent

SIMPLELINK-MSP432-SDK: HWI fault in SimpleLink SD driver code.

$
0
0

Part Number: SIMPLELINK-MSP432-SDK

Hi all,

I'm looking for some troubleshooting help.

I'm debugging part of our existing code base, so I am not the person who wrote this code, so I need some insight into an error.

We have an SD Card connected via SPI. 

Running through the code I am able to read and write from multiple files.  I can read and write from a persistent log file.
But In my code I write a 1024 byte array to a measurement file, 0:/LOG/V0000000.TXT, everything works fine.
I then loop through my code again (there are other subroutines and separate tasks that I've commented out.) and rerun my measurement.  Everything seems to happen just fine,
Then I go to remount the SD card, and I get a HWI Exception as seen below.

I assume I have some sort of reference error though I am not sure how to parse the information below.  Using the debugger I've tracked the error to the first time I touch the SD Card after the program loops.  I've verified that I'm not touching the SPI lines, or other GPIO elements, I do make a call to the UART as part of the measurement, (it all works fine) I've tried not unmounting the SD card, and just opening a file, and I get the same error.  Prior to this file write I write to other existing files, and they seem fine (though their file names are constant.) I'm at my wits end with this.  It was working fine, until I updated a different part of the program... (which doesn't touch on the SPI Bus.)

I've run out of ideas for what might  be causing it.  Can anyone shed light on what this error suggests the issue is?

ti.sysbios.family.arm.m3.Hwi: line 1148: E_hardFault: FORCED
ti.sysbios.family.arm.m3.Hwi: line 1225: E_busFault: PRECISERR: Immediate Bus Fault, exact addr known, address: 06050611
Exception occurred in background thread at PC = 0x00011016.
Core 0: Exception occurred in ThreadType_Task.
Task name: {unknown-instance-name}, handle: 0x20009850.
Task stack base: 0x200098a0.
Task stack size: 0x1000.
R0 = 0x06050605  R8  = 0xffffffff
R1 = 0x00000000  R9  = 0x00000000
R2 = 0x00000000  R10 = 0xffffffff
R3 = 0x2000a5d0  R11 = 0xffffffff
R4 = 0x00000000  R12 = 0x20009710
R5 = 0x2000a598  SP(R13) = 0x2000a568
R6 = 0x00000000  LR(R14) = 0x0000258b
R7 = 0x06050605  PC(R15) = 0x00011016
PSR = 0x01000000
ICSR = 0x00418803
MMFSR = 0x00
BFSR = 0x82
UFSR = 0x0000
HFSR = 0x40000000
DFSR = 0x00000001
MMAR = 0x06050611
BFAR = 0x06050611
AFSR = 0x00000000

I've tried looking through documentation, but it hasn't been much help, Anyone who can point me in the right direction for troubleshooting, it would be of great help.

MSP430FR2633: CAPTIVATE-METAL Hardware Design

$
0
0

Part Number: MSP430FR2633

Hello,

I confirmed the metal touch schematic from the CAPTIVATE-METAL Hardware Design Files link below.
The overlay is connected to GND. Is it mandatory to connect to GND?

・CAPTIVATE-METAL
www.tij.co.jp/.../CAPTIVATE-METAL

Best Regards,
DDdoor


MSP430AFE253: SD24 ADC sampleing issue.

$
0
0

Part Number: MSP430AFE253

Hello friend:

when I used msp430afe253 to measure current(50hz,sample 120 points),but result is unstable,looks like adc's switch time isn't fast enough?or some suggestion?thx.

system is looks like following:

1)none extended crystal oscillator is used.(so default:dco is 1M,and aclk = vlo = 12k).

2)SD24_init is as following:(SD24OSR_1024 is better,sampling data is more stable.but when we finished a sample cycle(20ms),it looks like more than 300ms,then these sampling data shouldn't be right.)

3)we set TA timer as 50*120 hz.(as following)

4):TA's ISR  is STARTING sd24 ADC  covert.

5)SD24 ISR is like following:(we just get high 16bit,ignore low 16bit)

so,my question is :

how can i setting/init,then i can sample 120 points in 20ms?(none any extended crystal oscillator).

any errors/understanding is wrong in above code?

MSP430FR2633: About Max Count Error

$
0
0

Part Number: MSP430FR2633

Hello,

  

Regarding to Max Count Error on MSP430FR2633, my customer is asking a question.

They face Max Count Error on their new original touch sensor board.

Their old original touch sensor board is not occurred error.

The different between old board and new board is touch sensor construction only.

(Question)

They will re-configure error threshold as new touch sensor board.

Other, should they re- configure touch threshold?

Or should they re-configure other parameter?

 


 

Regards,

Tao_2199

MSP430F6779A: MSP 430 custom BSL issue

$
0
0

Part Number: MSP430F6779A

Hi,

Iam working on a custom BSL for my project. I have modified the BSL entry condition and interfaces provided in the BSL reference codes. Like my BSL protect function would compare  a word in INFO memory D for  confirming the entry condition. If its success it would read the hex records from an spi flash. After receiving the new application(firmware) my application will set the entry condition in info memory D and initiate a software brown out reset with PMMSWBOR bit in PMMCTL0 register. But unfortunately its not switching to BSL application entry, but if i manually press reset switch its executing properly. Even i tried to create a Security violation (BOR) by writing to bsl area, in that case the controller totally hangs, and even i have to reload the custom BSL.

As my bsl is more than 2k ,i have modified the memory map to bank 3 also for bsl. My main application will reside in bank 0, 1 and 2.

Kindly help

Regards

Sreekanth MK

EVM430-FR6047: EVM430-FR6047

$
0
0

Part Number: EVM430-FR6047

Hi,

We are a startup based in Netherlands. We want to design and develop ultrasonic water meters based on the MSP430FR6047 MCU for the Indian and east european market segment. But we are from embedded firmware background and do not have domain knowledge on water measurement.

So, we want help from you in choosing the right transducers to be used with MSP430FR6047 MCU to measure the speed and amount of water flow.

Also we do not want to cut the pipes. Is it possible to make residential ultrasonic water meters (diameter of pipes are 15mm or 20mm) which can be clamped on top of the pipes without cutting them so that water supply is not interrupted while installation.

We also want advise on where to buy the cheap and reliable transducers which can be connected to the EVM430-FR6047 evaluation board (based on MSP430FR6047 MCU) so that we can start prototyping the ultrasonic water meters and make them and test them quickly.

Looking forward to your help and guidance.

Thanks and Regards,

Sritam Paltasingh.

MSP430F5510: MSP430F5510IZQEA replacement

$
0
0

Part Number: MSP430F5510

Hi!

The MSP430F5510IZQEA is used in one of our EVMs (DRV2625EVM-CT: http://www.ti.com/lit/ug/slou432a/slou432a.pdf#page=14). However, it seems that it has been obsolete at TI website.

Do we have a compatible MSP430 device (pin to pin compatible / and software compatible if possible)? Otherwise, could you suggest a solution that doesn't involve a big schematic/layout modification?

Please let me know if you need additional information for this.

Thank you in advance!

Best regards,
Luis Fernando Rodríguez S.

MSP430-GCC-OPENSOURCE: Where to find MSP430FR2633.cmd in Tools?

$
0
0

Part Number: MSP430-GCC-OPENSOURCE

When compiling code for the MSP using CCS, it uses a msp430fr2633.cmd file, located in the ccs/include folder.  

However, when I download the headers/support files from the GCC open source link, there are no such .cmd files.  Where can I find these *.cmd files without downloading the entire CCS?

TMDSEMU110-U: Keil uVision 5 does not find xds110 debugger

$
0
0

Part Number: TMDSEMU110-U

I am trying to use the XDS110 debugger with teh Keil uVision 5 toolset.  The toolset does not find the XDS110 debugger and issues a No Debug Unit found dialog when I attempt to configure it.  This is using the 32 bit drivers.  When I use the 64 bit drivers it gives me an error that the driver file is not there even though it is (tixds510cortexM.drv).  


CCS/TIDM-BPM: Site support forum

$
0
0

Part Number: TIDM-BPM

Tool/software: Code Composer Studio

Hello,

I have contacted one of your colleagues by email and he suggested me to contact TI's MCU team by posting on E2E, so TI engineers will be more helpful and will give more details about our request.
So basically we are a university called HEPIA based in Geneva (Switzerland) and we are interested in the TIDM-BPM device; We have two questions :

1) First one concerns the debug connection between the MSP430F6638 MCU integrated in the TIDM-BPM device. Is there any connection scheme showing which pins of the MCU should be connected to the 14-conductor cable which comes with the MSP-FET debugger ? I have taken a look on the MSP430 Hardware Tools PDF but we found a lot of informations and we still don't know which MSP430F6638's pin we have to connect to the debug connector of the MSP-FET debugger. Therefore, we really need some help about this point especially since the debug connection are often a source of error.

2) Second question concerns the source code provided for the TIDM-BPM device. We have downloaded the CCS IDE as well as the source code zip file, and we noticed that the most important library which is the "msp430f6638.h" is not provided. Could you please provide this header file ? It will be a big help for us for the program comprehension. Same thing for the SPI header file and ADC header file, because we think that all the libraries are not provided and this is a real issue for us for the program comprehension and if we want to modify the program or write a new one, it will be really difficult for us without all these libraries (header files). 

Thank you very much.

Mike Jaber

HEPIA Geneva, Switzerland.

MSP432P4111: SYSBIOS Clock Function SWI appears to be blocking all lower priority tasks from running

$
0
0

Part Number: MSP432P4111

Hi,

I have a problem with SYSBIOS (SimpleLink 3.2) Clock Functions that I hope you can help me debug.

The discussion here is with respect to this Execution Graph, which is typical of our problem.

On the left of the capture our code is working correctly - a mixture of HWIs, SWIs (including the clock function SWI), Tasks, and a couple of zero latency interrupts (not visible here), are running.

In our system, the clock function SWI runs as the lowest priority SWI, with a tick period of 310uSec, unnecessary ticks suppressed. 

What we are finding is that at some random point in time, the Clock Function SWI starts running all the time, preventing tasks from running, though higher priority SWIs and HWIs continue on.  We have not been able to find a reliable trigger - but happens seconds to many minutes after startup.

This transition from normal operation to blocked-by-clock-SWI operation is visible in the execution graph where the cyan traces start becoming very long.

Also notice all the little green flags in the Semaphore row of the execution graph.  Each of those flags indicates that one particular Semaphore has been posted.   That semaphore is normally posted by a clock function with a 2mSec period, but here we the semaphore being posted about every 50uSec. 

What this feels like is that all of a sudden the tick for the Clock Function SWI has been reduced from 310uSec to something very small so it monopolizes the processor.  Our code does not call Clock_tick() anywhere and I don't think there is a API for changing the duration of a tick after its been set.  ROV (see below) seems to think the tick period is still 310uSec.

Here is data from ROV (which I assume gets its data directly from the live SYSBIOS data structures in the micro) regarding our clock functions (pTask_clockFunc_TriggerTask is the one posting the Semaphore)

Can you help us understand why the Clock Function SWI suddenly, seemingly randomly starts monopolizing the processor?

Thank you for your time

Julian

CCS/TIDM-BPM: Blood pressure filters and pressure sensors

$
0
0

Part Number: TIDM-BPM

Tool/software: Code Composer Studio

Hello,

We are a university based in Geneva (Switzerland) and we are interested in the TIDM-BPM device. We have downloaded the Altium scheme and we noticed something. Usually to determine the blood pressure we need the AC part of the pressure sensor signal. In fact the output signal of the pressure sensor is composed of a DC part which corresponds simply to the pressure in the cuff and an AC part which corresponds to the pressure generated by the blood on the walls of the artery. Thus usually in order to get the DC part of the pressure sensor signal we make a low pass filter and to get the oscillations (AC part) we make a high pass or band pass filter. However in the scheme provided (please find the document attached) there is only a low pass filter. So our question is why there is not a high pass or band pass filter to extract the AC part of the pressure sensor signal (which is the part of the signal that will help us tp get the blood pressure value) and then how you extract it if indeed you don't use a high pass or band pass filter to get it. I hope that it's clear. 

The second question still concerns the same Altium scheme attached. We didn't really understand why you used two pressure sensors : BP300 and MP3V5050. 

Thank you very much.

Best regards,(Please visit the site to view this file)

Mike Jaber, Geneva,Switzerland

CCS/MSP430F5529: I2C Diver library usci_b_i2c.c

$
0
0

Part Number: MSP430F5529

Tool/software: Code Composer Studio

Hi

I use a function from this library to recieve bytes from a slave device.

Here is the original code:

uint8_t USCI_B_I2C_masterReceiveMultiByteFinish (uint16_t baseAddress)
{
    uint8_t receiveData;

    //Send stop condition.
    HWREG8(baseAddress + OFS_UCBxCTL1) |= UCTXSTP;

    //Capture data from receive buffer after setting stop bit due to
    //MSP430 I2C critical timing.
    receiveData = HWREG8(baseAddress + OFS_UCBxRXBUF);

    //Wait for Stop to finish
    while (HWREG8(baseAddress + OFS_UCBxCTL1) & UCTXSTP);

    //Wait for RX buffer
    while (!(HWREG8(baseAddress + OFS_UCBxIFG) & UCRXIFG));

    return receiveData;
}

This code didn't work for my device. However, when I move the data recieve line to the bottom of the code it worked. Am I doing something wrong or is this a bug. My understading is that the processor should recieve the RXIFG interrupt before reading the data not after.

Here is how I modified the code:

uint8_t USCI_B_I2C_masterReceiveMultiByteFinish (uint16_t baseAddress)
{
    uint8_t receiveData;

    //Send stop condition.
    HWREG8(baseAddress + OFS_UCBxCTL1) |= UCTXSTP;

    //Wait for Stop to finish
    while (HWREG8(baseAddress + OFS_UCBxCTL1) & UCTXSTP);

    //Wait for RX buffer
    while (!(HWREG8(baseAddress + OFS_UCBxIFG) & UCRXIFG));

   //Capture data from receive buffer after setting stop bit due to
    //MSP430 I2C critical timing.
    receiveData = HWREG8(baseAddress + OFS_UCBxRXBUF);

    return receiveData;
}

TIDM-02005: Ultrasonic transducer selection.

$
0
0

Part Number: TIDM-02005

Hello,

I am working on a project that requires water flow measurement in metal/plastic pipes and searching for a flow meter solution, I found the "Optimized ultrasonic sensing metrology reference design for water flow measurement" (Part number TIDM-02005) on the TI website.

The evaluation kit fits our application requirements but it comes without the ultrasonic transducers and I am not sure how to select them.

Does anybody have some advice?
Is it possible to use something like this Brass Pipe (http://www.audiowell.com/en/product-detail.aspx?id=80) to test the flow meter?

Thanks and best regards.
Enrico

Viewing all 22077 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>