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

MSP432P401R: GPIO INTERRUPTION: "GPIO_CFG_IN_INT_BOTH_EDGES"

$
0
0

Part Number:MSP432P401R

Hi,

I have configured one input like "GPIO_CFG_IN_INT_BOTH_EDGES" to capture how long is a input pulse (echo from HCSR04).

I have noticed with this configuration only I can detect falling edged but not the rising edge. If I configure line "GPIO_CFG_IN_INT_RISING" my code capture rising edge without problem and if I configure "GPIO_CFG_IN_INT_FALLING" my callback function capture the falling edge. Any clue about this issue?

Best regards,

My callback function code:

void hcsr04IntCallBack(uint_least8_t index){


    //Detect  rising
    if (GPIO_read(Board_GPIO_ECHO)==1){
        queueDebugSendFromISR("[HC-SR04] Echo start ++");
        startTime=xTaskGetTickCountFromISR();

    }
    // Detect failing
    else if (GPIO_read(Board_GPIO_ECHO)==0){
        queueDebugSendFromISR("[HC-SR04] Echo end --");
        GPIO_disableInt(Board_GPIO_ECHO);
        endTime=xTaskGetTickCountFromISR();
        }

    }


MSP430G2553: G2553 Capture Example

$
0
0

Part Number:MSP430G2553

Hi all,

Can someone show me a simple example of using TimerA0_3 in CAP mode? As described in x2xx Family User Guide 12.2.4, I want to do speed computation. I'm not quite sure how to handle the interrupt. 

This is the code I have so far. I want to trigger an interrupt upon CCIS.

//   Use P1.6 output into Capture CCIS TimerA0_3
//            MSP430G2xx3
//         -----------------
//        |                 |-
//        |                 |
//      ->|P1.1/CCI0A       |-
//     |  |                 |
//     |  |             P1.6|--
//     |                       |
//     |_______________________|
//

//******************************************************************************

#include <msp430.h>
volatile int count;
int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
  TA0CTL = TASSEL_2 + MC_2 + TACLR;			// SMCLK, Up mode
  TACCTL0 = CAP + CM_1 + CCIE;				// CAP, Int. Enabled
  P1SEL |= BIT1;              				// TA0.CCI0A
  P1DIR |= BIT6;							// pulse gen. into CCIS
  __bis_SR_register(GIE);

  while(1){
		  P1OUT ^= BIT6;					// see how many cycles TAR incremented
  }
}


// Timer_A3 Interrupt Vector (TA0IV) handler
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=TIMER0_A1_VECTOR
__interrupt void Timer_A(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMER0_A1_VECTOR))) Timer_A (void)
#else
#error Compiler not supported!
#endif
{
 switch( TA0IV )
 {
   case  2:
	   count++;
	   break;                          // 
   case  4: break;                         // CCR2 not used
   case 10:                                // not used
            break;
 }
}

thank you,

Scott

MSP432P401R: 32-Bit DMA over SPI

$
0
0

Part Number:MSP432P401R

My goal is to achieve an I2S-compatible PCM-audio transfer using SPI and an external Codec (Maxim 9867). Main concept is:

  • Short audio sample is located in memory
  • Have a timer providing the frame sync signal
  • Use SPI to feed the digital audio interface
  • Configure DMA with timer as trigger to transfer 4 bytes:
    • 2 bytes (16 bits) left channel
    • 2 bytes for right channel (according to I2S specification)

Hence I setup TIMER_A3 with period of 543 ticks according to audio sampling frequency of 44.1 kHz. This does produce a proper frame sync signal visible in logic analyzer. The SPI on EUSCI_B1_BASE is configured properly (we will see later). So far so good...

Then I use the TIMER_A3_CCR0 as trigger for DMA_CH6 which leads to the following source code for DMA:

#define MAXIM_PLAY_DMA_CHANNEL         DMA_CH6_TIMERA3CCR0
#define MAXIM_PLAY_DMA_CH_NUMBER       DMA_CHANNEL_6
#define AUDIO_BUFFER_SIZE				0x10

#define DMA_ARBITRATION_VALUE   UDMA_ARB_2

volatile uint8_t audioBuffer[2 * AUDIO_BUFFER_SIZE];

