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

MSP432P401R: outputing a signal from a microphone through a speaker

$
0
0

Part Number:MSP432P401R

Hello, I'm new to programming the MSP432 and I have problems with my code. What I want to achieve is getting audio from my microphone electret (Adafruit MAX9814), sample the signal at 44.1 kHz (the signal would be converted from analog coming from the microphone to digital), convert that digital signal back to analog and output it to a speaker so I can listen to the sound. I'm not hearing anything but static so far. Can I get guidance? I'll leave my code below.

#include "msp.h"
#include <stdint.h>

void main(void)
{
	WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;		// stop watchdog timer

	//GPIO Setup
	P4->DIR &= ~(BIT7);// Analog input channel A6
	P4->SEL0 |= BIT7;  // Enable A/D channel A6
	P4->SEL1 |= BIT7;  // P4.7 - analog input

	P5->DIR |= BIT4;  // Output to speaker
	P5->SEL0 |= BIT4;

	//while(PCM->CTL1 & PCM_CTL1_PMR_BUSY);
	//PCM->CTL0 = PCM_CTL0_KEY_VAL | PCM_CTL0_AMR__AM_LDO_VCORE1;
	//while(PCM->CTL1 & PCM_CTL1_PMR_BUSY);

	//Set clock to 24 MHz using DCO
	CS->KEY  = CS_KEY_VAL; //Unlock CS registers
	CS->CTL0 = CS_CTL0_DCOEN | CS_CTL0_DCORSEL_4; //Choose 24 MHz clock speed
	CS->CTL1 = CS_CTL1_SELS_3 | CS_CTL1_SELM_3  ; //Use DCOCLK as source for MCLK, SMCLK + HSMCLK
	CS->KEY  = 0; //Re-lock CS registers

	// ADC14 Setup
	ADC14->CTL0 &= ~ADC14_CTL0_ENC; // Reset ENC bit for configuration

	ADC14->CTL0 = ADC14_CTL0_PDIV_1   | // Pre-divide clock by 4
	              ADC14_CTL0_SHS_1    | // Timer A0 trigger
	              ADC14_CTL0_SHP      | // Pulse mode
	              ADC14_CTL0_DIV_5    | // divide clock by 6
	              ADC14_CTL0_SSEL_3   | // ADC clock source is MCLK
	              ADC14_CTL0_CONSEQ_2 | // Repeat-single channel
	              ADC14_CTL0_SHT0_2   | // Sampling length of 16 ADC clock cycles
	              ADC14_CTL0_ON;        // ADC module on

	ADC14->CTL1 = ADC14_CTL1_RES_3; // 14-bit resolution

	ADC14->MCTL[0] = ADC14_MCTLN_INCH_6; // ref+ = AVcc, channel = A1

	// Timer_A0 Setup
	TIMER_A0->CCTL[0] = TIMER_A_CCTLN_CCIE;         //Enable CC interrupt

	TIMER_A0->CTL = TIMER_A_CTL_TASSEL_2 | // SMCLK as source for timer
	                TIMER_A_CTL_ID_1     | // Divide clock by 2 -> 48 MHz / 2 = 24 MHz
	                TIMER_A_CTL_MC_1     | // Up mode
	                TIMER_A_CTL_CLR      | // Clear timer count
	                TIMER_A_CTL_IE;        // Enable overflow interrupt

	TIMER_A0->CCR[0] = 544;    // 24 MHz / 44.1 kHz = 544
	// T = (TAxCCR0+1) / f_clk = (544+1) / 24 MHz = 2.27x10^(-5)
	TIMER_A0->CCTL[1] = TIMER_A_CCTLN_OUTMOD_7; // Set/Reset for trigger halfway through the cycle

	// Enable global interrupt
	__enable_irq();

    NVIC->ISER[0] = 1 << ((ADC14_IRQn) & 31); // Enable ADC interrupt in NVIC module

    // Wake up on exit from ISR
    SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk;

    // Ensures SLEEPONEXIT takes effect immediately
    __DSB();

	while(1)
	{
	    ADC14->CTL0 |= ADC14_CTL0_ENC | ADC14_CTL0_SC;   // Start conversion-software trigger

	    __sleep();
	    __no_operation(); // For debugger
	}
}

void ADC14_IRQHandler(void)
{
    while((ADC14->IFGR0 & ADC14_IFGR0_IFG6) == 0);  // waiting for conversion to be done
    //audio = ADC14->MEM[0]; // Conversion stored in audio variable.
    P5->DIR ^= BIT4;
}

//void TA0_A0_IRQHandler(void)
//{
//    TIMER_A0->CCTL[0] &= ~TIMER_A_CCTLN_CCIFG;
//}


