Quantcast
Channel: MSP low-power microcontrollers
Viewing all 62510 articles
Browse latest View live

Forum Post: RE: RTOS/MSP430FR6047: CHIRP receiver

$
0
0
Hi Adrian You just want to use the LEA and the ADC of the MSP430FR6047 ? The information I have mentioned is in the user's guide for more information you can refer to www.ti.com/.../slau367o.pdf If you have some problem to use the MSP430, I can help you. Thanks Gary

Forum Post: RE: CCS/MSP430FR2355: Problem using IE1 register for MSP430 Low Power MCU.

$
0
0
Thank you Sir, this removed the error but can you tell me the source of this information so that i don't get confused in future with other things too.

Forum Post: RE: CCS/MSP430FR4133: fs_add.asm and fs_div.asm files appear to be trapping my program

$
0
0
Hi Robert. Thanks for your input. I tried your suggestion, but the result was unsatisfactory although I was slightly optimistic because the undesirable assembly file never pops up automatically after I implemented your suggestion. However, the counter variable now outputs erroneously and relatively large values. Now, consider this. When the motor (with build in encoder) is substituted with a stand-alone encoder (I.e. no motor used), the code I posted earlier works great and the float data type is used. I don't understand why the former set up doesn't work. Under both instances (I.e. using the stand alone encoder (without motor) or motor with built in encoder), each device has two channels connected to msp430 (namely p1.6 & p1.7). It appears that for some reason, the msp430 chip "doesn't like" to perform the if-then-else logic when the p1.6 and p1.7 data signals are coming in from the motor with built-in encoder module. Just for the record, I have tested both channels of the motor-with-built-in-encoder and I was able see two distinct square waves as expected, so I know data is going to the msp430. Any thoughts on that? Thanks Trevor

Forum Post: CCS/MSP432P401R: Having trouble sending ADC values through UART (probably baudrate calculation)