/* Later audioBuffer will be parameter of this function */
void maximPlayDMAinit(volatile uint8_t * pData)
{
   MAP_DMA_disableChannel(MAXIM_PLAY_DMA_CH_NUMBER);
   MAP_DMA_assignChannel(MAXIM_PLAY_DMA_CHANNEL);
   MAP_DMA_disableChannelAttribute(MAXIM_PLAY_DMA_CHANNEL
                                   , UDMA_ATTR_ALTSELECT | UDMA_ATTR_USEBURST | UDMA_ATTR_HIGH_PRIORITY | UDMA_ATTR_REQMASK
                                   );
   MAP_DMA_setChannelControl(MAXIM_PLAY_DMA_CHANNEL | UDMA_PRI_SELECT
                         , UDMA_SIZE_8 | UDMA_SRC_INC_8 | UDMA_DST_INC_NONE | DMA_ARBITRATION_VALUE
                         );
   MAP_DMA_setChannelControl(MAXIM_PLAY_DMA_CHANNEL | UDMA_ALT_SELECT
                         , UDMA_SIZE_8 | UDMA_SRC_INC_8 | UDMA_DST_INC_NONE | DMA_ARBITRATION_VALUE
                         );
   MAP_DMA_setChannelTransfer(MAXIM_PLAY_DMA_CHANNEL | UDMA_PRI_SELECT
                         , UDMA_MODE_PINGPONG
                         , (void *)pData
                         , (void *)MAP_SPI_getTransmitBufferAddressForDMA(mSPIbase)
                         , AUDIO_BUFFER_SIZE
                         );
   MAP_DMA_setChannelTransfer(MAXIM_PLAY_DMA_CHANNEL | UDMA_ALT_SELECT
                         , UDMA_MODE_PINGPONG
                         , (void *)(pData + AUDIO_BUFFER_SIZE)
                         , (void *)MAP_SPI_getTransmitBufferAddressForDMA(mSPIbase)
                         , AUDIO_BUFFER_SIZE
                         );
   MAP_DMA_clearInterruptFlag(MAXIM_PLAY_DMA_CH_NUMBER);
}

void maximStartPlayDMA()
{
   MAP_DMA_clearInterruptFlag(mPlayDMAconfig.channelNumber);
   MAP_DMA_assignInterrupt(DMA_INT1, mPlayDMAconfig.channelNumber);
   MAP_DMA_enableChannel(mPlayDMAconfig.channelNumber);
   MAP_Interrupt_enableInterrupt(INT_DMA_INT1);
   MAP_DMA_enableInterrupt(DMA_INT1);
}

void dma_1_interrupt(void)
{
   uint32_t ui32Mode = MAP_DMA_getChannelMode( MAXIM_PLAY_DMA_CHANNEL | UDMA_PRI_SELECT);
   if (ui32Mode == UDMA_MODE_STOP)
   {
      /* Ping Pong Primary */
      fill_buf(audioBuffer);
      MAP_DMA_setChannelTransfer(MAXIM_PLAY_DMA_CHANNEL | UDMA_PRI_SELECT
                         , UDMA_MODE_PINGPONG
                         , (void *)pData
                         , (void *)MAP_SPI_getTransmitBufferAddressForDMA(mSPIbase)
                         , AUDIO_BUFFER_SIZE
                         );
   }
   ui32Mode = MAP_DMA_getChannelMode( MAXIM_PLAY_DMA_CHANNEL | UDMA_ALT_SELECT);
   if (ui32Mode == UDMA_MODE_STOP)
   {
      /* Ping Pong Secondary */
      fill_buf(audioBuffer + AUDIO_BUFFER_SIZE);
      MAP_DMA_setChannelTransfer(MAXIM_PLAY_DMA_CHANNEL | UDMA_ALT_SELECT
                         , UDMA_MODE_PINGPONG
                         , (void *)(pData + AUDIO_BUFFER_SIZE)
                         , (void *)MAP_SPI_getTransmitBufferAddressForDMA(mSPIbase)
                         , AUDIO_BUFFER_SIZE
                         );
} }

When I give it a try I can see the audio samples in logic analyzer in right order, but there are only 2 Bytes being transfered upon each trigger from frame sync signal: (please disregard the last 8 not matching bits in decoded data as a configuration issue - the signals are the same, obviously):

Of course, you might say, I simply need to change the define to UDMA_ARB_4. But this is where the real odds (and major topic of this post) are coming up: still only 16 bits are being transferred, but the 16 bits from right channel have vanished!

