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


  • Community Calendar

Found 214 results

  1. I know I haven't finished off my desk clock project just yet, But I've been requested to design a new GPS logging device for my sisters Beagle Club, The basic idea is that a sent is placed with a guy that forms a path, the GPS logger is taken along also. They then attach the device to a beagle (using some kind of vest, I think). And let them follow the scent. Post event they extract the GPS data from the logger and overlay both tracks in google earth. They have one unit that has been working well for them, developed by a previous club member. It consists of off the shelf components from Sparkfun. With a total BOM just over $150 Logomatic V2 ( GPS ( 128mb uSD Old Cell phone battery (Li-ion) (~700mAh judging from physical size) All of these are connected together and fit into an off the shelf jiffy box. They would like 5 more made, which would perform identical/similar function Design goals: Lower cost (< $50AUD per unit, making 5 units) Externally operates identically to the old versionUSB MSC Logs start when unit powered on via toggle switch new log created when button pressed All additional tools stored on SD card (GPS utilities, past logs) Long battery life, unit should operate for > 10Hours Physically the same size or smaller (if time allows, a simple PC tool to to reset the device into DFU mode, and update the firmware) I'm planning to source a more slimline case. once I have that I will begin PCB design. I have drawn some quick System level schematics The hardware is pretty straight forward Same with the software, I have already played with the MSP430 USB MSC examples, and am familiar with FATFS. I should be able to glue in some UART code to get it all to work. The device will operate under two modes depending on if it's connected to USB or not. Hopefully someone will find this mildly interesting as I work through it.
  2. I'm attaching a link to github with Energia code examples for various sensors. I started this as a place to put examples for students in a course I was helping to develop for middle and high school level students using the MSP430F5529. Unfortunately the course was not held but I'm putting them out there in the hope they might help someone. Where the code has been tested with other LaunchPads I've noted it. Here it is: You won't find anything sophisticated but many are at least somewhat unique in that I couldn't find an example for that sensor tailored specifically for the F5529, or I wanted to better document it for beginners. Essentially all are variants of work done by others, including work on 43oh, and I hope I've recognized the contribution in the code. There is a wiki associated with some that has the schematic and photographs. There is some other example code that is almost complete - e.g. using small DC motors and servos and I might add them. Here is a list of sensors and devices currently out there: CNY70 - used as a proximity switch CNY70 - used as a tachometer MCP41010 - digital pot HC-SR04 - distance sensor 3 watt high intensity LED MAX4466 -sound level I2C LCD (4x20) and (2x16) HC-SR501 - PIR movement detection SW-180xxP - vibration sensor Joystick PFatFs - compiles and runs on the F5529 Hall effect rainfall sensor TMP36 - temperature Sharp GPf1S53VJ000F - photo interrupter Using low power modes (LPM) in Energia TCS3200 Color Sensor using MSP432 *** added 8/8/15 DS1307 Real Time Clock (RTC) Module *** added 8/9/15 INA125P Instrumentation Amplifier *** added 10/9/15 MCP3008 ADC *** added 10/12/15 TLC5615 DAC *** added 11/30/15 dAISy MarineTraffic shore station w/ CC3200 ** added 12/16/15 AD9850 Frequency Generator ** added 1/20/16 FFT ** added 1/20/16 Rotary encoder ** added 1/23/16 W5500 Ethernet ** added 3/25/16 MSP430G2955 pins_energia.h ** added 3/25/16 DriverLib examples for F5529 ** added 8/16 Infrared Transmission ** added 12/16 WS2812 LEDs using SPI ** added 12/16 Battery measurement ** added 1/17 Finite State Machine - alarm system ** added 2/6/17 Using RTC module with Energia - F5529 ** added 2/24/17
  3. Hello, I am hoping to convert Example 09 of the Energia examples (thermistor temperature with the MSP430F5529) to entirely C language to use in Code Composer Studio - I've already used the import function to use this example in CCS and it works fine with the code given, but I'd like to re-work the example to only use C functions like main().c. Is there a simple way to do this? I'm still learning C and need the experience! Example 09 is attached for reference.EXAMPLE09_Temperature.ino
  4. Came across this while browsing. MSP430 Analog Gauge Clock
  5. Hi , I am interfacing MSP430F5529 and SIM900A using energia software. I have tried the code using Arduino Uno before and it seemed to work fine. However when I try the same with msp430 , there is no output on the serial monitor. Few days back I came to know that there is a voltage mismatch between the msp430 output and sim900 input and as suggested by few members of the thread , I am supposed to use a voltage translator to convert the 3.3V output of the Msp430 board and then apply it to sim900A module. They recommended Rs232 for this purpose . I want to know the connection that'll be required to made in order to translate the voltage of the msp430. Where do I connect the rs232 cable and where do I apply it's output voltage ? Thank you .
  6. I am interfacing LM35 and SIM900 using MSP430F5529 board . For this purpose i am using Energia software . As we all know arduino code is compatible in Energia . Hence , I have used the same code that i used in Arduino Uno . The code works fine and i get my thingspeak channel updated with every HTTP request however , when i use Energia , it doesnt show any error , neither does it show/update my thingspeak channel . I had used Pin 7 and 8 for receiving and transmitting in Arduino . In Msp430 , I have used Pin P3.4 and P3.3 for receiving and transmitting . My Energia code is as follows - #include <SoftwareSerial.h> #include <String.h> SoftwareSerial mySerial(P3_4, P3_3); boolean pin2=LOW,pin3=LOW,pin4=LOW,pin5=LOW,pin6=LOW; float temp=0.0; void setup() { mySerial.begin(9600); // the GPRS baud rate Serial.begin(9600); // the GPRS baud rate pinMode(2,INPUT); pinMode(3,INPUT); pinMode(4,INPUT); pinMode(5,INPUT); pinMode(6,INPUT); delay(1000); } void loop() { temp=analogRead(A0); temp=temp*0.4887; delay(2); Send2Pachube(); if (mySerial.available()) Serial.write(; } void Send2Pachube() { mySerial.println("AT"); delay(1000); mySerial.println("AT+CPIN?"); delay(1000); mySerial.println("AT+CREG?"); delay(1000); mySerial.println("AT+CGATT?"); delay(1000); mySerial.println("AT+CIPSHUT"); delay(1000); mySerial.println("AT+CIPSTATUS"); delay(2000); mySerial.println("AT+CIPMUX=0"); delay(2000); ShowSerialData(); mySerial.println("AT+CSTT=\"aircelgprs\"");//start task and setting the APN, delay(1000); ShowSerialData(); mySerial.println("AT+CIICR");//bring up wireless connection delay(3000); ShowSerialData(); mySerial.println("AT+CIFSR");//get local IP adress delay(2000); ShowSerialData(); mySerial.println("AT+CIPSPRT=0"); delay(3000); ShowSerialData(); mySerial.println("AT+CIPSTART=\"TCP\",\"\",\"80\"");//start up the connection delay(6000); ShowSerialData(); mySerial.println("AT+CIPSEND");//begin send data to remote server delay(4000); ShowSerialData(); String str="GET" + String(temp); mySerial.println(str);//begin send data to remote server delay(4000); ShowSerialData(); mySerial.println((char)26);//sending delay(5000);//waitting for reply, important! the time is base on the condition of internet mySerial.println(); ShowSerialData(); mySerial.println("AT+CIPSHUT");//close the connection delay(100); ShowSerialData(); } void ShowSerialData() { while(mySerial.available()!=0) Serial.write(; }
  7. In my project, I use a few basic macros for GPIO. The goal is, that I can easily redefine pin assignment in a central location without compromising performance or code size. The macros (gpiomacros.h): // MSP430 gpio macros #define GPIO_SEL(port) P ## port ## SEL #define GPIO_DIR(port) P ## port ## DIR #define GPIO_OUT(port) P ## port ## OUT #define GPIO_IN(port) P ## port ## IN #define GPIO_IS_INPUT(port,pin) { GPIO_SEL(port) &= ~(pin); GPIO_DIR(port) &= ~(pin); } #define GPIO_IS_OUTPUT(port,pin) { GPIO_SEL(port) &= ~(pin); GPIO_DIR(port) |= (pin); } #define GPIO_IS_PERIPHERAL_IN(port,pin) { GPIO_SEL(port) |= (pin); GPIO_DIR(port) &= ~(pin); } #define GPIO_IS_PERIPHERAL_OUT(port,pin) { GPIO_SEL(port) |= (pin); GPIO_DIR(port) |= (pin); } #define GPIO_SET(port,pin) { GPIO_OUT(port) |= (pin); } #define GPIO_CLEAR(port,pin) { GPIO_OUT(port) &= ~(pin); } #define GPIO_READ(port,pin) ( GPIO_IN(port) & (pin) ) In a central configuration file (e.g. hardware.h) I assign pins like this: // Pin assignment #define LED1_PIN BIT1 #define LED1_PORT 6 #define LED2_PIN BIT0 #define LED2_PORT 1 And then in the code I interact with GPIO like this: // Setup LEDs GPIO_IS_OUTPUT(LED1_PORT, LED1_PIN); GPIO_IS_OUTPUT(LED2_PORT, LED2_PIN); // Turn off LEDs GPIO_CLEAR(LED1_PORT, LED1_PIN); GPIO_CLEAR(LED2_PORT, LED2_PIN); The macros are resolved in two steps: 1. Higher level "functions" define the commands. E.g. GPIO_SET(), GPIO_IS_OUTPUT(), .. 2. Lower level macros used within those functions translate port, pin to a register. E.g. GPIO_IN(), GPIO_SEL(), .. The end result is code like you would write when directly working with the GPIO registers. E.g. P2OUT &= ~BIT0; Note that this translation is done by the C pre-processor before the code is compiled. This all works fine and dandy, with the exception of port J. Port J doesn't have a SEL register, which breaks the 1st half of the GPIO_IS_OUTPUT and GPIO_IS_INPUT macros. I currently work around this by adding special GPIO_IS_OUTPUT/INPUT_J macros, but then the main code needs to include some logic to invoke the proper macro. #if (LED2_PORT == J) GPIO_IS_OUTPUT_J(LED2_PORT, LED2_PIN); #else GPIO_IS_OUTPUT(LED2_PORT, LED2_PIN); #endif Any ideas, how I could include a condition inside macros, that checks whether the port is J, and if so excludes the GPIO_SEL command? And yes, I could probably use C++ templates with identical results and an easy workaround for port J, but I'd like to avoid migrating my plain old C project. Edit: Added a few missing parentheses, thanks to Rickta59 for spotting that
  8. Hello I have been trying to implement multiceiver on nrf24l01 and msp430g2553. Basically I am trying to use different pipes for the same rf channel. The library and the example code I am using is the spirilis one, one of the most common. The problem is that I can only work with the default pipe 0 given in the code when ever I try to use the other pipes I can't get anything. I read the datasheet about the multiceiver part, I guess I understand both the code and the working mechanism but I still can't use the different pipes. Any help would be appreciated. What I do is that; at first by using msprf24_set_pipe_packetsize() and msprf24_open_pipe functions I set the pipe I would like to use which is from 0 to 5. Then I try for the given addresses on both tx and rx I set it to same pipe number and the same pipe address but only the default(one I posted here) works for the pipe 0 and that given address.
  9. Overview dAISy (do AIS yourself) is a very simple AIS receiver that I developed from scratch. It is built around the Silicon Labs EZRadioPRO Si4362 receiver, using a Texas Instruments MSP430G2553 MCU for processing and the MSP-EXP430G2 v1.5 LaunchPad as development platform. The complete project source code and schematics are available on GitHub: Update 5/18/2015: A finished, self-contained AIS receiver based on this project is now available for purchase on Tindie. AIS, short for Automatic Identification System, is a standard for tracking ships. Ships advertise their position, course and other information with short transmissions on specific frequencies (161.975 MHz and 162.025 MHz). More on Wikipedia. An AIS receiver, like dAISy, receives and decodes AIS transmissions. It then re-packages the raw data into NMEA sentences (specifically formatted ASCII strings). Finally, using a serial connection, these strings are forwarded to more capable equipment for further processing. If you're the lucky owner of a tricked out boat, you could connect dAISy to your navigation computer. For land lobbers like me, a more common use case is to run naval mapping software that supports AIS data input on a PC. In the screenshot below I've connected dAISy to OpenCPN (link), an open source chart plotter and navigation software. On the top right you can see my setup war-driving at the Seattle waterfront as my lab is too far from the coast to receive anything. The LaunchPad sits on the dashboard with a white USB cable connecting to the notebook computer in the foreground. dAISy's data is fed into OpenCPN, bottom right shows a log of the serial data received. OpenCPN maintains a database of all the collected data (lower left) and visualizes nearby ships on a map (top center), including past and projected course. Hovering the mouse over a ship will display its name (text on yellow ground) and clicking it will reveal more detail (top left). Hardware I wanted to build my own, non-SDR, AIS receiver for a long time. There are a few projects floating around the internet (e.g. here) which refer back to an article by Peter Baston, published 2008 in Circuit Cellar magazine (copy available here gone.. google for Peter Baston Circuit Cellar to find other copies). Unfortunately, the CMX family of modem ICs by CMS Microcircuits (link) used in these projects are relatively expensive ($15+) and hard to find for hobbyists. In addition you'd need a radio to do tune into and down-convert from the ~162 MHz carrier frequency. So I was quite excited when earlier this year a parametric search on Mouser brought up a new IC that covered the required range (162 MHz) and modulation (GMSK). And best of all, available in single quantities for $3.56 $2.27 $2.22! (link) The Silicon Labs EzRadioPRO Si4362 (link) is a single chip receiver that covers frequencies from 142 to 1050 MHz and supports various modulations, including GMSK. It comes in a tiny 20-pin QFN package and the only external parts required are a 30 MHz crystal, an antenna with a few capacitors and inductors for impedance matching, and finally some decoupling caps and pull-down resistors. Time to whip up a breakout board. I used the opportunity to give KiCad a try and quite like it. Here's the schematic: And the layout: I used OSHPark to make the PCBs. At a smidgen over one square inch it cost $5.15 for 3 copies: Note that the layout still has three issues that I already fixed in the schematic: GPIO0 and GPIO1 were flipped SDO required a pull-down resistor as the radio leaves it floating when not actively sending, which confused the hell out of me while trying to figure out the communication protocol. Lastly, the holes for the headers turned out to be slightly too small to comfortably fit the cheap breakout headers I had at hand. Edit: Here's Rev B where I fixed these issues: Which brings us to the BOM: Silicon Labs Si4362 (U1) 30 MHz crystal (X1)Si4362 datasheet specifies <11 pF load capacitance, but a crystal specified for 12pF load capacitance seems to work fine too Antenna/LNA matching network, calculated based on SiLabs AN643 (link, approx. values, +/- 5% shouldn't matter too much):75 ohm (dipole): 10 pF (CR1), 5 pF (CR2), 280 nH (LR1), 200 nH (LR2) 50 ohm: 12 pF (CR1), 6 pF (CR2), 240 nH (LR1), 160 nH (LR2) Decoupling caps:100 pF, 100 nF, 1uF (C1, C2, C3) Pull-down resistors100 k (R1, R2) First thing I noticed when I received the parts: The 20-pin QFN at 4x4 millimeters is tiny! I mounted it by first tinning the pads with a small quantity of solder. I then added flux and placed the chip on the pad. I then used a hot air station to carefully reflow the solder. Worked the first time around. After using jumper wires to figure out how to talk to the chip, I mounted the breakout board on a makeshift BoosterPack using perfboard, double-sided tape and wire (see picture at the top of the post). Here's how I ended up connecting the breakout board to the LaunchPad / MSP430G2553: SEL -> P1.4 (SPI chip select) SCLK -> P1.5 (SPI CLK) SDO -> P1.6 (SPI MISO) SDI -> P1.7 (SPI MOSI) GPIO0 -> P2.0 (I/O unused) GPIO1 -> P2.1 (I/O clear-to-send) GPIO2 -> P2.2 (I/O RX clock) GPIO3 -> P2.3 (I/O RX data) SDN -> P2.4 (shutdown / reset) IRQ -> P2.5 (I/O channel-clear) Software The software of dAISy consists of three major blocks: Radio configuration and control over SPI Packet handler, including a basic FIFO for received messages NMEA encoding and transmission to the PC over UART For UART (TX only) and SPI (TX/RX) I use the MSP430G2553's USCI A0 and B0 respectively. In both cases I don't use interrupts which simplifies things considerably. Upon reset the following steps happen: Initialize MSP430 peripherals Initialize packet handler, which will also reset FIFO Initialize and configure of radio, which will also setup SPI Start packet handler, which will also put the radio into receive mode And in the main loop: If debug messages are enabled, poll packet handler for status and errors and report them over UART Check FIFO for new packets If there is a new packet, invoke NMEA processing (which sends the message over serial to the PC) and remove packet from FIFO Below follows a more detailed discussion of the radio integration and the implementation of the packet handler. Radio The communication with the radio is vanilla SPI using 4 wires: MOSI (SDI), MISO (SDO), CLK (SCLK) and CS (SEL). I used the MSP430's USCI B0 to implement SPI and a separate pin to control CS. The only tricky thing to figure out was, that the Si4362 keeps the MISO line floating unless it actively transmits data. This is unfortunate as the master is supposed to poll for a specific response (FF) to detect when the radio is ready to receive more commands. This is easily fixed by adding a weak pull down resistor to SDO. I did this on the board, but it probably also works with using MSP430's internal pull-down. Additional lines I used to control the radio are: SDN to reset the radio CTS, which by default is mapped to the radio's GPIO1, indicating that the radio is ready for the next command While taking up an extra pin, CTS turned out to be much more convenient than the SPI response code to properly time communication flow with the radio. In dAISy, I wait for CTS to go high after each command to ensure the radio completed its task. The communication protocol is quite extensive but well documented: EZRadioPRO API Documentation describes the complete API and all registers AN633 Programming Guide for EZRadioPro Si4x6x Devices describes how to use the API in common scenarios Both are available on the Si4362 product page (link), under Documentation > Application Notes and are still updated quite frequently. The radio is set up by dumping a large configuration sequence into it. This includes configuration of radio frequency, modulation, GPIO pins and more. This information is stored in radio_config.h, which has to be generated with a tool called WDS (Wireless Development Suite). WDS is available in the Tools section on the Si4362 product site. Above are the settings I used for dAISy. WDS will use this information to configure various amplifiers, filters, clocks and decoding algorithms inside the chip. As Si4362 supports GMSK encoding only indirectly (see this thread), I'm certain there's more optimization potential by tweaking registers, but that's currently way beyond my knowledge of RF theory. While the Si4362 comes with its own packet handler, it unfortunately does not support NRZI encoding (Wikipedia). So I set up the radio to expose the 9600 baud clock and received data on separate pins and implemented my own packet handler. Packet Handler The packet handler (inspired by Peter Baston's implementation) is implemented as a state machine that is invoked on each rising edge of pin P2.2 which receives the data clock. There are 5 main states: Off, no processing of incoming data Reset, start from anew, either on start up or after successful/failed processing of a packet Wait for Sync, waiting for a training sequence to arrive (010101..) and start flag (01111110), implemented with its own state machine Reset, start new preamble 0, last bit was a zero 1, last bit was a one flag, training sequence complete, now process start flag Prefetch, ingest the next 8 message bits to ease further processing Receive Packet, process bits until the end flag (01111110) is found or an error situation occurs Independent of state, the interrupt routine continually decodes NRZI into actual bit sequence. In the "Receive Packet" state there's continuous calculation of the packet CRC and some bit-de-stuffing. When the end flag is found and the CRC is correct, the received message is committed into the FIFO. If an error is encountered, the bytes already written to the FIFO are discarded. In both cases, the state machine starts anew by transitioning into RESET. This reads like a lot of code for an interrupt handler. However with the MCU running at 16MHz even the most complex state only uses a fraction (<10%) of the available time. Future Improvements Lastly a list of things I'd like to improve with the next version of dAISy. Software: Receiving on both AIS channels through channel-hopping done 1/5/2014 Tweak radio settings for better sensitivity and lower error rate LED(s) for indicating reception of valid/corrupt packets Hardware: Proper antenna connector Layout PCB as BoosterPack and/or USB dongle Receiving on both AIS channels at once with two radio ICs -- edit 12/25: replaced original post with high-level project description, more detailed documentation of implementation to come -- edit 12/28: added documentation for hardware (here and on Github), fixed some typos -- edit 12/31: added documentation for software and list of future improvements -- edit 01/05: implemented channel hopping (change to state machine) -- edit 01/15: changed state machine to reflect recent changes (see post further down for details), added link to shared project on OSHPark -- edit 01/25: major rework of sync detection state machine
  10. Hello I'm have two problem with the version 18 of energia. 1.- When I try to program my msp430g2553 the IDE show the message: exec: "C:\\Users\\CORE RIKMED\\Downloads\\energia-1.6.10E18\\hardware\\tools\\msp430/bin/msp430-g++": file does not exist Error compilaci
  11. Hello, I'm using MSP430F5131 and trying to program it by IAR Embedded Workbench while using the MSP-FET debugger. A short background of the PCB: After i compiled the code in IAR with not errors found , i connected the MSP-FET to the MSP430 in a Spi-Bi-Wire connection according to the datasheet. The MSP430 is placed in a PCB which includes 12V input voltage and 2 regulators of 5V and 3.3V . The MSP430 I/O's are connected according to the datasheet (including external pullup resistors and capacitors) along with the Spi-Bi-Wire connections. I energized the PCB with a 12V supply voltage , connected the MSP-FET's connector to a Header connector on the PCB and the other side connected to the PC by USB. My problem is : In the IAR , once i try to download the code into the MSP430 (by clicking the 'Download and Debug' button) it says that it needs a firmware update , so i clicked ok and download the new update , but when it tries to initialize hardware i encounter the error : "Fatal error: Could not find device (or device not supported) Session aborted!" I have tried multiple things in order to find the solution - with no success . Does the AVcc and AVss needs to be connected even if i dont use any analog options? coz its not connected to anything. I also tried to download the program to the MSP430 with code composer studio but encounter the same error. Thanks in advance.
  12. Hey dear all, I am new at the website, have been searching for the same issue but couldn't really found. I am trying to drive 2*16 lcd on msp430g2553 with code composer. I am using the library above, It actually works fine with the port connections written. What I am trying to do is I want to transform all the ports into port2. P1.0 - D4 Pin11 to P2.0 P1.1 - D5 Pin12 to P2.1 P1.2 - D6 Pin13 to P2.2 P1.3 - D7 Pin14 to P2.3 P1.4 - RS Pin4 to P2.4 P1.5 - R/W Pin5 to P2.5 P1.6 - E Pin6 to P2.6 The thing I do is that; instead of P1OUT and P1DIR I used P2OUT and P2DIR but it doesn't work, have been trying for a day but no result. Sure that port connections are correct, checked for many times, there must be something I miss about the code. Any help would be appreciated, thank you.
  13. Has anyone been able to find a library or had any success in making their own library for the HX711 for use with Energia. I know there is a link on Github with the header and source files for Arduino but they do not work for me. The link I'm referring to is Thanks for any help!
  14. hello all !! I'd been worked with MSP430G25530 target for Frequency measurment ... I have a code but, when I use the Serial.print (). nothing show up. any helps please ? my code : Freq-Measurment.ino
  15. Hi all, I have recently found a sketch in arduino forum for frequency counting, which I tried running in MSP432 with energia and MSP430 with energia sketch on Code composer studio. The sketch basically counts the frequency using interrupts and prints the frequency on serial monitor but serial monitor is empty while running the program,.The sketch is as shown below, // Frequency counter sketch, for measuring frequencies low enough to execute an interrupt for each cycle // Connect the frequency source to the INT0 pin (digital pin 2 on an Arduino Uno) volatile unsigned long firstPulseTime; volatile unsigned long lastPulseTime; volatile unsigned long numPulses; void isr() { unsigned long now = micros(); if (numPulses == 1) { firstPulseTime = now; } else { lastPulseTime = now; } ++numPulses; } void setup() { Serial.begin(115200); // this is here so that we can print the result pinMode(3, OUTPUT); // put a PWM signal on pin 3, then we can connect pin 3 to pin 2 to test the counter analogWrite(3, 128); } // Measure the frequency over the specified sample time in milliseconds, returning the frequency in Hz float readFrequency(unsigned int sampleTime) { numPulses = 0; // prime the system to start a new reading attachInterrupt(0, isr, RISING); // enable the interrupt delay(sampleTime); detachInterrupt(0); return (numPulses < 3) ? 0 : (1000000.0 * (float)(numPulses - 2))/(float)(lastPulseTime - firstPulseTime); } void loop() { float freq = readFrequency(1000); Serial.println(freq); delay(1000); }
  16. HI If i import my ENERGIA project to CCS V6.1, can i also use the gui composer for the same project? best regards, avi
  17. Hello, Im working with TM1809 RGB LEDs on an MSP430G2553 over SPI (3-wire) data transfer. Im running into issues with timing and im not sure if its due to voltage or something else, and could really use some help. on page 2 says that these lights require 4.5-5.5V, and i know the MSP430 is at 3.3V, is this the reason? My code below achieves the ability to set the RGB LEDs with about 95% success rate, i run into issues attempting to animate the colors or if i send it the same color over and over it will send bad data 5% of the time and fail. If its not the voltage, can someone take a look at my code and let me know if they have any ideas? Thanks for your time! main.c
  18. Hello , I am using MSP430F5131, IAR Workbench compiler and i have purchased MSP-FET. i have successfully compiled my code in IAR Workbench , although when i try to download the program through the MSP-FET using the IAR Workbench (i have clicked on download and debbug and it has started to initialize the device) i encountered this error : Fatal error: Could not find device (or device not supported) Session aborted! Thanks in advance
  19. This project is an offshoot of an earlier investigation of wireless wearables using the MSP430G2553: The concept has been successfully tested and is described below. I plan regular updates as the project progresses. The objective is to develop a wearable powered by a coin cell that can be controlled remotely. It could be used, as an example, in the tiara below or on a costume worn by dancers in a performance and controlled from offstage. In the photo an earlier MSP430G2553 coin cell powered wearable is attached to the tiara and driving 3 WS2812 LEDs. The constraints are: cost - unit cost for the receiver of $10 or less technology - common off the shelf components, MSP430G2553 construction - standard double sided PCB spec, keep SMD parts large enough to be hand soldered power - CR2032 (rated 3V and 225 mAH) life - needs to run at least half an hour on fresh batteries reception - 10m with clear line of sight, update at least every 100 ms transmission - desirable but not required size - 40mm/1.6" diameter for receiver programming - Energia desirable schedule - 6 month completion The transmitter will probably be placed on a "Booster Pack" for a LaunchPad running Energia. Multiple LEDs will be driven to gain extra distance, and if required multiple transmitters could be set up from different angles to assure good reception. A display would be helpful as on the FR6989 shown below with an IR LED. The initial Energia transmission sketch to test the concept is located here: The sketch was developed in Energia V17 using a MSP430G2553 LaunchPad and a 940 nm infrared LED. It loops from 0 to 255 and sends a single byte with the count via infrared to the receiver when a button is pushed. The packets for sending bytes do not follow an existing protocol. It is specific to this application and developed with the goal of getting a byte transmitted at least every 100 ms. The receiver will be a custom MSP430G2553 board powered by a coin cell with a TSOP38238 IR receiver. There will LEDs on the PCB and it will also have the capability to drive LEDs off board. The preliminary receiver code was written in C using CCS and direct register access: . The framework for the code is based on a post by RobG here on 43oh. The receiver takes transmissions from the Energia sketch linked above and outputs the current byte on eight LEDs in binary form. When the last byte is received it clears the LEDs and outputs the number of bytes received in error out of the expected 255. This allows analysis of reception at different distances and conditions. Shown below is the preliminary testing setup. In the foreground is the G2553 receiver with a TSOP38238 and output LEDs on a breadboard. Middle ground is a G2553 with the infrared LED sending bytes. Background is output from the receiver being monitored on an oscilloscope. The output of the TSOP38238 is quite clean and no errors were seen with the transmitter and receiver this close together. Transmission is at approximately 1000 bytes per minute or 16+ bytes/sec which is within the desired range. I subsequently modified the test setup to run off batteries so I could do some preliminary distance testing. With clear line of sight reception I saw no errors up to 5 meters with one transmission LED aimed directly at the receiver. Errors crept in after that, especially if the transmission is off to one side, not pointed directly at the receiver, or at a greater distance. Near term activities: increase the number of transmission LEDs evaluate the impact of off-center transmission further test in an environment that doesn't have reflective surfaces add WS2812 driver capability and investigating the impact of TSOP38238 interrupts on the WS2812 driver evaluate 2032 battery life further
  20. After making the wearable MSP430 for Halloween this year I was requested to make more for a children's dance group. I have a question, but first some background. This is the latest version: Everything works fine. I use an adapter with pogo pins to program it as shown in the photo. There are three LEDs on the PCB, a push button switch for the user, and more accessible pins than the previous version. Parts are TSSOP and 0805 SMD. Snap fasteners and stainless thread can be used to connect it to LEDs on the costume. A CR2032 coin cell is used to power it (coin cell holder is on the backside of the PCB). So far that has been sufficient and the light weight and inconspicuous nature has been advantageous for the small children it is intended for. Now a new upgrade has been requested... add a radio so that multiple units can be synched and/or controlled offstage. Here is a rough list of requirements: must be inexpensive - current materials for 10 units is less than $5. I want to keep it under $10. keep SMD parts large enough to be hand soldered keep using CR2032 (rated 3V and 225 mAH) The MSP430G2553 and LEDs are currently using no more than 20 mA on average - to be safe assume 40 mA Unit needs to run at least half an hour on fresh batteries Unit needs reliable radio reception at 10m with clear line of sight Unit will need to receive only - no transmission. Reception updates required close to continuously - say every 100 ms keep PCB to the same size - 40mm/1.6" diameter needs to be programmable in Energia I have a fair amount of time - 6 months to get it working I have looked at several different radios but the two that I have experience with are the nRF24L01 and CC2650. I am ruling out the CC2650 due to cost. There is a small version of the nRF24L01 that is shown below for scale along with the more commonly seen version: I think I can shift things around and make this fit. Connection is by the castellated edge facing forward on the photograph. The datasheet states 13.5 mA RX at 2Mbps air data rate. That is in the range of what I have seen as well so it looks like it would meet the requirements. Here are my questions: 1) Is there another radio I should be looking at? Maybe one made by Hope. 2) I have no design experience with radios but could I use an off the shelf design and put the radio, bits, and PCB trace antenna on the PCB myself? I would probably have to give on the 0805 parts size criteria. 3) Any other thoughts, comments, and suggestions appreciated. This will be an open source design and anyone who wants to contribute or have the design is welcome EDIT: the material cost is on a per unit basis
  21. Hello , I'm new to this field of microcontroller and i need you quick help with a new project of mine. I'm using MSP430F5131. I will explain a little about the project : My main goal is to generate a 1 pulse per second using a 12.8MHz external oscillator. I already have a printed PCB for that project which means i got to understand what the previous designer had done and implement it into my CCS program in order to program my micro controller. i am still new to this whole microcontroller world and im eager to know more , although im short in time. I have attached an electrical wiring of the PCB to help you understand a little bit more about the project. A little explanation of the electrical wiring: An external toggle switch (from connector J6 "Internal/External Selection") switch between an external 1pps (From an external GPS) or internal 1pps (by the msp430). if we choose an internal mode then (input P2.2) a '1' (or '0' if its an active low mode which is an active low mode) sends from PJ.3 (ouput) to U4 and a 1 pulse per second gets out of P2.4 output to connectors J8 and J9 (same pulse different connectors). I can Switch signals to ON/BAD/OFF by using an external toggle switch(pins 1,2 of J3 connector) or a descrete (pin 3 of J3 connector). if i toggle the switch to on mode it sends '1'(or '0' if its an active low mode which is an active low mode) through P1.6 to U5 ( And Gate) and enables the pulse it also sends '1' through PJ.0 to U6 and converts the pulse from TTL to RS422 (differetial). The descrete switching option switches the pulse (ON/OFF) the same as the external toggle switch. This is refers to PULSE 1 , i need to implement the same thing for PULSE 2. although im still not sure what RST/NMI/SBWTDIO and TEST/SBWTCK are wired for , are these for downloading the program into the msp? im also not sure about the PJ.2 pin (FUNCTIONALITY DISABLE). I know its a lot to read but im really short in time about this project and i dont have much time to study everything. so i would be very glad if you could read the code and help me implement the functions into the code. I know that in the following code i used interupts with #pragma function . although i heard that #pragma function cannot be located in the main function - i need to generate that 1pps pulse in some conditions (which mentioned in the code under 'if' statement) but i cant use that ISR function inside the code so how can i do that? and is there another way of doing that without using interupts that can generate the same 1 pps? here's the code : #include <msp430.h> #include <intrinsics.h> unsigned int timerCount = 0; int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P2OUT &= ~(BIT4); //preload 1pps to '0' // set I/O pins directions P1DIR |=BIT6+BIT7; //set p1.x to 11000000 P2DIR |=BIT4; // Set P2.4 to output direction PJDIR |=BIT0+BIT1+BIT3; // set pj.x output 0000 1011 P2SEL |= BIT4; //select the option of using TD0.0 in pin 2.4 P2IES |= BIT4; // high -> low is selected with IES.x = 1. P2IFG &= ~(BIT4); // To prevent an immediate interrupt, clear the flag for // P1.3 before enabling the interrupt. P2IE |= BIT4; // Enable interrupts for P1.3 // Configure XT1 (external oscillator) PJSEL |= BIT4+BIT5; // port select for xt1 UCSCTL6 &= ~(XT1OFF); //xt1 is on UCSCTL3 = 0; // FLL REFERENCE CLOCK REFERENCE = XT1 // configure TD0.0 to output of 1 pulse per second TD0CCR0=16000-1; // setting TAR count up value 16000 (12.8MHz / 8 = 1.6MHz , 1.6MHz / 100 = 16000 Hz) when 100 is passed means 1 second has passed as well //TD0CCR1= //DUTY CYCLE OF 50% //TD0CCTL1=CCIE + OUTMOD_7; //enabling interuption + RESET/SET OUTPUT MODE TD0CTL0 =MC_2+ID_3+TDSSEL_0+TAIE; //defining timer d TD0.0 (P2.4) __enable_interrupt(); for(;{ // main loop (looping forever) // EXTERNAL / INTERNAL SELECTION BY SW4 if ((P2IN & BIT2)==0){ // INTERNAL MODE PJOUT |=BIT3; // sends '1' from pj.3 output to the multiplexer U4 (uses the internal 1pps) //PULSE 1 : DESCRETE ON/OFF AND SWITCH ON/BAD/OFF if ((P2IN & BIT0)==0 || (P1IN & BIT0)==0) { //NORMAL SIGNAL OF 1PPS checks if descrete source is on or 1pps sw pulse 1 is on P1OUT |= BIT6; //ENABLES PULSE BY THE 'AND' GATE PJOUT |= BIT0; //ENABLES TTL TO RS232 CONVERTER (FOR DIFF OUTPUT) #pragma vector = TIMER0_D0_VECTOR __interrupt void TIMER0_D0(void){ if (++timerCount > 20) { // checks if the incrementation of timerCount reaches 50 (means 0.5 second has passed) P2OUT ^=BIT4; //generates 1pps out of p2.4 timerCount = 0; // resets the timer count } P2IFG &=~(BIT4); // clears the fl } } } else { P1OUT |= ~(BIT6); //DISABLES PULSE BY SENDING A '0' TO THE AND GATE } if ((P1IN & BIT2)==0) { //PULSE 1 BAD SIGNAL ??? // CODE HERE FOR BAD SIGNAL PULSE 1// } //PULSE 2 : DESCRETE ON/OFF AND SWITCH ON/BAD/OFF if ((P2IN & BIT1)==0 || (P1IN & BIT0)==0){ //NORMAL SIGNAL OF 1PPS checks if descrete source is on or 1pps sw pulse 2 is on P1OUT |= BIT7; //ENABLES PULSE BY THE 'AND' GATE PJOUT |= BIT1; //ENABLES TTL TO RS232 CONVERTER (FOR DIFF OUTPUT) #pragma vector = TIMER0_D0_VECTOR //GENERATES 1PPS EVERY 1s __interrupt void TIMER0_D0 (void){ if (++timerCount > 20) { // checks if the incrementation of timerCount reaches 100 (means 1 second has passed) P2OUT ^=BIT4; //generates 1pps out of p2.4 timerCount = 0; // resets the timer count } P2IFG &= ~(BIT4); // clears the fl } } else { P1OUT |= ~(BIT7); //DISABLES PULSE BY SENDING A '0' TO THE AND GATE } if ((P1IN & BIT3)==0){ //PULSE 1 BAD SIGNAL ??? // CODE HERE FOR BAD SIGNAL PULSE 1// } } else { //EXTERNAL MODE PJOUT |= ~(BIT3); //sends '0' from pj.3 output to the multimplexer U4 (uses the external 1pps) P1OUT |= BIT6; // ENABLES PULSE 1 P1OUT |= BIT7; //ENABLES PULSE 2 PJOUT |= BIT0; //ENABLES RS422 DIFF OUTPUT FOR PULSE 1 PJOUT |= BIT1; // ENABLES RS422 DIFF OUTPUT FOR PULSE 2 } } } return 0; Thanks in advance. PCB electrical wiring.pdf
  22. MSP430 based Nixie tube clock. I was looking for some nice Nixie tube digit images so I could add them to my EduKit library, but I couldn't find any usable ones. I decided to just buy few of them and photograph myself. Then I thought that it would be a horrible waste if they just sit in a drawer. So here it is, my first Nixie project since... 1987. This clock will be available as kit, but since this is v1, I will most likely make some adjustments. Any suggestions are welcome.
  23. Hey everyone, I'm trying to interface an MSP-EXP430FR5969 with a GPS+GSM module ( I've been able to send a text message to my mobile using the Arduino, but when I try on Energia 1.6 with the module now plugged into the MSP430 I get compilation errors (mainly due to atof not being declared). Here's the code I am using: #include <stdlib.h> #include <stdio.h> #include "Adafruit_FONA.h" #define FONA_RX 4 #define FONA_TX 3 #define FONA_RST 5 #include <SoftwareSerial.h> SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX); SoftwareSerial *fonaSerial = &fonaSS; Adafruit_FONA_3G fona = Adafruit_FONA_3G(FONA_RST); void setup() { while (!Serial); Serial.begin(115200); fonaSerial->begin(4800); fona.begin(*fonaSerial); sendText(); } void loop() { } void sendText () { char sendto[21]= "04XXXXXXXX"; char message[141] = "Text Text Text Text Text Text Text Text Text Text Text Text"; fona.sendSMS(sendto,message); if (!fona.sendSMS(sendto, message)) { Serial.println(F("Sending message")); } else { Serial.println(F("Sent!")); } } "C:\Users\...\Adafruit_FONA.cpp:909:30: error: 'atof' was not declared in this scope" is the main error I am getting. Any suggestions on how to have this compile please? Thanks in advance
  24. Hi! I would like to interface a combined GPS + GSM module to an MSP-EXP430FR5969 using Energia. The aim is at the press of a button/signal, an SMS is sent with the GPS lat/long coordinates at the time of the press. I am planning to use this module ( to connect it all up. I've seen a lot of Arduino examples on this (e.g. using tinyGPS and softwareSerial) but I'm not sure if this same code will work on the MSP430. Will it? How can I go about changing the Arduino set up/pin definitions so that it'll work on the MSP430 using Energia? Thanks in advance
  25. I'm new to the whole launchpad thing. I have an msp430 I've looked at everything I can to try and get help but I just can't seem to figure out how to get a 2 axis joysticks values and put them into the computer. I want to make a custom controller with my launchpad.