$
0
0
Part Number: MSP432P401R Tool/software: Code Composer Studio Hello, my name is David. I am working on sending data from the 14ADC right after being sampled through the UART to my PC. So far I haven't been able to see any coherent value at the PC terminal (TeraTerm). The baudrate I am trying to accomplish is 115200. Please, any comment about my code (below) will be highly appreciated. Thanks, David. #include "ti/devices/msp432p4xx/inc/msp.h" #include // # Máximo acepta 250 buffs de 128 muestras de 16 bits, que es igual a 250000 bits de almacenamiento en Flash. #define Num_of_Results 128 static volatile uint16_t A0results[Num_of_Results]; static volatile uint32_t period=0; static uint8_t index; static uint8_t count; static flag =0; /*void VCORE1() { 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); }*/ int main(void) { WDT_A->CTL = WDT_A_CTL_PW | // Stop watchdog timer WDT_A_CTL_HOLD; // Configure GPIO // Enable A/D channel A0. P5->SEL1 |= BIT5; P5->SEL0 |= BIT5; // Clear LED to start. P1OUT &= ~BIT0; // Set P1.0/LED to output. P1DIR |= BIT0; // P2.4 - P2.7 output P2->DIR |= BIT4 | BIT7; // P2.4 - P2.7 Port Map functions P2->SEL0 |= BIT4 | BIT7; // P2.4 - P2.7 default PM functions = TimerA CCRx P2->SEL1 &= ~(BIT4 | BIT7); // --------------------------- Configuración del CLOCK --------------------------- // //VCORE1(); //Go to VCORE1 mode before setting clock to 48 MHz // Unlock modulo CS para acceder a los registros. CS->KEY = CS_KEY_VAL ; // Reset tuning parameters CS->CTL0 = 0; // Set DCO to 24 MHz CS->CTL0 = CS_CTL0_DCORSEL_4; // Select ACLK = REFO, SMCLK = MCLK = DCO CS->CTL1 = CS_CTL1_SELA_2 | CS_CTL1_SELS_3 | CS_CTL1_SELM_3; // Lock modulo CS para evitar acceso. CS->KEY = 0; // --------------------------- Configuración del TIMER --------------------------- // // Enable TA interruption rutine services. NVIC->ISER[0] |= 1 ISER[0] |= 1 CCR[0] = 2500; // Para una frecuencia de muestreo de 200 Hz. // TIMER_A_CCTLN_OUTMOD_3: señal de out en baja hasta contar a CCR[1] y en alta de CCR[1] hasta CCR[0]. // CCIE: Enable interrupt. TIMER_A0->CCTL[1] |= TIMER_A_CCTLN_OUTMOD_3 | CCIE; // CCR1 PWM duty cycle TIMER_A0->CCR[1] = 1000; // TIMER_A_CTL_SSEL__SMCLK: SMCLK como source. // TIMER_A_CTL_ID__8: divisor de clock en 8. // TIMER_A_CTL_MC__UP: UP mode. // TIMER_A_CTL_CLR: clear contador de timer. TIMER_A0->CTL |= TIMER_A_CTL_SSEL__SMCLK | TIMER_A_CTL_ID__8 | TIMER_A_CTL_MC__UP |TIMER_A_CTL_CLR; //Extended clock divider (1,2,3,4,5,6,7,8). TIMER_A0->EX0 |= TAIDEX__3; // --------------------------- Configuración del UART --------------------------- // // Set 2-UART pin as second function P1SEL0 |= BIT2 | BIT3; __enable_interrupt(); // Enable eUSCIA0 interrupt in NVIC module NVIC->ISER[0] = 1 CTLW0 |= EUSCI_A_CTLW0_SWRST; // Put eUSCI in reset EUSCI_A0->CTLW0 = EUSCI_A_CTLW0_SWRST | EUSCI_A_CTLW0_SSEL__SMCLK; // Remain eUSCI in reset // Configure eUSCI clock source for SMCLK // Baud Rate calculation // N = 24000000/(115200) = 208.3333. Como N>16, entonces: // OS16 = 1, UCBRx = INT(N/16) = 13. // UCBRFx = INT([(N/16) – INT(N/16)] × 16) = 0x00 // UCBRSx se encuentra en la tabla "Table 24-4. UCBRSx Settings for Fractional Portion" despues de calcular: ( = N - INT(N) ) = 0x49. EUSCI_A0->BRW = 13; EUSCI_A0->MCTLW = 0x4901; EUSCI_A0->CTLW0 &= ~EUSCI_A_CTLW0_SWRST; // Initialize eUSCI EUSCI_A0->IFG &= ~EUSCI_A_IFG_RXIFG; // Clear eUSCI RX interrupt flag EUSCI_A0->IE |= EUSCI_A_IE_RXIE; // Enable USCI_A0 RX interrupt // --------------------------- Configuración del ADC --------------------------- // // Enable global interrupt __enable_irq(); // Enable ADC interruption rutine services. NVIC->ISER[0] = 1 CTL0 = ADC14_CTL0_SHS_1 | ADC14_CTL0_SHP | ADC14_CTL0_SHT0_2 | ADC14_CTL0_CONSEQ_2 | ADC14_CTL0_ON; ADC14->CTL1 = ADC14_CTL1_RES__14BIT; // ref+=AVcc, channel = A0 ADC14->MCTL[0] = ADC14_MCTLN_INCH_0; // Enable ADC14IFG.3 ADC14->IER0 = ADC14_IER0_IE0; // Wake up despues de salir de ISR (rutina de servicio de interrupción) SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; __DSB(); while(1) { //5 min. while (period CTL0 |= ADC14_CTL0_ENC | ADC14_CTL0_SC; if (flag == 1) { if (index>0) count=index-1; else count=0; while(!(UCA0IFG & UCTXIFG)); UCA0TXBUF = (0x00FF & A0results[count]); while(!(UCA0IFG & UCTXIFG)); UCA0TXBUF = (0xFF00 &A0results[count])>>8; flag=0; } __sleep(); __no_operation(); // For debugger } period=0; P1->OUT = BIT0; } } // Rutina de servicio de interrupción del TIMER. void TA0_N_IRQHandler(void) { TIMER_A0->CCTL[1] &= ~CCIFG; } // Rutina de servicio de interrupción del ADC14. void ADC14_IRQHandler(void) { if (ADC14->IFGR0 & ADC14_IFGR0_IFG0) { //P1->OUT ^= BIT0; // pin a osciloscopio para ver frecuencia de muestreo. A0results[index] = ADC14->MEM[0]; // Guardar la data de la memoria del ADC en el arreglo, IFG vuelve a 0. index++; if (index>128){ // index incrementa hasta 128 y regresa a 0. index = 0; // cambia de columna. } flag=1; __no_operation(); } } void EUSCIA0_IRQHandler(void) { if (EUSCI_A0->IFG & EUSCI_A_IFG_RXIFG) { EUSCI_A0->IFG &=~ EUSCI_A_IFG_RXIFG; } }

Forum Post: RE: CCS/MSP430FR2355: Problem using IE1 register for MSP430 Low Power MCU.