And this is something I neither understand nor having a clue how to resolve it.

MSP-EXP432E401Y: OTG/HID Support

$
0
0

Part Number:MSP-EXP432E401Y

I'd like to ask if the development board MSP-EXP432E401Y has any application note / library / SDK for HID development?

I'm interested in creating mouse/keyboard events using this module.

Thank you!

MSP432E401Y: TI Pinmux Tool : Can't assign Ethernet pins with pinmux tool

$
0
0

Part Number:MSP432E401Y

Hi Team,

I can't assign ethernet pins of MSP432E401Y when I using TI pinmux tool.

I think it's kind of a bug. Could you check this?

Regards,

Ted

MSP430F6779: It's easy to reset when EFT & ESD testing

$
0
0

Part Number:MSP430F6779

Hi! 

I use the MSP430F6779 in the three phase electric meter project, it's used in the the industrial application,such as switch cubicle, power distribution room.

The RS485 is SN65LBC184.

When the 4KV EFT test,  HBM 8KV ESD test, air 15KV ESD test, the MSP430F6779 is easy to reset. Why?? How  to improve it ? 

I heard that the ST's strong anti-jamming capability, can pass the EMC, EFT, ESD, Surge test. the P/N is STM32F103, STM32F407, STM32F7--.

TRF796X_TRF7970X_MIFARE_12_2013: TRF7970A

$
0
0

Part Number: TRF796X_TRF7970X_MIFARE_12_2013

We are using TRF7970 for RFID reader (13.56Mhz) and Cypress CY8CMBR3116-LQXIT for touch pad.

1. We are using 12 button touch keypad.

2. It works fine when RFID reader is disabled but when we enabled the RFID reader to detect the card we are getting false interrupt of button pressed from cypress.

I don't know why we are getting false interrupt of button pressed when we enabled RFID reader.

On more observation, when we enabled the RFID after getting proxy event RFID reader not able to read the card as it works fine before.

I don't understand why they are disturb each other.

RFID reader used for ISO14443A/B and ISO15693 card.

CCS/MSP430FR2311: GPIO Interrupt P1 & P2

$
0
0

Part Number:MSP430FR2311

Tool/software: Code Composer Studio

I'm trying to use either pin 2.7 to read the low/high edge and toggle the flag variable and the Interrupt pin.

But I think using P2.7 and P1.4 both to set the flag according to what state it is in (they will always be in opposite states) is the best way. 

However, the interrupt pin works on P2.7 but it doesn't change on P1.4 and enter the interrupt service routine. I have it using LPM2 because I read on e2e that you have to save it in the backup memory so I was trying to avoid that by using LPM2.  (https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/635091?CCS-MSP430FR2311-Is-it-possible-to-use-GPIO-interrupts-in-LPM3-5-

#include <msp430.h>
#include <stdio.h>

void Init_GPIO(void){

WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P1DIR = 0xFF; P2DIR = 0xFF;
P1REN = 0xFF; P2REN = 0xFF;
P1OUT = 0x00; P2OUT = 0x00;

// Interrupt Pin 2.7 Wake-up Pin from the XBee
P2OUT &= ~BIT7; // Configure P2.7 as pulled-down
P2REN |= BIT7; // P2.7 pull-down register enable
P2IES &= ~BIT7; // P2.7 Low/High edge
P2IE |= BIT7; // P2.7 interrupt enabled

// Interrupt Pin 1.4 CTS Pin from the XBee
P1OUT &= ~BIT4; // Configure P1.4 as pulled-down
P1REN |= BIT4; // P1.4 pull-down register enable
P1IES &= ~BIT4; // P1.4 Low/High edge
P1IE |= BIT4; // P1.4 interrupt enabled


PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
// to activate previously configured port settings

}


int flag =0;

int main()
{
Init_GPIO();

i

P2IFG &= ~BIT7; // P2.7 IFG cleared
P1IFG &= ~BIT4; // P1.4 IFG cleared
while (1){

while (flag==0){ // when CTS (p1.4) is high go into low power mode
__bis_SR_register(LPM2_bits | GIE); // Global interrupts Enable
__no_operation();

}

while(flag==1){ // While Xbee module is ON; (P2.7 is high)
P2OUT |=BIT6; // Turn on High switch P2.6
__delay_cycles(10); // settling time for switch

P2OUT &=~BIT6; // Turn off High side switch (move to flag ==0?)
//P2IFG &= ~BIT7; // P2.7 IFG cleared
}
}
}

