Search the Community

Showing results for tags 'MSP430'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

Calendars

There are no results to display.


Found 250 results

  1. Hi, The new MSP430FR2433 ValueLine Launchpad is with a promotional price. https://e2e.ti.com/blogs_/b/msp430blog/archive/2017/11/08/introductory-price-of-4-30-for-msp430fr2433-mcu-launchpad-kit?HQS=epd-mcu-msp-vline-fb-blog-LPdiscount-wwe&hootPostID=97a463d63a1e96cbf999f3c7a33c703e It seems to be a good replacement to the old ValueLine G2
  2. 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: https://github.com/astuder/dAISy 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: http://oshpark.com/shared_projects/QUWi71r4 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: http://oshpark.com/shared_projects/WI6u3Qmk 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
  3. Hello, I am Laurent. I am an Electronics engineer from France. I would like to explore MSP430's world.
  4. Is there a full energia porting for msp430fr5969, i.e. all the ports and full mcu functionality (timer, spi, i2c etc) rather than limited as per the launchpad? I have msp430fr5969, custom board connected to bunch of sensors and radio and would like to use energia for this. Any directions or suggestions will be most welcome. Thanks
  5. I'm using the latest version of Energia and I'm facing some problems with it. I'm a beginner and I tried running an example program on the MSP430G2553. I get this error which says: Energia: 1.6.10E18 (Windows 8.1), Board: "MSP_EXP430G2553LP" In file included from C:\energia-1.6.10E18\hardware\energia\msp430\cores\msp430/Arduino.h:3:0, from sketch\Blink.ino.cpp:1: C:\energia-1.6.10E18\hardware\energia\msp430\cores\msp430/Energia.h:339:26: fatal error: pins_energia.h: No such file or directory compilation terminated. exit status 1 Error compiling for board MSP_EXP430G2553LP. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. Please help me in getting rid of this error. Thank you!
  6. Hallo guys, I am working on MSP430 and want to use incremental rotary encoder to control the menu, that I will later make. I decide to try to flicker the both LED first to see if I have the right programm to take input from the rotary encoder. I have the A_Output (CLK) and B_Output (DT) on Pins 2.1 and 2.2 #include "msp430g2553.h" char c_P2IN; void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P2OUT |= 0x07; P2REN |= 0x07; P1DIR |= 0x41; // Set P1.0 and P1.6 to output direction P2IE |= 0x07; // P2 (Bit0, Bit1 und Bit2) interrupt enabled P2IFG = 0x00; // P2IFG cleared _BIS_SR(LPM4_bits + GIE); // Enter LPM4 w/interrupt while(1) { c_P2IN = P2IN; //Monitoring the P2IN; } } // Port 1 interrupt service routine #pragma vector=PORT2_VECTOR __interrupt void Port_2(void) { if(P2IFG&BIT1) { if (!(c_P2IN&BIT2)) { P1OUT^= BIT6; _delay_cycles(100); P2IFG = 0x00; } } if(P2IFG&BIT2) { if (!(c_P2IN&BIT21)) { P1OUT^= BIT0; _delay_cycles(100); P2IFG = 0x00; } } } It works for maybe 4-5 turns, and then it doesn't for 2 turns, and for the next few turns it works again. Can you please give me idea how to do it?
  7. I was not able to use realloc using energia so I imported the proyect to CSS v7. It seems there is something wrong or not done about realloc under Energia. CSS v7 is using the Ti compiler instead of GCC and it has realloc and it works. But when using CCSv7 with the imported sketch, the Serial.print commands do nothing. Even If I debug step by step it just ignores Serial.print commands without showing anything anywhere. I activated the serial terminals inside CCSv7 to see the output and I also have the normal output and the console. I can work around if I find a function equivalent to micros() for the CCSv7
  8. I don't know why but my energia is running very slow. All the other apps are running at good speed. I am using windows 10 64-bit version. I am using Energia V17. Pictures from my task manager are attached here, please take a look at it. Thax and peace.
  9. Hello, I am currently working on a project that involves the MSP430F5529LP in conjunction with the Ultimate GPS Breakout module. Right now I using SoftwareSerial in order to read the input from the sensor. The issue that I am having is that the SoftwareSerial library only works with 16MHz processors. Since my MCU runs at 25MHz. I wanted to know if there is a way to make the MCU run at 16MHz. Attached to this post is the code that I currently have running, and the error that I keep getting.
  10. I am currently trying to read a couple of parameters from onboard sensrs on TelosB, then print out on monitor which I am using PuTTY. However, I am not getting any values here. Please could some on hlep me out? I attached my code and corresponding datasheets too THank you 00std_temp.c msp430f1611.pdf telosMote.pdf
  11. Hi All First, I would like to thank @Rei Vilo for providing the Library for the Kentec (BOOSTXL-k350qvg) library with Energia. I copied the code out of https://www.youtube.com/watch?v=XyeUpk6P4kA (as I didn't find the powerpoint or pdf) and got it to work with an MSP430F5529 launchpad. (Energia 18, Windows as the Mac version doesn't work atm). Then I compiled the same code on a MSP432P401R launchpad and it runs a lot slower than on the F5529 (I assume this is a known issue, due to slow SPI speed ( https://github.com/energia/msp432-core/issues/27 ) but also doesn't look the same, the fonts are "skinnier on the MSP432. This discrepancy, I cannot explain. Another question: If I want to write a changing variable, in this case simply the x-coordinate of the touch to the screen, how do I locally clear the screen without redrawing everything (or if I want to make a bar graph that represents eg a changing value of a sensor? Do I always draw a black rectangle, then the bar/text etc? or is there a simpler way that is not immediately obvious to me now? Next step: I have to learn more about state machines to switch screens (settings), do stuff there, come back to main without the program getting into badly readable territory. Thank you very much for your help. //First steps with the Kentec Display #include "SPI.h" #include "Screen_K35_SPI.h" Screen_K35_SPI myScreen; uint16_t colours[6]; uint16_t x; uint16_t y; uint16_t z; uint8_t initFlag; void setup() { Serial.begin(9600); Serial.println(); Serial.println("hello"); Serial.println(); pinMode(RED_LED, OUTPUT); myScreen.begin(); myScreen.clear(); colours[0] = myScreen.calculateColour(255, 0, 0); colours[1] = myScreen.calculateColour(0, 255, 0); colours[2] = myScreen.calculateColour(0, 0, 255); colours[3] = myScreen.calculateColour(255, 255, 255); colours[4] = myScreen.calculateColour(255, 255, 0); colours[5] = myScreen.calculateColour(0, 0, 0); x = 0; y = 0; z = 0; myScreen.setPenSolid(true); myScreen.setFontSolid(false); myScreen.setFontSize(2); initFlag = 1; } void loop() { if (initFlag) { drawHomeScreen(); initFlag = 0; } if (myScreen.isTouch() > 0) { myScreen.getTouch(x, y, z); myScreen.gText(10, 10, btoa(x, 8), colours[3]); Serial.print(x); Serial.print(" "); Serial.print(y); Serial.print(" "); Serial.println(z); } if (z > 100) { if ((x < 160 && x > 0) && (y < 240 && y > 100)) { digitalWrite(RED_LED, HIGH); } else if ((x < 320 && x > 160) && (y > 100 && y < 240)) { digitalWrite(RED_LED, LOW); } else if ((x < 320 && x > 160) && (y > 0 && y < 100)) { drawSettingsScreen(); } } } void drawHomeScreen() { myScreen.clear(); myScreen.gText(30, 50, "TOUCH LCD DEMO", colours[4]); myScreen.rectangle(0, 100, 160, 239, colours[1]); myScreen.gText(50, 180, "ON", colours[0]); myScreen.rectangle(160, 100, 319, 239, colours[0]); myScreen.gText(235, 180, "OFF", colours[1]); myScreen.rectangle(160, 0, 319, 100, colours[2]); myScreen.gText(180, 50, "SETTINGS", colours[3]); } void drawSettingsScreen() { myScreen.clear(); myScreen.gText(10, 10, "TOUCH LCD DEMO", colours[0]); myScreen.gText(10, 30, "TOUCH LCD DEMO", colours[1]); myScreen.gText(10, 50, "TOUCH LCD DEMO", colours[2]); myScreen.gText(10, 70, "TOUCH LCD DEMO", colours[3]); myScreen.gText(10, 90, "TOUCH LCD DEMO", colours[4]); }
  12. Hi all, I am currently just trying to upload a example sketch to my MSP430G2553, all i'm getting is a compile error. The github library is; https://github.com/ibm666/ILI9341libraryforEnergiaMSP430Launchpad what im getting error wise is; In file included from D:\energia-1.6.10E18\libraries\ili9341-arduino-master\examples\drawNumber\drawNumber.ino:8:0: D:\energia-1.6.10E18\libraries\ili9341-arduino-master/TFTv2.h:33:17: fatal error: SPI.h: No such file or directory compilation terminated. Using library ili9341-arduino-master in folder: D:\energia-1.6.10E18\libraries\ili9341-arduino-master (legacy) exit status 1 Error compiling for board MSP-EXP430G2 w/ MSP430G2553. Can anyone tell me what i'm doing wrong? I can upload examples from the SPI library so im assuming it cant be that?! HELP!!! PLEASE!!!
  13. Hi, I'm working in this library with some useful DSP and math functions (ideally focusing on embedded systems). Currently it's in the initial version with few functions, but I hope to add more in the next update. I prefered to use some structs to save parameters and use just one function to various instances of filters (very versatile). Functions - High Pass Filter (Single pole): Float, fixed and fixed extended version (with more bits to fractional part) - Low Pass Filter (Single Pole): Float, fixed, fixed extended and fixed fast (with some limitations related to cuttof frequency, but more efficienty. - RMS value: calculate RMS value of an array or sample by sample. Currently using square root function of math.h, but in the next update I will add a optimized version. I hope this can be useful. Feel free to test, share and contribute with this project. Github: https://github.com/agaelema/DSP_and_Math
  14. Dear developers, I am simply using Serial.println(); command, but I get some weird characters in the serial port display window. Code : #include <Wire.h> // HIH6130 I2C address is 0x27(39) #define Addr 0x27 int tzero = 196; int tspan = 17; int hzero = 196; int hspan = 17; void setup() { Wire.setModule(1); Wire.begin(); pinMode(P1_3,OUTPUT); pinMode(P1_2,OUTPUT); pinMode(P1_6,OUTPUT); Serial.begin(9600); Serial.println("OK"); delay(300); } void loop() { unsigned int data[4]; // Start I2C Transmission Wire.beginTransmission(Addr); // Select data register Wire.write(0x00); // Stop I2C Transmission Wire.endTransmission(); // Request 4 bytes of data Wire.requestFrom(Addr, 4); // Read 4 bytes of data // humidity msb, humidity lsb, temp msb, temp lsb if (Wire.available() == 4) { data[0] = Wire.read(); data[1] = Wire.read(); data[2] = Wire.read(); data[3] = Wire.read(); } // Convert the data to 14-bits float humidity = ((((data[0] & 0x3F) * 256) + data[1]) * 100.0) / 16383.0; float temp = ((data[2] * 256) + (data[3] & 0xFC)) / 4; float cTemp = (temp / 16384.0) * 165.0 - 40.0; // Output data to serial monitor Serial.print("Relative Humidity :"); Serial.println(humidity); Serial.println(" %RH"); Serial.print("Temperature in Celsius :"); Serial.println(cTemp); Serial.println(" C"); Serial.println("=============================================================== "); int VcTemp = map(cTemp, -5, 125, tzero, tspan ); int vhumidity = map (humidity, 0, 100, hzero, hspan); analogWrite(P1_2, VcTemp); analogWrite(P1_6, vhumidity); delay(1000); } Serial Output : (in one single line, means it keeps printing these characters in just one line on and on.picture : Thax.
  15. Hello everyone, I have a project which requires GPS + Wi-fi capability and fastest clock speed mcu possible. For GPS capability I came across CC4000 which seems alright, but I'm confused on which launchpad board to select that has Wifi capability also. I have worked on Arduino but new to TI's Launchpad. Please suggest me for what should I buy. link for the CC4000 gps module kit : http://www.ti.com/tool/cc4000gpsem?keyMatch=gps&tisearch=Search-EN-Everything#descriptionArea
  16. Hello again, I am trying to connect up 2 MSP430FR4133 using the slave_sender and Master_reader examples in the energia given examples. There is no information about which pins to use but RXD and TXD are the only pins outputting on the scope so i have tried these pins. I have also tried connecting up the pins that say they are for SPI on the pin layout to no success. Any help would be greatly appreciated. Kind regards, Chris
  17. After joining this forum over 3 years ago I thought it overdue that I say hello and contribute something that I hope you will find useful. Attached is a picture of simple booster packs that I make. But are they really a "booster pack"? Hmmm. Debatable! They are cheap and easy to make and I have made 5 of them. I use them all the time because the whole of each project, including the MSP430, is attached to the booster pack. This means I can switch between projects without re-wiring, I can change the model of MSP430 in seconds and I only need one Launchpad. You can see from the picture that I provide two sets of header pins to attach "stuff" to, but provide four header pins for the 3.3V and GND. I also use long-leaded header plugs, partly because I have to solder the strip boards "upside down" (notice the small gap between the strip board and the header sockets) and also because the excess leads are easily accessible test points for things like logic analysers, etc. I keep the strip board to the smallest possible size so that all the Launchpad jumpers remain accessible. I've tried different designs, some with LEDs, switches, small breadboards and more besides, but this is the one I use all the time. I call it a "pop top" because you pop the top off a launchpad and swap it for another, then another. That's all for now. Hopefully it'll not be another 3 years before my next posting!
  18. Hey everyone, I am trying to reduce the power consumption of my msp430FR4133 by reducing the clock speed from 8MHZ. I am using the http://annem.github.io/ADXL362/ example code as a base which sets the default clock speed to 8MHZ. I have read that the Wiring.c file defines the clock speed but I cannot find where F_CPU is defined. Any help would be greatly appreciated thanks.
  19. Hi, Wondering if anyone can confirm if the MSP430 source code listed in this article can indeed be used with Energia (IDE and library) ? Idea being mixing Energia library for AnalogRead and SPI data sending capability. Also, I'd like to use the LP with MSP430G2553 to perform ADC for 6-8 channels, and convey the same to RaspberryPi over SPI using this mechanism. Given the very limited RAM on MSP430G2553, what is the likelihood of being able to squeeze in such functionality along with the SPI communication ? Pointers to any existing projects at achieving similar goals, would be highly appreciated. regards, BD
  20. Hi, These after read this thread about how to use temperature calibration data, I tried to use TLV register to obtain the "real" voltage reference value and increase the ADC conversion by compensating the gain and offset. The test was performed in a Launchpad EXP430FR6989, but can be applied to other launchpads compatible with MSP430Ware driverlib. The increase in the accuracy is very interesting. in the table (sorry by the comma instead of point, brazilian notation). HP 3478A - value measured with DMM ADC_correct1 - value measured with MSP430 without any correction ADC_correct4 - with all corrections using float variables ADC_correct5 - using mainly integer Here there is an article about this test and the Github with the example. Regards
  21. I am developing a timeout / soft timer library for the MSP43x and would like to share it with you. It's still in the initial version, but all the functions are working. I'm developing and testing on MSP430F6736, but it worked fine on launchpad EXP430F5529LP. The library uses a timer to periodically generate ticks. In the base version developed by Felipe Lavratti, the timer-tick occur every 1us through a 32-bit timer (ARM Cotex). To avoid overloading the CPU I modified the code to accept longer time intervals and also functions to automatically calculate the Capture / Compare value of the timer. I also tried to isolate the timer configuration in a separate file, so in the future it would allow to select from more than one timer source or different devices, perhaps with compatibility with the old Value Line uCs. How the objective is not to give a perfect time base in us, I'm using ticks of 100us (10kHz) and works very well. The library has delay, getTime, and Timeout functions, the latter two of which are interesting for managing tasks without holding down processing like a normal delay. The example using the EXP430F5529LP use delay_Ms function to toggle 4 times both leds, geTime_ms() to toggle LED1 every 234ms and timeoutCheck_ms() to toggle LED2 every 1s. Feel free to leave your opinions and contribute to the project - Github of project Thank you.
  22. I'm new to MSP430 and I'm trying to do a frequency/period measurement. I've read about timers and get the main concepts though I'm still learning. To get an idea of how they work, I'm using this code. It outputs a PWM on one pin which I connect to another pin for capturing period: http://coecsl.ece.illinois.edu/ge423/datasheets/MSP430Ref_Guides/Cexamples/MSP430G2xx3 Code Examples/C/msp430g2xx3_ta_21.c After making some modifications (removing unneeded code to light led and adding calculations for frequency) it works with the original pins. However, I want to change which input pin will take measurements. I want pin 2.0 to do so. Currently, TimerA0 captures and TimerA1 outputs PWM. Since PIN 2.0 uses TimerA1 and not A0, I assumed I would just need to flip the timers and pins. However, it's not working. I looked at the datasheet and can't figure out whats wrong. What am I missing? Here is my code: #include <msp430.h> unsigned char Count, First_Time; unsigned int REdge1, REdge2, FEdge; int main(void) { unsigned int Period, ON_Period; unsigned char DutyCycle; WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer // P1SEL |= BIT0; if (CALBC1_8MHZ==0xFF) // If calibration constant erased { while(1); // do not load, trap CPU!! } DCOCTL = 0; // Select lowest DCOx and MODx settings BCSCTL1 = CALBC1_8MHZ; // Set DCO to 8MHz DCOCTL = CALDCO_8MHZ; // Configure Port Pins P1DIR |= BIT2; // P2.1/TA1.1 Output P1SEL |= BIT2; // TA1.1 Option select P2DIR &= ~BIT0; // P1.1/TA0.1 Input Capture P2SEL |= BIT0; // TA0.1 option select // Configure TA1.1 to output PWM signal // Period = 82/32khz = 2.5ms ~ 400Hz Freq TA0CCR0 = 82-1; // Period Register TA0CCR1 = 21; // TA1.1 25% dutycycle TA0CCTL1 |= OUTMOD_7; // TA1CCR1, Reset/Set TA0CTL = TASSEL_1 + MC_1 + TACLR; // ACLK, upmode, clear TAR // Configure the TA0CCR1 to do input capture TA1CCTL1 = CAP + CM_3 + CCIE + SCS + CCIS_0; // TA0CCR1 Capture mode; CCI1A; Both // Rising and Falling Edge; interrupt enable TA1CTL |= TASSEL_2 + MC_2 + TACLR; // SMCLK, Cont Mode; start timer // Variable Initialization Count = 0x0; First_Time = 0x01; while(1) { __bis_SR_register(LPM0_bits + GIE); // Enter LPM0 __no_operation(); // For debugger // On exiting LPM0 if (TA1CCTL1 & COV) // Check for Capture Overflow while(1); // Loop Forever Period = REdge2 - REdge1; // Calculate Period ON_Period = FEdge-REdge1; // On period DutyCycle = ((unsigned long)ON_Period*100/Period); } } // TA0_A1 Interrupt vector #pragma vector = TIMER1_A1_VECTOR __interrupt void TIMER1_A1_ISR (void) { switch(__even_in_range(TA1IV,0x0A)) { case TA1IV_NONE: break; // Vector 0: No interrupt case TA1IV_TACCR1: // Vector 2: TACCR1 CCIFG if (TA1CCTL1 & CCI) // Capture Input Pin Status { // Rising Edge was captured if (!Count) { REdge1 = TA1CCR1; Count++; } else { REdge2 = TA1CCR1; Count=0x0; __bic_SR_register_on_exit(LPM0_bits + GIE); // Exit LPM0 on return to main } if (First_Time) First_Time = 0x0; } else { // Falling Edge was captured if(!First_Time) { FEdge = TA1CCR1; } } break; case TA1IV_TACCR2: break; // Vector 4: TACCR2 CCIFG case TA1IV_6: break; // Vector 6: Reserved CCIFG case TA1IV_8: break; // Vector 8: Reserved CCIFG case TA1IV_TAIFG: break; // Vector 10: TAIFG default: break; } } I checked and there is a pulse going into P2.0 but P2.0 is not capturing it. Is it just not possible with this pin or am I missing something obvious?
  23. I have the chip number MSP430FR6989 and I want to use it to read 10 analog DC signals then do some processing (multiply them by certain factors) after that I want to convert them back to analog using PWM and RC filter, my issue is in the second part , how to use timers( set period , duty cycles) of the MSP430 to produce PWMs from the analog inputs. This is the code: #include <msp430.h> #define ACLK 0x0100 // Timer ACLK source #define UP 0x0010 // Timer UP mode #define ENABLE_PINS 0xFFFE // Required to use inputs and outputs #define ENABLE_PINS 0xFFFE // Enables inputs and outputs void ADC_SETUP(void); // Used to setup ADC12 peripheral const int x1=1; const int x2=1; volatile int multiplied_value,duty; main() { PM5CTL0 = ENABLE_PINS; // Enable inputs and outputs P1DIR =BIT0; // Set RED LED to output ADC_SETUP(); // Sets up ADC peripheral while(1) { ADC12CTL0 = ADC12CTL0 | ADC12ENC; // Enable conversion ADC12CTL0 = ADC12CTL0 | ADC12SC; // Start conversion while ( ADC12BUSY == 1){ multiplied_value = (ADC12MEM0); if (multiplied_value > 0x800) // If input > 1.65V { P1OUT = BIT0; // Turn on red LED } else // Else input <= 1.65V { P1OUT = 0x00; // Turn off red LED } P1DIR |= BIT5; // P1.5 to output P1SEL1 |= BIT5; // P1.5 to TA0.1 TA0CCTL1 = OUTMOD_7; // CCR1 reset/set TA0CCR1 = multiplied_value*65536/3.3 ; duty=TA0CCR1;// CCR1 PWM duty cycle TA0CCR0 =1000; // PWM Period TA0CTL = TASSEL_2 + MC_1; // SMCLK, up mode _BIS_SR(LPM0_bits); // Enter LPM0 } } } void ADC_SETUP(void) { #define ADC12_SHT_16 0x0200 // 16 clock cycles for sample and hold #define ADC12_ON 0x0010 // Used to turn ADC12 peripheral on #define ADC12_SHT_SRC_SEL 0x0200 // Selects source for sample & hold #define ADC12_12BIT 0x0020 // Selects 12-bits of resolution #define ADC12_P92 0x000A // Use input P9.2 for analog input //#define ADC12_P43 0x000A //#define ADC12_P32 0x000A //#define ADC12_P93 0x000A //#define ADC12_P14 0x000A //#define ADC12_P20 0x000A //#define ADC12_P41 0x000A ADC12CTL0 = ADC12_SHT_16 | ADC12_ON ; // Turn on, set sample & hold time ADC12CTL1 = ADC12_SHT_SRC_SEL; // Specify sample & hold clock source ADC12CTL2 = ADC12_12BIT; // 12-bit conversion results ADC12MCTL0 = ADC12_P92; // P9.2 is analog input //ADC12MCTL1 = ADC12_P43; } I have the voltmeter, when I measure the frquency at the pin1.5 it gives me a number reanges between 14kHz to 0.11.. I'm not sure if I used PWM correctly?
  24. Hi, I am using MSP430 launchpad with G2553 controller. When I am using sleep(5000), and varying the voltage on the controller from 3v to 4v the timing is varying based on the voltage, but the timing in not changing when I am using delay(5000) when I am varying voltage. Any help will be appreciated. Regards,
  25. 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