$
0
0
It's shown in the FR4xx/FR2xx Family User's Guide. But in general, to see what symbols you can actually use, look into the actual header file ( msp430‍fr2355.h ): /***************************************************************************** SFR Registers *****************************************************************************/ #define __MSP430_HAS_SFR__ /* Definition to show that module is available */ #define __MSP430_BASEADDRESS_SFR__ 0x0100 #define SFR_BASE __MSP430_BASEADDRESS_SFR__ sfr_w(SFRIE1); /* Interrupt Enable */ sfr_b(SFRIE1_L); sfr_b(SFRIE1_H); sfr_w(SFRIFG1); /* Interrupt Flag */ sfr_b(SFRIFG1_L); sfr_b(SFRIFG1_H); sfr_w(SFRRPCR); /* Reset Pin Control */ sfr_b(SFRRPCR_L); sfr_b(SFRRPCR_H); /* SFR Register Offsets */ #define OFS_SFRIE1 (0x0000) #define OFS_SFRIE1_L OFS_SFRIE1 #define OFS_SFRIE1_H OFS_SFRIE1+1 #define OFS_SFRIFG1 (0x0002) #define OFS_SFRIFG1_L OFS_SFRIFG1 #define OFS_SFRIFG1_H OFS_SFRIFG1+1 #define OFS_SFRRPCR (0x0004) #define OFS_SFRRPCR_L OFS_SFRRPCR #define OFS_SFRRPCR_H OFS_SFRRPCR+1 /* SFR Control Bits */ /* SFRIE1 Control Bits */ #define WDTIE (0x0001) /* Watchdog timer interrupt enable */ #define WDTIE_L (0x0001) #define WDTIE_0 (0x0000) /* Interrupts disabled */ #define WDTIE_1 (0x0001) /* Interrupts enabled */ #define WDTIE_1_L (0x0001) #define WDTIE__DISABLE (0x0000) /* Interrupts disabled */ #define WDTIE__ENABLE (0x0001) /* Interrupts enabled */ #define WDTIE__ENABLE_L (0x0001) #define OFIE (0x0002) /* Oscillator fault interrupt enable */ (All those _L / _H symbols are for byte accesses; ignore them.) The header files are especially useful for finding out the names of the interrupt vector values (which the manual does not mention): #define UCIV__NONE (0x0000) /* No interrupt pending */ #define UCIV__UCRXIFG (0x0002) /* Interrupt Source: Receive buffer full; Interrupt Flag: UCRXIFG; Interrupt Priority: Highest */ #define UCIV__UCTXIFG (0x0004) /* Interrupt Source: Transmit buffer empty; Interrupt Flag: UCTXIFG */ #define UCIV__UCSTTIFG (0x0006) /* Interrupt Source: Start bit received; Interrupt Flag: UCSTTIFG */ #define UCIV__UCTXCPTIFG (0x0008) /* Interrupt Source: Transmit complete; Interrupt Flag: UCTXCPTIFG; Interrupt Priority: Lowest */

Forum Post: RE: CCS/MSP432P401R: Having trouble sending ADC values through UART (probably baudrate calculation)

$
0
0
You are sending binary values, not characters. In TeraTerm, use "setdebug 2" to show the received bytes in hexadecimal representation.

Forum Post: RE: CCS/MSP430FR4133: fs_add.asm and fs_div.asm files appear to be trapping my program

$
0
0
[quote user="Trevor Kennedy"]When the motor (with build in encoder) is substituted with a stand-alone encoder (I.e. no motor used), the code I posted earlier works great and the float data type is used. I don't understand why the former set up doesn't work. Under both instances (I.e. using the stand alone encoder (without motor) or motor with built in encoder), each device has two channels connected to msp430 (namely p1.6 & p1.7).[/quote] You mentioned that the encoder outputs two square waves, which I expect are in quadrature (one is 90° out of phase of the other). Approximately what frequency are the square waves output by the motor encoder? I ask because I'm guessing that you're turning the standalone encoder by hand, probably a lot slower than the encoder from the motor. That would explain why the code works fine with the standalone encoder but not the actual motor encoder.

Forum Post: MSP430F6736: MSP430F6736

$
0
0
Part Number: MSP430F6736 MSP430F6736 i am using this micro controller. with my project. please give me details of hardware and software required tools to program it. to burn the IC.

Forum Post: RE: CCS/MSP430FR2355: Part number is not in CCS 'Target:' list.

$
0
0
I loaded ccs v 8. the 2355 is in the target list.

Forum Post: RE: CCS/MSP430FR2355: Part number is not in CCS 'Target:' list.