__bic_SR_register_on_exit(LPM2_bits); // Exit LPM3
break;
default:
break;
}
}
// Port 2 interrupt service routine -- P2.7 to check if Zigbee is ON
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=PORT2_VECTOR
__interrupt void Port_2(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(PORT2_VECTOR))) Port_2 (void)
#else
#error Compiler not supported!
#endif
{
P2IFG &= ~BIT7; // Clear P2.7 IFG
flag = 1;
__bic_SR_register_on_exit(LPM2_bits); //GIE
}
// Port 1 interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(PORT1_VECTOR))) Port_1 (void)
#else
#error Compiler not supported!
#endif
{
P1IFG &= ~BIT4; // Clear P1.4 IFG
flag =0;
__bic_SR_register_on_exit(LPM2_bits); // Exit LPM3

}


MSP430F5510: The fail of installation of MSP430 USB Firmware Upgrade

$
0
0

Part Number:MSP430F5510

Hello,

My customer is trying to install MSP430 USB Firmware Upgrade which is available from the following. (MSP430_USB_Firmware_Upgrade_Example-1.3.1.1-Setup.exe)
software-dl.ti.com/.../index_FDS.html
However, they failed installation because of Microsoft Visual C++ Runtime Error.
(Error message is none.)

Do you have any experience like this?
Could you give me the advices about this behavior?

Best Regards,
Nomo

MSP430F67791: SPI not working.

$
0
0

Part Number:MSP430F67791

Hi everyone,

          Now i have MSP430F67791 interface the W25q64 winbond chip.But communication is not working.what happened?

This is my following code details,

interface pin details for your reference,

SCLK  P3.3   SCK 
SOMI  P3.4    DO
SIMO  P3.5    DI
CS      P3.6    CS

void spi_init(void)
{
UCA1CTL1 = UCSWRST;

P3OUT &= ~BIT6;                      // Clear P1.0
P3DIR |= BIT6;                           // Set P1.0 to output direction
P3SEL0 = BIT3| BIT4 | BIT5 ;    // Set P3.0,P3.1,P3.2 to non-IO


UCA1CTL0 |= UCCKPH + UCMSB + UCMST + UCSYNC; 
UCA1CTL1 |= UCSSEL_2; // SMCLK

UCA1BR0 |= 0x02;
UCA1BR1 = 0x00;
UCA1MCTLW = 0;


UCA1CTL1 &= ~UCSWRST;

}

void spi_chipHigh(void)
{
P3OUT |= CS;
}

void spi_chipLow(void)
{
P3OUT &= ~CS;
}

int datacount=0;

unsigned char data=0;

unsigned char GCu_Tx_Data[10];
unsigned char GCu_Recieved_Data[10];

uint8_t sFLASH_SendByte(unsigned char *uData,unsigned char count)
{
while(!(UCA1IFG &= UCTXIFG));

for(datacount=0;datacount<count;datacount++)

UCA1TXBUF = uData[datacount];


while (!(UCA1IFG & UCRXIFG));

uData[0] = UCA1RXBUF;

return *uData;

}

unsigned char Read_SingleBytes(unsigned int LIu_Flash_Add){
unsigned char LCu_Read_Data=0;
spi_chipLow(); 
GCu_Tx_Data[0] = 0x03;                                           //read 
GCu_Tx_Data[1] = (LIu_Flash_Add >> 16) & 0xFF;
GCu_Tx_Data[2] = (LIu_Flash_Add >> 8) & 0xFF;
GCu_Tx_Data[3] = (LIu_Flash_Add >> 0) & 0xFF; 
LCu_Read_Data=sFLASH_SendByte(&GCu_Tx_Data[0],4);
spi_chipHigh();

return(LCu_Read_Data);
}

while(1)

{

Read_SingleBytes(0x000000);

}

If any coding issue pls tell me the exact reason and how to work properly guide me as soon as possible.Pls check the SPI init function this init register deatils are correct or not.And also check the whole program details and guide me the issue as soon as possible.

CCS/MSP432P401R: Is it possible to do PWM in Burst mode?

$
0
0