CCS/MSP430FR5959: DMA demo code for UART

$
0
0

Part Number:MSP430FR5959

Tool/software: Code Composer Studio

We are using msp430fr5959 controller ,

In this we required to transmit or receive large data over both UART continuously so it is possible to read and write UART data through DMA controller. My requirement is to transmit and receive UART data without CPU intervention so that I can able to increase CPU through put and CPU gets more time to execute another routines . So conceptually is it true?

And please provide DMA sample code with UART (transmit and receive ) for msp430fr5959 controller.

MSP430FR2633: Captivate Touch PCBA EMI emission test fail

$
0
0

Part Number:MSP430FR2633

hi,

we use the MSP430FR2633 to develop the touch function, the PCBA only has MSP430FR2633 and an LDO, which is a aerospace product. The EMI test is fail @ 16MHz and 13.56MHz, .

these 2 frequency seems like MCU's internal DCO and Captivate scanning frequency,

Does TI has any suggestion to improve it?

Compiler/MSP430FR2311: The upgrade problem of MSP430FR2311

$
0
0

Part Number:MSP430FR2311

Tool/software: TI C/C++ Compiler

dear sir

      l use ti MSP430FR2311 in my robot application    I press the button and the program enters BSL. If I upgrade the program immediately, it will be successful.But if after entering BSL for a while, about ten seconds,

it  can't soft upgrade  again, what`s the reason of the problem ,how can l solve this problem ?

.

MSP432P401R: DAC Converter

$
0
0

Part Number:MSP432P401R

Hi,

I am working on MSP432P401R and DAC161S055EVM. As per some given guidlines here by senior memebers, I am able to set up SPI communication between MSP432 and DAC161s055. As given Timing diagram in script, I am getting perfect waveforms but I am facing a very strange issue at this moments.

According to DAC161 data sheet (page 7)  and MSp technical reference manual (page 940), waveforms of MOSI and SOMI should have shape (symmetry) when CS and CLK are runing and I have attached the reference image below from data sheet of DAC.

My problem is that , In my case when I was checking the waveforms for SCLK, CS, MOSI and SIMO. In the presence of SCLK (if I am attaching measurement probe to CLK pin), MOSI and SOMI waveforms are not symmetrical any more. MOSI has perfect diagram but SOMI has different shape and then DAC output remain at zero (idle position).

But when I do not measure the SCLK then the SOMI and MOSI have symmetrical shape and DAC analog output updates also as according to given digital input. (How I observed this CLK issue ,just accidently removed SCLK probe and I figured out this observation ).

I think, I have problem somewhere with the clock frequency of SPI protocol because I am providing SMCLK to SPI configuration protocol and it has 24 MHZ but bit clock generator of SPI can have maximum 20M Hz frequncy.
As per given SPI protocol information(block diagram 935 and page939 ) , bit clock frequency can be calculated but I am not understanding where should I apply this bit clock frequency and how pre divder will have impact to reduce SMCLK frequency.

Please help me out from this issue.

Many thanks for your kind help and for every sugesstion.

MSP-FET: Difference between MSP-FET430UIF and MSP-FET

$
0
0

Part Number:MSP-FET

MSP-FET intentionally cut off VCC_TOOL when it sees some VCC_TARGET because it thinks the target has its own power.

Doesn't the same happen with  MSP-FET430UIF as well ?

MSP-TS430RGC64C: Is a diode connected to the JTAG circuit necessary?

$
0
0

Part Number:MSP-TS430RGC64C

Hello.

In the circuit diagram of the MSP-TS430RGC64C, several diodes are connected to the JTAG pin.

What kind of intention do you connect diodes?
Is it okay to omit the diode?

regards,

U-SK

BOOSTXL-CAPKEYPAD: Changing the proximity range (threshold)

$
0
0

Part Number:BOOSTXL-CAPKEYPAD

Team,

I’m having is adjusting the proximity threshold. Changing the value in the below window doesn’t seem to do anything. Is there anything else I need to change to increase or decrease the proximity range?

Thanks.


CCS/MSP430G2553: Need help utilizing a .exe file that maps microcontroller signals from MSP430.

$
0
0

Part Number:MSP430G2553

Tool/software: Code Composer Studio

Hello, I am using a .exe file to map microcontroller signals from my MSP430.  At the moment, I am unable to establish proper communications with the MSP board.  I am using a Bluetooth device from SparkFun and a AD8232.  I really need help understanding why I cannot map signals from my MSP430.  I am using the following protocol:

1.) I establish Bluetooth connection with the COM port (For me, this is COM port 5).  I establish AD8232's signal.  

2.) AD8232's output is being sent to P1.0.  MSP430's 1.1 pin and 1.2 pin's are connected to the SparkFun Bluetooth device's RX and TX pins.  