Forum Post: RE: CCS/MSP432P401R: Having trouble sending ADC values through UART (probably baudrate calculation)

$
0
0
Thanks Clemens! Do you have any example on how to change the hex values to string so i can send those? I know that for 16 bits it would take around 20 bits (parity check, stop bit, etc) but how do I convert hex to string in an efficient way so I dont create an unnecessary delay. THANKS! David.

Forum Post: RE: CCS/MSP432P401R: Having trouble sending ADC values through UART (probably baudrate calculation)

$
0
0
It would be possible to format the values on the microcontroller (e.g., sprintf). However, four hex digits plus a separator would result in five characters (= bytes) sent per ADC result. To avoid delays, run a program on the host PC to format the values.

Forum Post: CCS/MSP430G2231: SLAA604 files to modify for most recent compiler (MSP430G2231)

$
0
0
Part Number: MSP430G2231 Tool/software: Code Composer Studio I was searching for some sample applications for the MSP430G2231 . Found application SLAA604 ( MSP430 Microcontroller Based Solar LED Lantern-Floating Buck Topology) Compiling the software with the most recent compiler was not possible I had to change some Bitnames in the main, (REF2_5 must be REF2_5V and DC10MEM must be ADC10MEM ) and I ended with the error : fatal error #16000: object files have incompatible formats ("../Lantern Buck Library_V2.0.lib " = TI-COFF, "./main.obj" = ELF) Is there a possibility to get the modified library file? or the original file so I can fix this? Regards, Rob Keij

Forum Post: RE: CCS/MSP432P401R: Having trouble sending ADC values through UART (probably baudrate calculation)

$
0
0
Thanks again for the answer, but I have the issue that when I send the hex values I am not getting the correct sequence at the terminal comparing to the one I am sending. I am posting the image of the terminal, and the part of code that sends that sequence. The sequence should always be: AA BB AA BB AA BB, but sometimes it shows AA AA BB BB AA AA AA as shown in the image. Could it be because of the baudrate (115200) selected to work with the 24 Mhz clock freq? Because if I make the program you suggested me to do in the PC to receive the data, the 16 bit word will greatly change with this wrong sequences. Thanks, David. while(!(UCA0IFG & UCTXIFG)); //UCA0TXBUF = (0x00FF & A0results[count]); UCA0TXBUF = 0xAA; for(d=0;d >8; flag=0;

Forum Post: RE: MSP432P401R: The method and setup of testing ENOB of ADC14 in MSP432

$
0
0
Please find the example code and test description found in SLAA821. www.ti.com/.../slaa821.pdf The calculation is taken directly from Mathlab and the stimulus source is the Precision Signal Injector, www.ti.com/.../ADS8900BEVM-PDK. Best Regards, Chris

Forum Post: RE: MSP432E401Y: MSP432E401Y Virtual COM Port Driver for Windows7

$
0
0
C:\ti\simplelink_msp432e4_sdk_2_30_00_13_eng\tools\usblib\windows_drivers Please confirm that you are able to find them. Regards, Chris

Forum Post: RE: Compiler/MSP432E401Y: Lwip with uartecho functions

$
0
0
Hello, I will need to investigate the examples available and get back to you on 10/3. Please update if you have additional findings or progress. Chris

Forum Post: RE: MSP430FR6989: About segmentation of FRAM

$
0
0
I am using CCS to check the register value. Register values are set as follows. MPUSEBB 1 = 0x0F80 MPUSEBB 2 = 0x1A00 I think that each segment will be assigned the following address Segment 1: 0x04400 - 0x0F7FF Segment 2: 0x0F800 - 0x1BFFF Segment 3: 0x1A000 - 0x23FFF In addition, although we have set the variable at 0x1A000, we can not write to the specified address. Do you need other settings?

Forum Post: RE: MSP430FR6989: About FRAN Write Protect

$
0
0
I am using CCS to check the register value. Register values are set as follows. MPUSEBB 1 = 0x0F80 MPUSEBB 2 = 0x1A00 In addition, although we have set the variable at 0x1A000, we can not write to the specified address. When checking with the CCS memory map, the variable name is allocated to 0x1A000 but the value is written from 0x0A000 address. When reading goes to the written value, it will go to 0x0A000 address instead of 0x1A000 address. Do I need other settings?

Forum Post: RE: MSP432E401Y: MSP432E401Y Virtual COM Port Driver for Windows7

$
0
0
Hello, Chris-san. Thank you very much for your answer. Thanks to you, it could be settled.
Viewing all 62510 articles
Browse latest View live


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