Part Number:MSP432P401R

Tool/software: Code Composer Studio

Hi i want to use the MSP432 PWM in burst mode, is this possible?

If not, is there any IC from TI that can make me a Square Wave in Burst mode?

I need to set the amount of square in Burst and the distance time from one to the other.

MSP430FR5869: MSP430 reset in bsl

$
0
0

Part Number:MSP430FR5869

Hi,

I meet a issue when burning msp430 firmware.

After I set bsl entry sequence at rst and test pin, msp430 can enter bsl mode.

But I found if I do not do any operations after that for about 1 second, msp430 will look like reset.

Is there any timer or watchdog enabled when in bsl mode?

Thanks

Pan Zhenjie

CCS/MSP430F249: uart0 + uart1

$
0
0

Part Number:MSP430F249

Tool/software: Code Composer Studio

Hii,

I'm working on the uart for the f249 board, I need to receive in UCA0 pin 3.5 and transmit in UCA1 pin 3.6, how can i do that ? I'm trying to change the settings but each one of them has its own settings and it didn't work to but'em together

any advice ??

I took the settings from the TI uart examples, my board isn't working on UCA0, don't know what it's problem !

TI examples :

dev.ti.com/.../

thank you 

MSP430FR2433: the MCU workable only by Vdd 1.89V above

$
0
0

Part Number:MSP430FR2433

hi,

I'm using MSP-EXP430FR2433 to develop my FW, i found the system is not working if the Vdd is under 1.89V( I measure the Vdd PIN directly)

My MCLK is 1MHz, i try the 9600 baud UART, it only work after the Vdd is above 1.89V, my goal is using 1.80V Vdd,

is there anything wrong with my code:

below is my code:

intmain(void)

{

  WDTCTL = WDTPW | WDTHOLD;                // Stop watchdog timer

 

 

  // Configure GPIO

  Init_GPIO();

  Init_UART();

  __bis_SR_register(GIE);

 

  while (1)

  {

      xprintf("UART test\r\n");

  }

}

 

 

voidInit_GPIO(void)

{

 

    // Configure UART pins

    P1SEL0 |= BIT4 | BIT5;                    // set 2-UART pin as second function

    //P1.0 P1.1 P1.2 RGB LED output

    P1DIR = 0x77;           // 0:input 1:output  =>P1.7 input UART CTS

    P1REN = BIT5| BIT7;           // pull-up register enable

    P1OUT = 0x00 | BIT5| BIT7;  // P1.5 P1.7 pulled-up //Input Configure 0b =pulled-dn , 1b = pulled-up //Output configure: 0b = Output is low.1b = Output is high.

    P1IES |= BIT7;   // P1.7 High to Low edge

    P1IE |= BIT7;    // P1.3 interrupt enabled

 

    P2DIR = 0xF7;           // 0:input 1:output  =>P2.3 input (Button)

    P2REN = BIT3;           // pull-up register enable

    P2OUT = 0x00| BIT3;     //P2.3  pulled-up

    P2IES |= BIT3 ;         // P2.3 High to Low edge

    P2IE |= BIT3 ;          // P2.3 interrupt enabled

 

    P3DIR = 0xFF;

    P3REN = 0x00;

    P3OUT = 0x00;

 

    PM5CTL0 &= ~LOCKLPM5;                    // Disable the GPIO power-on default high-impedance mode

    P2IFG &= ~BIT3;                         // Clear P2.3 IFG //Button

    P1IFG &= ~BIT7;                         // Clear P1.7 IFG //CTS

}

 

voidInit_UART(void)

