Jump to content

Search the Community

Showing results for tags 'msp430'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks


There are no results to display.

Found 274 results

  1. Hello Guys Good Day for All, I just open the Mspflash example from energia example using MSP4305969LP board. But when I compile, it show error as below picture. Any one can help me? Thanks a lot. Best Regards, Lukman
  2. Total Noob With Interrupt Problems

    I just started playing with the MSP430 with the G2553 chip and am having problems with interrupts. I have the following code just for testing and sometimes pressing the button works and sometimes it doesn't. I thought maybe I had a bad board and replaced it but I still have the same problem. I am beginning to think I am just doing something wrong in the debugging or something. But, here is my code: #include <msp430g2553.h> #define LED1 BIT0 int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer BCSCTL1 = CALBC1_1MHZ; //Set DCO to 1Mhz DCOCTL = CALDCO_1MHZ; P1OUT=BIT0; P1DIR=BIT0; //P1.0 (LED) as output) P1IES |= BIT3; // high -> low is selected with IESx = 1. P1IFG &= ~BIT3; // To prevent an immediate interrupt, clear the flag for // P1.3 before enabling the interrupt. P1IE |= BIT3; // Enable interrupts for P1.3 __enable_interrupt(); P1OUT |= BIT0; //Initially the led will glow while(1) {} return 0; } #pragma vector = PORT1_VECTOR //PORT1 interrupt vector name __interrupt void P1_ISR(void) { P1OUT ^= BIT0; P1IFG &= ~BIT3; // clear the interrupt flag } So I hit the debug button in CCS 7.4, and it loads to the board. I have a breakpoint at stopping the watchdog timer and a breakpoint at toggling BIT0 in the ISR. I hit resume at the watchdog timer and start trying the button at P1.3. Maybe 1 out of 10 times I'll hit the breakpoint in the ISR but the rest of the time I get nothing. I apologize if this is just a really basic and dumb question, but I have Googled everything I can think of and searched the forums and come up with nothing. Any help is appreciated,
  3. Hi, I have an MSP430G2553 board that I need to work with. However, when using Energia, the program usually freezes or becomes extremely slow to the point that I just have to terminate the process and close it. I really doubt it's a code problem, since the only codes I've used have been from the Examples (Blink and AnalogReadSerial). I've tried a couple of things: uninstalling and re-installing drivers, following all the steps in the Windows guide for Energia, re-downloading Energia. But nothing works. The problem is most certainly a communication problem with the board since, upon unplugging the board, the program starts working again with no freezes whatsoever. I really need to get this to work, so any suggestion is apreciated. Windows 10 by the way. Thanks. - Raimundo
  4. An extra USB for MSP430

    Hi! It's my first time using MSP430 and I'm a little bit lost . I want to connect a barcode scanner module with the MSP430. In order to do that, I need an USB port extra. I know that Arduino has a USB Host shield, but MSP430 doesn't have any shields, does it? So, how can I do it? Is there any way to use the USB Shield of Arduino for the MSP430? Thanks!
  5. Hi All, I need to compile and run c++ codes and .ino codes I have for my device. Since these codes interact with each other, I need to write a script to compile and run them from a terminal window rather than compiling and uploading my .ino code from the Arduino IDE ( Energia). Can someone help in this regard? I use Mac OS, but I am fine to switch to Windows if necessary. I use MSP430G223. Thanks Navid
  6. Hello, I'm currently working on a project temperature data logger. Now I'm using mc: MSP430f5529 I integrated with sd card using the petit fatfs library. Due to some limitation, i cant use full functionality. so I'm planning to make it work on fatfs. but there is no footprint for that. can you help me to come out of this issue? Thank you, sir Limitations: 1. Cant create a file 2. while saving the data in the same file previous entries are all given garbage value at sometimes. because it is not an empty file filled with null.
  7. Hello, I'm currently working on a project temperature data logger. Now I'm using mc: MSP430f5529 I integrated with sd card using the petit fatfs library. Due to some limitation, i cant use full functionality. so I'm planning to make it work on fatfs. but there is no footprint for that. can you help me to come out of this issue? Thank you, sir Limitations: 1. Cant create a file 2. while saving the data in the same file previous entries are all given garbage value at sometimes. because it is not an empty file filled with null.
  8. Hi , I am using MSP430FR4133LP , in energia the GPIO pins are predefined in the pins_energia.h for MSP430FR4133 LP based on the silkscreen on the board. I using this MSP430FR4133 chip for another project and in that i am not using a LCD so i thought that i can also use LCD pins as GPIO. For this purpose i need to add the pins in the pins_energia.h but i am not able to crack it. Can anyone help me with this ....? if i try to use any other pins other than the defined ones (say P2_2) ... it throws an error as " P2_2 not defined in the scope" // Pin names based on the silkscreen // static const uint8_t P1_0 = 4; static const uint8_t P1_1 = 3; static const uint8_t P1_2 = 24; static const uint8_t P1_3 = 13; static const uint8_t P1_4 = 12; static const uint8_t P1_5 = 11; static const uint8_t P1_6 = 18; static const uint8_t P1_7 = 19; //static const uint8_t P2_0 = ; //static const uint8_t P2_1 = ; //static const uint8_t P2_2 = ; <------ What should i do in order to add this pin static const uint8_t P2_3 = 22; static const uint8_t P2_4 = 21; static const uint8_t P2_5 = 8; static const uint8_t P2_6 = 25; static const uint8_t P2_7 = 5; //static const uint8_t P3_0 = ; //static const uint8_t P3_1 = ; //static const uint8_t P3_2 = ; //static const uint8_t P3_3 = ; //static const uint8_t P3_4 = ; //static const uint8_t P3_5 = ; //static const uint8_t P3_6 = ; //static const uint8_t P3_7 = ; static const uint8_t P4_0 = 23; //static const uint8_t P4_1 = ; //static const uint8_t P4_2 = ; //static const uint8_t P4_3 = ; //static const uint8_t P4_4 = ; //static const uint8_t P4_5 = ; //static const uint8_t P4_6 = ; //static const uint8_t P4_7 = ; static const uint8_t P5_0 = 17; static const uint8_t P5_1 = 7; static const uint8_t P5_2 = 15; static const uint8_t P5_3 = 14; //static const uint8_t P5_4 = ; //static const uint8_t P5_5 = ; //static const uint8_t P5_6 = ; //static const uint8_t P5_7 = ; static const uint8_t P8_0 = 6; static const uint8_t P8_1 = 2; static const uint8_t P8_2 = 9; static const uint8_t P8_3 = 10; //static const uint8_t P8_4 = ; //static const uint8_t P8_5 = ; //static const uint8_t P8_6 = ; //static const uint8_t P8_7 = ; //static const uint8_t PJ_0 = ; //static const uint8_t PJ_1 = ; //static const uint8_t PJ_2 = ; //static const uint8_t PJ_3 = ; //static const uint8_t PJ_4 = ; //static const uint8_t PJ_5 = ; //static const uint8_t PJ_6 = ; //static const uint8_t PJ_7 = ; These are the pin definitions that are already in the pins_energia.h based on the silkscreen. If i want to use a pin (say P2.2) what must i do in order to define that pin in the pins_energia.h file ?? thank you in advance.....
  9. MSP430F149 Board

    A while back @omnicron generously offered up some surplus boards sporting a MSP430F149 and a good mix of conditioned I/O on the board including a couple of 5.8psi pressure transducers. I feel that this, along with the programming header on the board, makes it a good all-around board for general purpose projects. The board also supports a standby NiMH battery (6v, 1800mAh) with charging/discharging capability and voltage monitoring all controlled by the MCU. The battery switches in via a relay upon primary power loss. One of the pushbuttons is configured in hardware to be used as a soft power on/off and requires just a little bit of code to work. One of the concerns upon getting the board is that, even though it has a programming header, the fuse may have been blown to protect the original code. With the fuse setup on the MSP430F149 that would be a show stopper and the board would have been a paper weight. Thankfully, when I connected my MSP-FET I was able to talk to the MCU as well as program it. So what does one do when presented with a new piece of hardware? Write code to flash LEDs and exercise the hardware, of course. Since I wanted to make this a general purpose, “throw it at a project” kind of board, I wanted to write some functions to simplify the main program code. So far I have routines for digital I/O, analog in, chip temperature and a function to display a binary result on the eight LEDs on the board. One downside to the way this particular board was designed is the lack of easily accessible serial ports. One way around this is to solder directly to the MCU pins to utilize the secondary serial ports , but that wasn't very attractive. Looking at the schematic I found that by removing three passives from each of the two serial lines, I could repurpose what were originally a couple of digital outputs and have a serial port (UART only, no I2C on this MCU). SPI is also possible using the same technique, but a little more cumbersome to implement. I haven't written the functions for serial yet and will probably wait until I actually need serial I/O. The video demonstrates my demo code that utilizes soft power using the switch shown at the bottom left. Default power up behavior is the 8 LEDs chasing up and down. The next switch to the right of the power switch toggles the beeper which, when activated, sounds every time the LED furthest to the left (LSB) lights up. The next switch to the right toggles the speed of the LEDs and the final button displays the chip temp in binary (75 degrees in this case), pauses to allow it to be read and then resumes the LED chasing. There… hardware reasonably exercised. J I have included pictures of the front and back of the board as well as a PDF schematic. If you have the inclination I welcome feedback on the code and the resulting opportunity to learn to code more efficiently. // Since I used portions of TI’s MSP430ware examples in two functions (chiptemp and analogIN) I am //including the TI copyright notice below: /* --COPYRIGHT--,BSD_EX * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ******************************************************************************* * * MSP430 CODE EXAMPLE DISCLAIMER * * MSP430 code examples are self-contained low-level programs that typically * demonstrate a single peripheral function or device feature in a highly * concise manner. For this the code may rely on the device's power-on default * register values and settings such as the clock configuration and care must * be taken when combining code from several examples to avoid potential side * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware * for an API functional library-approach to peripheral configuration. * * --/COPYRIGHT--*/ #include <msp430.h> #define ana_ch_a 0x01 // Port 6.0, A0 #define ana_ch_b 0x02 // Port 6.1, A1 #define ana_batt 0x03 // Port 6.2, A2 #define ana_9v 0x04 // Port 6.3, A3 #define ON 0x01 #define OFF 0x00 #define LED_1 0x01 // Port 2.0 #define LED_2 0x02 // Port 2.1 #define LED_3 0x03 // Port 2.2 #define LED_4 0x04 // Port 2.3 #define LED_5 0x05 // Port 2.4 #define LED_6 0x06 // Port 2.5 #define LED_7 0x07 // Port 2.6 #define LED_8 0x08 // Port 2.7 #define LED_9 0x09 // Port 3.0 #define LED_10 0x0A // Port 3.1 #define valve_a 0x0B // Port 3.2 #define valve_b 0x0C // Port 3.3 #define pump_a 0x0D // Port 3.4 #define pump_b 0x0E // Port 3.5 #define charge 0x0F // Port 3.6 #define discharge 0x10 // Port 3.7 #define beep 0x11 // Port 4.0 #define chkbatt 0x12 // Port 4.1 #define VCCEN 0x13 // Port 4.2 //array and variables to support functions const int BitValue[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; unsigned int var1; unsigned int var2; unsigned int var3; unsigned int var4; unsigned int a; unsigned int b; unsigned int c; unsigned int ADCvalue; int long IntDegF; void PostLEDValue (unsigned int Var4); void chiptemp(int long degree_f); void analogIN(unsigned int var3); // values= ana_ch_a/b, ana_batt, ana_9v void digitalWrite(unsigned int var1, unsigned int var2); // values = LED_1-10, valve_a/b, pump_a/b, beep, charge, discharge, chkbatt, VCCEN, and var2 = ON, OFF volatile unsigned int i=0; unsigned int led_count; volatile unsigned int j; unsigned int l=2; unsigned int sw_press = 0; unsigned int beep_status = 0; unsigned int speed = 6000; int long temp; void main() { WDTCTL = WDTPW + WDTHOLD; DCOCTL = DCO0 + DCO1; BCSCTL1 = RSEL0 + RSEL1 + RSEL2; P1DIR |= 0x00; P4DIR |= BIT0 + BIT1 + BIT2; P4OUT |= 0x00; P4OUT |= 0x04; // Set P4.4 to 1 (VCCEN) P2DIR |= BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7; P2OUT &=~(BIT0+BIT1+BIT2+BIT3+BIT4+BIT5+BIT6+BIT7); P2OUT |= (BIT0+BIT1+BIT2+BIT3+BIT4+BIT5+BIT6+BIT7)& 0xFF; P3DIR |= BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7; P3OUT &=~(BIT0+BIT1+BIT2+BIT3+BIT4+BIT5+BIT6+BIT7); P3OUT |= (BIT0 + BIT1) & 0xF; P1IES |= 0x00; P1IFG |= 0x00; P1IE |= (BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7); _enable_interrupt(); // MAIN CODE STARTS HERE ---------------------------------------------------------- l=2; do { led_count = 11; do { led_count--; j = speed; // Delay 6000 or 1500 do (j--); while (j != 0); if (led_count == 9){ led_count = 8;} if (led_count == 7){ led_count = 6;} digitalWrite(led_count, ON); } while (led_count != 1); i = 45000; do (i--); while (i != 0); if (sw_press == 3) { // Toggle beep at LSB transistion beep_status ^= 0x01; sw_press = 0; } digitalWrite(beep, beep_status); i = 5000; do (i--); while (i != 0); // Delay 5000 digitalWrite(beep, OFF); if(sw_press == 1) { // Soft Power Down P4OUT ^= 0x04; sw_press = 0;} if (sw_press == 4 && speed == 6000) { //Toggle LED chase speed speed = 1500; sw_press = 0;} if (sw_press == 4 && speed == 1500) { speed = 6000; sw_press = 0;} if (sw_press == 5) { sw_press = 0; chiptemp(0);} led_count = 0; do { led_count++; j = speed; // Delay 6000 or 1500 do (j--); while (j != 0); if (led_count == 7){ led_count = 8;} if (led_count == 9){ led_count = 10;} digitalWrite(led_count, OFF); } while (led_count != 10); i = 50000; do (i--); while (i != 0); // Delay 50000 } while (l != 0); } // MAIN CODE ENDS HERE ------------------------------------------------------------------------------------ #pragma vector=PORT1_VECTOR __interrupt void PORT1_ISR(void){ _disable_interrupt(); if(P1IFG & BIT0) { sw_press = 1; P1IFG &= ~BIT0; } if(P1IFG & BIT1) { sw_press = 2; P1IFG &= ~BIT1; } if(P1IFG & BIT2) { sw_press = 3; P1IFG &= ~BIT2; } if(P1IFG & BIT3) { sw_press = 4; P1IFG &= ~BIT3; } if(P1IFG & BIT4) { sw_press = 5; P1IFG &= ~BIT4;} if(P1IFG & BIT5) { sw_press = 6; P1IFG &= ~BIT5; } if(P1IFG & BIT6) { sw_press = 7; P1IFG &= ~BIT6; } if(P1IFG & BIT7) { sw_press = 8; P1IFG &= ~BIT7; } _enable_interrupt(); } #pragma vector=ADC12_VECTOR __interrupt void ADC12ISR (void) { _disable_interrupt(); temp = ADC12MEM0; _enable_interrupt(); } // FUNCTIONS BEGIN HERE -------------------------------------------------------------------------------------------- void digitalWrite(unsigned int var1, unsigned int var2){ a=0; b=0; c=0; if (var1 <= 0x0A){ //Flip ON/OFF on LED outputs since they are active low. var2 ^= 0x01;} if (var1 >= 0x10 && var1 <= 0x13){ c = (var1-17); if (var2==1){ a=P4OUT; a=a|(BitValue[c]); P4OUT=a;} if (var2==0){ a=P4OUT; b=~(BitValue[c]); P4OUT = (a&b);} } if (var1 >= 0x09 && var1 <= 0x10){ c = (var1-9); if (var2==1){ a=P3OUT; a=a|(BitValue[c]); P3OUT=a;} if (var2==0){ a=P3OUT; b=~(BitValue[c]); P3OUT = (a&b);} } if (var1 >= 0x01 && var1 <= 0x08){ c = (var1-1); if (var2==1){ a=P2OUT; a=a|(BitValue[c]); P2OUT=a;} if (var2==0){ a=P2OUT; b=~(BitValue[c]); P2OUT = (a&b);} } } void chiptemp (long int degree_f) { ADC12CTL0 = SHT0_8 + REFON + ADC12ON; ADC12CTL1 = SHP; ADC12MCTL0 = SREF_1 + INCH_10; ADC12IE = 0x001; ADC12CTL0 |= ENC; ADC12CTL0 |= ADC12SC; i = 5000; do (i--); while (i != 0); IntDegF = (temp - 2519) * 761; IntDegF = IntDegF / 4096; temp = 0; degree_f = IntDegF; PostLEDValue (degree_f); } void PostLEDValue (unsigned int var4){ led_count = 0; do { led_count++; j = 250; do (j--); while (j != 0); // turn off LEDs if (led_count == 7){ led_count = 8;} if (led_count == 9){ led_count = 10;} digitalWrite(led_count, OFF); } while (led_count != 10); if (var4 > 64){ var4 = var4 - 64; digitalWrite(LED_8, ON); } if (var4 > 32) { var4 = var4 - 32; digitalWrite(LED_6, ON); } if (var4 > 16) { var4 = var4 - 16; digitalWrite(LED_5, ON); } if (var4 > 8) { var4 = var4 - 8; digitalWrite(LED_4, ON); } if (var4 > 4) { var4 = var4 - 4; digitalWrite(LED_3, ON); } if (var4 > 2) { var4 = var4 - 2; digitalWrite(LED_2, ON); } if (var4 == 1) { digitalWrite(LED_1, ON); } j = 20; //delay to allow reading of LEDs do { i = 50000; do (i--); while (i != 0); j--; } while (j != 0); } void analogIN (unsigned int var3){ ADC12CTL0 = SHT0_8 + REFON + ADC12ON; ADC12CTL1 = SHP; if (var3==1){ ADC12MCTL0 = SREF_1 + INCH_0; } if (var3==2){ ADC12MCTL0 = SREF_1 + INCH_1; } if (var3==3){ ADC12MCTL0 = SREF_1 + INCH_2; } if (var3==4){ ADC12MCTL0 = SREF_1 + INCH_3; } ADC12MCTL0 = SREF_1 + INCH_10; ADC12IE = 0x001; ADC12CTL0 |= ENC; ADC12CTL0 |= ADC12SC; i = 5000; do (i--); while (i != 0); ADCvalue = (temp/16); PostLEDValue (ADCvalue); } - Circuit Diagram.pdf Demo_Program_Video.MOV
  10. I worked on a new servicing routine for my kit oscilloscope's quadrature rotary encoder, and decided to write it all up and post it on Github. Included are routines for periodic polling and for pin-interrupt servicing. Hardware switch debouncing is not needed. The routines are for general use, but I wrote testing code for the MSP430G2231 installed on the Launchpad. The scope guys have used the "lookup table" state transition routine that most people use today, but it doesn't work very well on the scope, and I haven't found it to work very well generally. My routines are designed to avoid all effects of switch bouncing, and seem to work very well and efficiently. Everything is explained in the PDF file in the repo. All the testing code is also included, both source code and executable hex files, and I'm afraid it's all in assembler. But I hope it wouldn't be too difficult to create Energia versions if anyone is interested. I've provided hex files for both types of encoders - those with the same number of pulses as detents per revolution, and those with half as many pulses as detents. The code produces one "tick" per detent in both cases. https://github.com/gbhug5a/Rotary-Encoder-Servicing-Routines
  11. Setting up timers/ccr MSP430G2152

    I'm trying to replicate the project shown here http://www.mjlorton.com/forum/index.php?topic=284.0 but instead of the g2211 I'm using the g2152. I somewhat understand what the code is doing, however I'm having a hard time setting up the timers and capture compare registers. Additionally I'm not sure how the timer/ccr is being used to differentiate between a long or short button press (is it using nested interrupts?) The original code uses grace included configs which obviously aren't there,I'm trying to infer how things were set up originally. I have the gpio and wdt config figured out but not the timer or ccr (I'm probably missing other things as well) Any insight or hints to push me in the right direction would be helpful. Thanks. //#define DATALOG BIT3 //P1.3 //#define BACKLIGHT BIT4 //P1.4 //#define MAXMIN BIT5 //P1.5 //#define DCAC BIT1//P1.1 //#define VHz BIT2//P1.2 //#define DCAC_OUT BIT6//P2.6 //#define VHz_OUT BIT7//P2.7 /* * ======== Standard MSP430 includes ======== */ #include <msp430g2152.h> /* * ======== main ======== */ int main(void) { WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer P1OUT = BIT1 | BIT2 | BIT3 | BIT4 | BIT5; P1DIR = BIT3 | BIT4 | BIT5; P1REN = BIT1 | BIT2; P1IES = BIT1 | BIT2; P1IFG = 0; P1IE = BIT1 | BIT2; P2SEL2 = BIT3; P2OUT = BIT6 | BIT7; P2SEL &= ~(BIT6 | BIT7); P2DIR = BIT6 | BIT7; P2IES = 0; P2IFG = 0; __bis_SR_register(LPM3_bits | GIE); } #pragma vector = PORT1_VECTOR __interrupt void PORT1_ISR( void ) { P1IE &= ~(BIT1 | BIT2); // // disable interrupt on these pins __delay_cycles(10000); TA0CCR1 = 0; TA0CCTL0 &= ~CCIFG; TA0CTL |= MC_1; // Start timer switch(P1IN & (BIT1 | BIT2)){ case 0: //VHz+DCAC buttons pressed if(P1OUT & BIT3) P1OUT &= ~(BIT3); else P1OUT |= (BIT3); __delay_cycles(20000); break; case 2: //VHz button pressed while (!(P1IN & BIT2) && !(TA0CCTL0 & CCIFG)); TA0CTL &= ~MC1; if (!(TA0CCTL0 & CCIFG)){ P2OUT &= ~(BIT7); __delay_cycles(10000); P2OUT |= (BIT7); } else{ P1OUT &= ~(BIT4); __delay_cycles(10000); P1OUT |= (BIT4); } break; case 4: //DCAC button pressed while (!(P1IN & BIT1) && !(TA0CCTL0 & CCIFG)); TA0CTL &= ~MC1; if (!(TA0CCTL0 & CCIFG)){ P2OUT &= ~(BIT6); __delay_cycles(10000); P2OUT |= (BIT6); } else{ P1OUT &= ~(BIT5); __delay_cycles(10000); P1OUT |= (BIT5); } break; case 6: //no button pressed break; } TA0CTL &= ~(MC1 + MC0); // Clear MCx bits to stop timer while(!(P1IN & (BIT1 | BIT2))) P1IFG &= ~(BIT1 | BIT2); // sets register flag for interrupt to 0: No interrupt is pending P1IE |= (BIT1 | BIT2); // re-enable interrupt on these pins }
  12. Porting Arduino Library

    Hello All, I'm an electronics engineering student and I know little about programming.I was using arduino and I want to use TI MCU's. So for that reason I'm recreating my arduino projects on energia (tried code composer studio but it is too complicated for me). Some of my projects worked well on energia and i didn't make any changes of my codes it was wonderful but my end term project didn't compiled because of the library that i'm using so I'm trying to port a library from arduino to energia. The library that i'm trying to port is based on the SoftwareSerial library (formerly NewSoftSerial), authored by: ladyada (http://ladyada.net),Mikal Hart (http://www.arduiniana.org),Paul Stoffregen (http://www.pjrc.com),Garrett Mace (http://www.macetech.com), Brett Hagman (http://www.roguerobotics.com/) and it uses pin change interrupts. the library that i'm trying to port energia uses digitalPinToPCMSK and digitalPinToPCICR macros from the pins_arduino.h I was successful running this library on arduino but i cannot get it to work on energia. The error I'm gettin when i try to compile the code is; error: 'digitalPinToPCICR' was not declared in this scope 'error: digitalPinToPCMSK' was not declared in this scope it is going like this. The library i want to port from arduino is Arduino-SDI-12 created by Kevin M. Smith, S. Hicks and their team members the library is located at github (link: https://github.com/EnviroDIY/Arduino-SDI-12 ). What should I do to make it work? Any help will be appreciated. Thanks in advance, I'm using LaunchPad MSP-EXP430G2 v1.5 MCU MSP430G2553 Windows 10 PC and Energia 1.6 10E18 IDE
  13. MSP430F5529 and RFM12b used together

    Hello, I hope this is the right forum to post in, I'm a new user here... So, I have been trying to get the RFM12b module to work with my MSP430F5529. The connections are as follows for transmission: VDD --> 3.3V GND--> GND SDO-->P6.5 nIRQ-->P3.4 nSEL-->P3.3 SCK-->P1.6 SDI-->P6.6 Now, I have the following code, in which I only configure the module and try to read its status register: #include "main.h" void WriteCMD(unsigned int CMD); void Write1(); void Write0(); int check_status(); void main() { //init ports P6DIR |= BIT5; //set SDO as output on P6.5 P3DIR &= ~BIT4; //set nIRQ as input on P3.4 P3REN |= BIT4; P3DIR |= BIT3; //set nSEL as output on P3.3 P1DIR |= BIT6; //set SCK as output on P1.6 P6DIR &= ~BIT6; //set SDI as input on P6.6 P6REN &= ~BIT6; //init rfm12b WriteCMD(0x80D8);//enable register,433MHz,12.5pF WriteCMD(0x82D8);//enable receive,!PA WriteCMD(0xA640);// WriteCMD(0xC647);// WriteCMD(0x94A0);//VDI,FAST,134kHz,0dBm,-103dBm WriteCMD(0xC2AC); WriteCMD(0XCC77);// WriteCMD(0xCA80); WriteCMD(0xCA83);//FIFO8,SYNC, WriteCMD(0xC49B); WriteCMD(0x9850);//!mp,9810=30kHz,MAX OUT WriteCMD(0xE000);//NOT USE WriteCMD(0xC800);//NOT USE WriteCMD(0xC000);//1.0MHz,2.2V //statusregister auslesen int cnt = 16; int result = 0; int temp = 0; P3OUT &= ~BIT3; //set nSEL low P6OUT &= ~BIT5; //set SDO low while(cnt--) { __delay_cycles(10); temp = P6IN; temp = temp <<2; result |= temp; result = result <<1; P1OUT |= BIT6; // set SCK high __delay_cycles(10); __no_operation(); P1OUT &= ~BIT6; //set SCK low __delay_cycles(10); P3OUT |= BIT3; //set nSEL high; } __no_operation(); while(1) { __no_operation(); result= result-1; result = result+1; } } void WriteCMD( unsigned int CMD ) { unsigned char n=16; P1OUT &= ~ BIT6; //set SCK low P3OUT &= ~BIT3; //set nSEL low, selecting the rfm12b __delay_cycles(10); while(n--) { if(CMD&0x8000) { Write1(); } else { Write0(); } CMD=CMD<<1; } P1OUT &= ~ BIT6; //set SCK low P3OUT |= BIT3; //set nSEL high, deselecting the rfm12b __delay_cycles(10); } void Write0 (void) { P1OUT &= ~BIT6; //set SCK low __delay_cycles(10); P6OUT &= ~BIT5; //set SDO low __delay_cycles(10); P1OUT |= BIT6; //set SCK high, rfm now reads SDO __delay_cycles(10); P1OUT &= ~BIT6; //set SCK low } void Write1(void) { P1OUT &= ~BIT6; //set SCK low __delay_cycles(10); P6OUT |= BIT5; //set SDO high __delay_cycles(10); P1OUT |= BIT6; //set SCK high, rfm now reads SDO __delay_cycles(10); P1OUT &= ~BIT6; //set SCK low } Now, the status register should read "0x4000", but I always get "0xFFF8" and this makes me nervous. I have also tried simply connecting two modules and sending data between the two with a bit different programms, but that also didn't yield any results. Can anyone here help me? I've been to the 10th site of Google search results and haven't found anything that could help me. I got my instructions from the following site: https://gobotronics.wordpress.com/2010/10/07/rfm12-programming/. Thanks in advance!
  14. Hello, I'm actually trying to communicate with Gps through Uart. But every time its giving error like this. error: #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors. I don't know how to solve it. so, please help me to finish this project. it's very urgent Thanks in advance.
  15. while integrating GPS with my msp430. I'm getting these errors from the library. so please someone help me out. C:\Users\softdesigners\Desktop\energia-1.6.10E18\libraries\SoftwareSerial\SoftwareSerial.cpp:81:2: error: #error This version of SoftwareSerial supports only 16MHz processors C:\Users\softdesigners\Desktop\energia-1.6.10E18\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)': C:\Users\softdesigners\Desktop\energia-1.6.10E18\libraries\SoftwareSerial\SoftwareSerial.cpp:251:31: error: 'table' was not declared in this scope C:\Users\softdesigners\Desktop\energia-1.6.10E18\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual size_t SoftwareSerial::write(uint8_t)': C:\Users\softdesigners\Desktop\energia-1.6.10E18\libraries\SoftwareSerial\SoftwareSerial.cpp:319:26: error: 'XMIT_START_ADJUSTMENT' was not declared in this scope
  16. Compute float number in msp430g2

    Hi everyone, I use the following function to compute the angle from accelerometer: float a =atan2f(-0.143798828, -0.680053711); But it can not return a proper result (a huge number ~10^22). How I can compute the angle directly on the chip. (I used CCS IDE). Thanks!
  17. Serial port does not exist

    Mac OS 10.9.5; MSP-EXP430G2; just downloaded Energia 1.6.10E18; installed MSP430LCPDC 1.0.3b drivers. I installed the drivers and restarted my Mac. I was able to select the /dev/cu.art-XXXXX port, but running Blink gave me a long error, which ended in the selected serial port fet: identify failed does not exist or your board is not connected Power LED on the launchpad works. I've had the board sitting on a shelf for about 3 years, if that makes any difference. I could not locate these drivers on my Mac to verify they were the right ones, but other forum posts leads me to believe that is the right port. Can anyone help me? Thanks.
  18. hi, I am using a MSP430FR4133 launchpad, i am trying to get a float value and send it via sim800. for that i hve to convert the float value to char* or char array. I have tried many conversions but i am not able to get the conversion properly. Even if i get it properly while printing it on the serial. The data is not transmitted in the right format through sim800. for example if i use dtostrf( buff , "%f" , flaotVal); function in serial monitor only "%f" is getting printed. and if i try other type of convertions , while transmitting through sim800 the right side part of the float value gets added to the decimal values . have tried ( itoa(), sprintf(), etc..) for example .. float value = 1.25. and if i tried converting and printing it on serial monitor i am getting it corrrectly as "1.25" . But when i am trying to transmit through sim800 the converted float value is sent as "0.125" instead 1.25 . Can anyone help me with this?.
  19. I'm trying to interface sd card module to msp430f5529 using Energia. I tried these methods https://43oh.com/2013/12/interfacing-the-launchpad-to-an-sd-card-a-walkthrough/ and download sd library from GitHub. both are giving errors. can anyone help me out with this errors?
  20. Is it possible to use asm in energia? I would like to see some short and simple example of how to use it and compile it. I found THIS very nice and useful guide to make it work in code composer studio, but unfortunalley I could not put this code it to work in Energia, and I dont have CCS.. (I downloaded the version 7, but for some reason it did not install, just give errors, tried in 2 pcs) In the other hand, I found something about asm in Energia here in the forum, but is was intended for a more complex stuff, and I could not put it to work, too.. Could someone give me a light? I just want to do something very simple like blink a red led, then a green led, like in the example in the link, just to know how to handle asm in msp430. But in Energia, not CCS.. I am using the msp430g2553 launchpad. I have also a g2452 chip.. ps. my final objective is to make something like THIS in msp430 (the guy provides the emulator asm code for the atmel chip, I guess it would be possible to port it to msp, if you know asm and study the chips very well.... once tha arm emulator runs, I guess the rest will work...)
  21. Hi guys, To train the use of some macros I decided to update/improve a 16x2 lcd library (HD44780) that I adapt many years ago. Possible there are other libraries shared here, but I liked how I managed the configuration of ports and pins using some macros. The use of macros made the library more versatile and easy to adap to new projets without the need to change tons of code lines. The same simples example of use is runnig on MSP430G2553 (old value line launchpad) and MSP430FR2433 (the new value line launchpad). I hope it's useful. https://github.com/agaelema/LCD16x2_MSP43x
  22. UART using MSP430FR2311

    I am using a MSP430FR2311 launch pad and i am trying to send AT commands through RX and TX to SIM800 and Receive Response from the SIM800 module. But am not able to get the response and not able to use SoftwareSerial in Energia for MSP boards. Can Anyone help with this problem ? Thank you in advance. #include <String.h> void setup() { pinMode(RED_LED , OUTPUT); Serial.begin(9600); //Serial.print(F("AT\r")); while(Serial.available()==0); val1 = Serial.readString(); Serial.print(val1); Serial.print("\r"); delay(100); } void loop(){ //do nothing if(Serial.available()) { String val2 = Serial.readString(); line += String(val2); Serial.print(line); if (line.indexOf("OK") >= 0) { digitalWrite(RED_LED,HIGH); } } } Since we cant use both the Debugging UART (Serial Monitor) and Application UART (TX and RX) at the same time , I am checking the received Response for the string "OK" . and if OK is there the RED led goes high.
  23. Hello, I want to design a datalogger and to create USB Mass Storage when I connect board. I did not find Examples related to MSP430F5529 for Energia. So, please suggest me Energia example/SDK related to "MSP430F5529". Thank you. Regards, Pratik Panchal
  24. Can we add MSP430FR2311 Launchpad to energia. The Board Manager isn't Showing this board.
  25. Hello from Fort Worth, Texas

    Hello, Just getting back into the microcontroller development aren. In the nineties I got very familiar with the Intel 8751 all programming in assembly. Times have changed! A lot is easier now, but learning the new IDE and knocking the rust off my C programming. We picked the MSP430 for the low power consumption. Like others I had a little trouble getting Energia running but now no problems. First project completed was a remote oxygen pressure monitor for the airplane. We have also connected the LIS3DH accelerometer and have it working well. I haven't figured out exactly how to import, modify arduino libraries yet so I just wrote directly to the chip following the data sheet. No problems with the I2C. Looking forward to more MSP430 projects. thanks, Valerie