3.) I run the program in Code Composer and start the .exe file that should pick up the signals.  However, it does not.  

I have no clue what to do, and I really need help.  If anyone can help me out, I would be grateful.  Attached is the bare minimum of the program that should work and the .exe file that should be picking up signals.  Thank you.  

Code:

(Please visit the site to view this file)

Simple serial exe:

(Please visit the site to view this file)

Compiler/MSP432P401R: Real FFT float32 with 8192 samples

MSP430-GCC-OPENSOURCE: Missing GCC files from the package

$
0
0

Part Number:MSP430-GCC-OPENSOURCE

Hi team,

 

A customer has pointed out an issue with our standalone GCC for Windows 7, 64 bit.

 

From here:

http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/index_FDS.html

 

They explain:

-------

It does not seem to include the necessary headers and linker files I need to compile with msp430-elf-gcc.

 

The user guide (SLAU646C) mentions an installer program, which does not seem to exist on the website, and mentions downloading the "MSP430 GCC Support Files package," which is also not available.

 

The user guide also mentions devices.csv, which is also not in the zip file.

 

Where can I download a working version of GCC?

-------

 

Thanks in advance for the help,

Billy

MSP430I2040: Is possible to tie up 2 ADCs inputs?

$
0
0

Part Number:MSP430I2040

Hi,

MSP430i2040 has multiple on-chip ADCs which support differential inputs.

Should it be okay if I connect an analog signal to 2 ADCs to get double sampling rate?

RTOS/MSP432E401Y: MSP432E4 USB controller error

$
0
0

Part Number:MSP432E401Y

Tool/software: TI-RTOS

Greetings:

I have an application that is returning an error when attempting to do a control transfer. The error I am referencing is bit 4 of the USBCSRL0 register whose descriptions states "Three attempts have been made to perform a transaction with no response from the peripheral". Once the controller sees this error, all further enumeration attempts fail with the same error. I am using the USBLib HCd driver, so the error is being cleared. I'm not sure what is causing this cascading error. Do you guys have any ideas?

Thanks,

Michael Cress

MSP432P4111: Custom Bootloader - Calling secondary application's C_Int00

$
0
0

Part Number:MSP432P4111

  • MSP432P4111 custom board
  • SimpleLink MSP432P4SDK 2.10.0.14
  • CCS V7.3.0
  • XDCTools 3.50.5.12
  • Compiler TI v17.9.0.STS