{

    // Configure UART

     UCA0CTLW0 |= UCSWRST;                     // Put eUSCI in reset

     UCA0CTLW0 |= UCSSEL__SMCLK;

 

     //(See Table 21-5 in UG)

     //115200 baud-rate

     //BRCLK       Baud Rate     UCOS16  UCBRx   UCBRFx   UCBRSx

     //1000000     115200           0       8       –       0xD6

     //1. Calculate N = fBRCLK/Baud Rate [if N > 16 continue with step 3, otherwise with step 2]

     //2. OS16 = 0, UCBRx = INT(N) [continue with step 4]

     //3. OS16 = 1, UCBRx = INT(N/16), UCBRFx = INT([(N/16) – INT(N/16)] × 16)

     //4. UCBRSx can be found by looking up the fractional part of N ( = N - INT(N) ) in Table 21-4

 

     //UCAxMCTLW => Bit15-8 UCBRSx , Bit7-4 UCBRFx , Bit3-1 Reserved , Bit0 UCOS16

#if 0//1 // 115200 baud-rate TX Error= -7.36 ~ 5.6 % ; RX Error = -17.04 ~ 6.96 %

     // Baud Rate calculation

     UCA0BR0 = 8;                              // 1000000/115200 = 8.68

     UCA0BR1 = 0;

     UCA0MCTLW = 0xD600;                       // 1000000/115200 - INT(1000000/115200)=0.68

                                               // UCBRSx value = 0xD6 (See UG)

 

#else // 9600 baud-rate TX Error = -0.48 ~ 0.64% ; RX Error = -1.04 ~ 1.04%

 

     //BRCLK       Baud Rate     UCOS16  UCBRx   UCBRFx   UCBRSx

     //1000000  9600                1       6       8       0x20

     //UCAxMCTLW => Bit15-8 UCBRSx , Bit7-4 UCBRFx , Bit3-1 Reserved , Bit0 UCOS16

     UCA0BR0 = 6;

     UCA0BR1 = 0;

     UCA0MCTLW = 0x2081;

#endif //baud-rate setting end

 

     UCA0CTLW0 &= ~UCSWRST;                    // Initialize eUSCI

     UCA0IE |= UCRXIE;                         // Enable USCI_A0 RX interrupt

 

}

MSP430FR2311: Interacting ADS122C04 (ADC 24 - Bit) using I2C

$
0
0

Part Number:MSP430FR2311

Hello All,

I'm trying to interface ADS122C04 24-bit ADC with MSP430FR2311

I have written following algorithm:

1. Send Reset Command (0x10)

2. Write Configuration Register

a. Register 0 (0x40) = 0x81;

b. Register 1 (0x44) = 0x00;

c. Register 2 (0x48) = 0x00;

d. Regoster 3 (0x4C) = 0x00;

//Here I'm using Single  short conversation mode and Single channel Read Mode

3. Send Start Command (0x08);

4.loop

{

Wait for DRDY Pin to transition low;

send Read Command (0x10);

{

The Above algorithm I have a implemented and I'm unable to receive the data from ADC.

Please be needful.

Regards,

Kelvin


CCS/MSP-CAPT-FR2633: Configure CapTivate board to read mutual capacitance

$
0
0

Part Number:MSP-CAPT-FR2633

Tool/software: Code Composer Studio

Hi, 

I need help to configure this board to read mutual capacitance between two copper electrodes. I need to get the raw value to change a display based on that. Please advice which tutorial to follow.

Problems associated with USS Design Center

$
0
0

Hello!

I have the EVM430FR6047 board, the flowmeter and  the installed USS Design center  USS 1.70.01.01.

Yesterday everything worked normally, but today the unknown generic error occurs.

When I connect to the device, LED3 is red and there is no signal from transducers. But, if I debug in the Code Composer, and then connect to the device through the USS design center there appears the error "No signal detected in up and downstream channel, Algorithm". Than I plot the ADC capture- there appear several measurements (TOF), sometimes the generic error appears after pressing the button (capture ACD). Sometimes when I try to change the configuration the generic error appears at the same time - the graphs are not plotted and LED3 is still red.

I tryed to reset the board, to reinstall the drivers and so on - it did not help.

Should I reinstall the USS Design center?

Should I press stop (wavefroms) when I change the configuration?

And one more question, please give me the details on the parameter Ups and Dns gap. Is it a time between ups transducer signal capture and the corresponding dns transducer signal capture? I tryed to see this parameter on the oscilloscope, but I could not. When I specified this parameter as 100 us I've seen 740 us on the oscilloscope. 

Best regards,

Catherin

p.s. The configuration file is enclosed.(Please visit the site to view this file)

CCS/MSP430F249: uart0 example not working

$
0
0

Part Number:MSP430F249

Tool/software: Code Composer Studio

Hello,

I tried this uart uca0 code from the Ti examples and it won't work I don't know why!! the uca1 worked, but I need to work on uca0

the code I tried:

#include <msp430.h>

int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR = 0xFF; // All P1.x outputs
P1OUT = 0; // All P1.x reset
P2DIR = 0xFF; // All P2.x outputs
P2OUT = 0; // All P2.x reset
P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD
P3DIR = 0xFF; // All P3.x outputs
P3OUT = 0; // All P3.x reset
P4DIR = 0xFF; // All P4.x outputs
P4OUT = 0; // All P4.x reset
P5DIR = 0xFF; // All P5.x outputs
P5OUT = 0; // All P5.x reset
P6DIR = 0xFF; // All P6.x outputs
P6OUT = 0; // All P6.x reset

UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
UCA0BR0 = 0x03; // 32kHz/9600 = 3.41
UCA0BR1 = 0x00; //
UCA0MCTL = UCBRS1 + UCBRS0; // Modulation UCBRSx = 3
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt

__bis_SR_register(LPM3_bits + GIE); // Enter LPM3, interrupts enabled
}

// Echo back RXed character, confirm TX buffer is ready first
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCIAB0RX_VECTOR))) USCI0RX_ISR (void)
#else
#error Compiler not supported!
#endif
{
while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF = UCA0RXBUF; // TX -> RXed character
}

thanks alot

MSP430 FR4133

$
0
0

Hi,

I recently been having trouble with one of the TI examples for the MSP430FR4133. I am trying to use the ADC to sample voltage on separate pins. As in trying to use the ADC to sample on p1.3 and p1.4 one after another.

When doing this it either only samples the first port or not at all. I have attached my code in the hope someone may have an idea of what is going wrong with it. 

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

int  ADC_Result;
int flag;
int senso;
int sensor[2];

int main(void)
{
    WDTCTL = WDTPW | WDTHOLD;                             
    
    ADCCTL0 |= ADCSHT_2 | ADCON;                                  
    ADCCTL1 |= ADCSHP| ADCCONSEQ_1;                                          
    ADCCTL2 |= ADCRES;                                            
    ADCMCTL0 |= ADCSREF_1;                           
    ADCIE |=ADCIE0;                                              

    PM5CTL0 &= ~LOCKLPM5;

    PMMCTL0_H = PMMPW_H;                                         
    PMMCTL2 |= INTREFEN;                              
    __delay_cycles(400);                                          
  

    flag =0;
    
     
  
    while(1)
    {
     
 
      if(flag ==0){
      ADC_disableConversions(ADC_BASE,ADC_COMPLETECONVERSION);
      ADCIV = ADCIV_NONE;
      ADCMCTL0 |=  ADCINCH_3;
      __delay_cycles(1000);
         
        flag=1;
         
      }
      
      else if(flag ==1)
      {
       ADC_disableConversions(ADC_BASE,ADC_COMPLETECONVERSION);
       ADCIV = ADCIV_NONE;
       ADCMCTL0 |=  ADCINCH_4; 
       __delay_cycles(1000);
          
       flag=0;
       
      }
     
     
        ADCCTL0 |= ADCENC | ADCSC;
         __bis_SR_register(LPM0_bits | GIE);  
        
   
         }   
      
}
    
#pragma vector=ADC_VECTOR           /
__interrupt void ADC_ISR(void)
{
  switch(__even_in_range(ADCIV,ADCIV_ADCIFG))
  {
    // ADCIV = ADC interrupt vector register used to determine
    // which enabled ADC interrupt source requested an interrupt
    case ADCIV_ADCIFG:              // set when conversion complete ADC Interrupt flag register
      {
                                    // ADCIFG0 is automatically reset by reading the
                                    // ADCMEM0 register or may be reset with software.
  
      
      if(flag==0)
      {
         sensor[0]=ADCMEM0;
         
      }
         
         else if(flag==1)
         {
         sensor[1]=ADCMEM0; 
       
         }
         __bic_SR_register_on_exit(LPM0_bits);
         
       
  }
       


    break;
  }
  
}

Any help will be appreciated.

Thank you

MSP430F67791: How to Read and write Multiple Bytes from UCA1RXBUF and UCA1TXBUF

$
0
0

Part Number:MSP430F67791

Hi Everyone,

                Now i have MSP430F67791 interface with W25Q64FV winbond flash memory.Now i have read data from memory 10 bytes.

But Now i have read only one byte using this UCA1RXBUF.How to read 10 bytes from memory using this register UCA1RXBUF.

Pls give me some example for this issue.

Viewing all 22184 articles
Browse latest View live


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