I'm doing a custom bootloader for my MSP432. 

  1. The boot application lives at the base of the memory map, and will run every time the the board is powered.
  2. My main application lives at a higher part of memory (0x00080000) and contains some header information used to verify the integrity
  3. My bootloader read the the main application's _c_int00 from the main application's header
  4. The bootloader attempts to execute the application, and when I single step through the disassembly (loaing the main application's symbols), the code looks correct, the address looks correct, but I get an exception.  
  5. Note: My bootloader starts as a main loop app with Sys BIOS support...However,  BIOS_Start() does not get called, unless the main application in memory is invalid.    So when my code calls the main application's _c_int00, SYS BIOS is not running.  

This is how I call the main application's _c_int00 funciton:

//////////////// This is defined in the main.c /////////////
typedef void (*TAppInitFunc)(void);
TAppInitFunc appCInt00; 

/////////////// This is in my main loop //////////////////
   if( IsMspIntFlashAppValid() )
   {
      appCInt00 = (TAppInitFunc*)GetMspAppEntryPointAddress();
      if( appCInt00 )
         appCInt00();
      else
         bootError = 1;
   }

Here's the exception:

Decoded exception,
Decoded,Hard Fault: FORCED: USAGE: UNALIGNED
Exception context,
$addr,0x2003ff10
$type,ti.sysbios.family.arm.m3.Hwi.ExcContext
threadType,ti.sysbios.BIOS.ThreadType_Main
threadHandle,0x0
threadStack,0x2003f800
threadStackSize,2048
r0,0x8f1f9
r1,0x8f1f9
r2,0x8
r3,0x2000eb01
r4,0x0
r5,0x0
r6,0x400802d3
r7,0x20040000
r8,0x0
r9,0x0
r10,0x0
r11,0x0
r12,0x2000e200
sp,0x2003ffe8
lr,0x94cf
pc,0x8f1fe
psr,0x21000000
ICSR,0x400f803
MMFSR,0x0
BFSR,0x0
UFSR,0x100
HFSR,0x40000000
DFSR,0x1
MMAR,0xe000ed34
BFAR,0xe000ed38
AFSR,0x0

MSP430G2533: Difficult to find video (or any) content for the MSP430G2553

$
0
0

Part Number:MSP430G2533

This controller has probably gotten a bit old and out of date, but I am learning myself to use it. Videos are hard to come by for this fellow, I found a series that I really liked, which turned out to focus on another uC.

Could I just use this series as my video guidance in my learning experience? Here I am thinking about timers...well, everything.

Are the MSP430's all the same at it's core?

Should I just get a newer controller? If so, which one could be recommended for a beginner just looking into doing small, simple, nerd stuff. No bells and whistles.

This is the series


MSP-EXP430FR5994: Audio Record and Playback Demo

$
0
0

Part Number:MSP-EXP430FR5994

Dear Forum,

I using the MSP- EXP430FR5994 and BOOSTXL-AUDIO. I've programmed the device with Audio Record and Playback Example, but I'm not hearing anything during playback.

I'm using CCS Version: 8.1.0.00011.

Windows Version 10.0.17134 Build 17134

MSP430:  Flash/FRAM usage is 134476 bytes. RAM usage is 196 bytes.

Any debugging tips?

thank you,

Scott

MSPFlasher : About the specification of -v

$
0
0

Hi community member

About the specification of -v
I am inquired about MSPFlasher from my customers.
Please tell me about the followings.

<Question>
The "-v" is doing is verifying that the checksum of the MCU ROM matches the checksum of "filename"
Is this correct?

Or is it verifying the contents of the MCU ROM and data of "filename", one by one?

Best regards.
Cruijff

MSP432P401R: Capacitors of LFX changed between MSP-EXP432P401R sch. Rev 1.0 and Rev 2.0

$
0
0

Part Number:MSP432P401R

Hi team,

My customer refer to the MSP-EXP432P401R Rev 1.0 to do the design in their last generation product.

The capacitors of LFX they used is 12pF,  but they find that in the Rev 2.0, the capacitors changed to 22pF. So they want to know why we changed the capacitors value? If they still use 12pF in their previous product and new design, what's potential risk? Is there any explanation about the capacitors change?

Thanks a lot.

 

MSP430FR5994: CPU power consumption in VLO clock mode

$
0
0

Part Number:MSP430FR5994

Hi All,

 As per my understanding, the CPU can be made to run with the clock source as VLO which is around 10 kHz. I tried searching in the datasheet what would be the power consumption of the CPU running at this clock frequency. But I didn't get any info on this. In MSP430FR5994 datasheet (page no. 66) under article no. 6.4 'Operating Modes', its mentioned that active mode power consumption is 120uA/MHz (with FRAM active). Does this mean that at 10 kHz, the CPU power consumption will drop to 1.2uA (power consumption proportionately reduced)? I also found in article 5.5 (page 30) of the same document, the active supply current versus CPU (MCLK) clock frequency is represented in a graph, but the graph doesn't show values below 1 MHz.

Also, I have an application where the CPU needs to be in low power mode and occasionally wake-up to do some SD card& UART activity. During low power mode, ADC and external pulse counting is required. Is it possible to drive the CPU and ADC both using VLO? In my application, if the ADC voltage crosses a certain threshold while CPU is in low power mode, then the MCU should wake-up and start the UART activities. Is this achievable? It is okay in my application if the ADC conversion time is too high.

-

Thanks

-

Regards

Soumyajit

MSP430F5659: How to increase the clock frequency

$
0
0

Part Number:MSP430F5659

Hi team, currently we are using MSP430F5659 controller and operating with 8 MZ. As per controller data sheet, it can operate till 25 MZ. Would like to operate at the highest frequency possible in the controller. 

As per controller datasheet, it is mentioned that 5.20 DCO frequency table - by modifying DCORSEL, DCO, MOD bits we can increase the clock frequency. We tried different options to increase its speed. But all our trails are in vain. 

Below is the code snippet currently we are using and with this controller is operating with 8 MZ. 

void Init_Micro(void)
{
//Stop Watch Dog Timer............
WDT_A_hold(WDT_A_BASE);

//use XT2 external crystal to create clock--- MUST AND SHOUD BE 7.2 AND 7.3 MUST BE HIGH
P7SEL |= 0x0C;

//ref for fll is xt2clk 
UCSCTL3 = (UCSCTL3 & ~(SELREF_7)) | (SELREF__XT2CLK );

UCSCTL2 &= ~(0x03FF); // Reset FN bits

UCSCTL1 |= DCORSEL_4; 
}

Here no where in the code we are setting, UCSCTL0 ( it is taking default and running with 8 MZ). In order to change clock speed ,we provide different values as per data sheet to UCSCTL 0 and 1 register. After that controller is not responding.

Please let us know that what change are required to operate my controller to run in higher frequency.

Looking forward for your support.

Thanks

Krishna

Viewing all 22073 articles
Browse latest View live