Search the Community

Showing results for tags 'msp430f5529'.



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 44 results

  1. Hello Everybody, I am using a MSP430F5529 Launchpad with Energia IDE in order to measure the current flowing on the motor. But I have a problem with sampling rate. The current that I want to measure has a 22kHz frequency and I have a 10kHz sampling rate. I would like to have a 200kHz sampling frequency. I found in an other topic that the sampling rate can be reduce because of the serial.print. So, I stored my values in a array before displaying them. i have a better sampling (10kHz) but not enough. Could you tell me how can I improve the sampling rate ? Attached the sketch. Thank you. Sketch Current Measurement .txt
  2. I am storing data in program memory using PROGMEM, and reading it using pgm_read_byte() and pgm_read_word(), to save RAM. However, the compiler gives warnings: In function 'int lookupnumber(int)': warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] I've read that it's not good practice to ignore these warnings, but I can't see how to eliminate them. A demonstration program is: const int numbers[] PROGMEM = { 2, 3, 5, 7, 11, 13, 17, 23 }; int lookupnumber (int i) { return pgm_read_word(&numbers[i]); } void setup() { Serial.begin(9600); } void loop() { Serial.println(lookupnumber(4)); for (;;); } Thank you.
  3. I am trying to set up a watchdog timer on the MSP430F5529 LaunchPad, and I can't seem to get it to work. My code is: void watchdogenable (int interval) { WDTCTL = WDTPW | WDTCNTCL | interval; } void watchdogreset () { WDTCTL = WDTPW | WDTCNTCL | (WDTCTL & 0x07); } void setup() { Serial.begin(9600); Serial.println("Start"); watchdogenable(1); } int count = 0; void loop() { Serial.println(count++); delay(1000); } It prints: Start 0 and then gets no further before being reset by the watchdog 8 seconds later. I would expect it to count up to 8. If I take out the delay() statement it seems to work properly. Any suggestions?
  4. Nick Gammon published an interesting post on using SPI on 16 MHz Arduinos to run WS2812 LEDs (aka neopixels) at: http://gammon.com.au/forum/?id=13357. He also provides a link with a lot of information about the NRZ protocol used by the WS2812 and tolerances: https://wp.josh.com/2014/05/13/ws2812-neopixels-are-not-so-finicky-once-you-get-to-know-them/. The tolerances are actually quite a bit looser than what I previously believed. So, I set out to do something similar with Energia and LaunchPads running at different speeds. Spoiler alert: It works. The previously linked articles provide all the background so minimal information is repeated here. NRZ is a one wire protocol that transfers information to the LEDs by varying the length of the signal when high. A longer pulse is used for a 1, and a shorter one for a 0. The timing, with tolerances, is shown in the figure below. The length between pulses cannot exceed about 5 us and most everything else is pretty loose. The protocol is implemented using SPI which I find pretty clever. A byte is sent out with the SPI module with the proper length to represent the desired bit for the protocol. The following must be determined and set to do this: Set proper SPI clock speed using SPI.setClockDivider() in Energia Determine the proper byte to send by SPI.transfer() in Energia to represent a 0 or 1 bit For example, using the MSP430F5529: Clock speed is 25.6 MHz Setting the SPI clock divider to 4 gives a SPI clock of 6.4 MHz and since the SPI block executes in one cycle (Arduino executes in 2), each bit in the byte is equivalent to 156.25 ns. Therefore, to send a pulse indicating a "1", a byte equal to 0b1111000 could be used which gives 4x156.25 = 625 ns. This is in the acceptable range of 550 to 850 ns. Similarly, for a 0 an acceptable byte would be 0b11000000 or 312.5 ns. A similar process can be used to determine acceptable values for the MSP430G2553. The sketch below is a simplification of the library presented by Nick which and includes the modifications described above to run on both the G2553 and F5529. The preprocessor is used to set appropriate values for the clock divider and long and short bytes. The functions are very nearly the same as posted by Nick. Note that interrupts must be disabled before sending data and then reenabled manually after. /* * WS2812 display using SPI on various TI LaunchPads with Energia * * Connections: * LaunchPad LED Strip * --------- --------- * 3V3 5VDC * Pin 15 (MOSI) DIN * GND GND * * How to use: * ledsetup (); - Get ready to send. * Call once at the beginning of the program. * sendPixel (r, g, ; - Send a single pixel to the string. * Call this once for each pixel in a frame. * Each colour is in the range 0 to 255. Turn off * interrupts before use and turn on after all pixels * have been programmed. * show (); - Latch the recently sent pixels onto the LEDs . * Call once per frame. * showColor (count, r, g, ; - Set the entire string of count Neopixels * to this one colour. Turn off interrupts before use * and remember to turn on afterwards. * * Derived from NeoPixel display library by Nick Gammon * https://github.com/nickgammon/NeoPixels_SPI * With ideas from: * http://wp.josh.com/2014/05/13/ws2812-neopixels-are-not-so-finicky-once-you-get-to-know-them/ * Released for public use under the Creative Commons Attribution 3.0 Australia License * http://creativecommons.org/licenses/by/3.0/au/ * * F Milburn November 2016 * Tested with Energia V17 and WS2812 8 pixel strip on launchpads shown below. */ #include <SPI.h> #if defined(__MSP430G2553) #define SPIDIV SPI_CLOCK_DIV2 // 16 MHz/2 gives 125 ns for each on bit in byte #define SPILONG 0b11111100 // 750 ns (acceptable "on" range 550 to 850 ns) #define SPISHORT 0b11100000 // 375 ns (acceptable "on" range 200 to 500 ns) #elif defined(__MSP430F5529) #define SPIDIV SPI_CLOCK_DIV4 // 25.6 MHz/4 gives 156.25 ns for each on bit in byte #define SPILONG 0b11110000 // 625 ns (acceptable "on" range 550 to 850 ns) #define SPISHORT 0b11000000 // 312.5 ns (acceptable "on" range 200 to 500 ns) #else #error This microcontroller is not supported #endif const unsigned int PIXELS = 8; // Pixels in the strip void setup (){ ledsetup(); } void loop (){ // Show a solid color across the strip noInterrupts(); // no interrupts while sending data showColor (PIXELS, 0xBB, 0x22, 0x22); // single color on entire strip interrupts(); // interrupts are OK now delay(1000); // hold it for a second // Show a different color on every pixel noInterrupts(); // no interrupts while sending data sendPixel(0xBB, 0x00, 0x00); // red sendPixel(0x00, 0xBB, 0x00); // green sendPixel(0x00, 0x00, 0xBB); // blue sendPixel(0xBB, 0xBB, 0xBB); // white sendPixel(0xBB, 0x22, 0x22); // pinkish sendPixel(0x22, 0xBB, 0x22); // light green sendPixel(0x22, 0x22, 0xBB); // purplish blue sendPixel(0x00, 0x00, 0x00); // pixel off interrupts(); // interrupts are OK now delay(1000); // hold it for a second } // Sends one byte to the LED strip by SPI. void sendByte (unsigned char { for (unsigned char bit = 0; bit < 8; bit++){ if (b & 0x80) // is high-order bit set? SPI.transfer (SPILONG); // long on bit (~700 ns) defined for each clock speed else SPI.transfer (SPISHORT); // short on bit (~350 ns) defined for each clock speed b <<= 1; // shift next bit into high-order position } // end of for each bit } // end of sendByte // Set up SPI void ledsetup(){ SPI.begin (); SPI.setClockDivider (SPIDIV); // defined for each clock speed SPI.setBitOrder (MSBFIRST); SPI.setDataMode (SPI_MODE1); // MOSI normally low. show (); // in case MOSI went high, latch in whatever-we-sent sendPixel (0, 0, 0); // now change back to black show (); // and latch that } // end of ledsetup // Send a single pixel worth of information. Turn interrupts off while using. void sendPixel (unsigned char r, unsigned char g, unsigned char { sendByte (g); // NeoPixel wants colors in green-then-red-then-blue order sendByte (r); sendByte (; } // end of sendPixel // Wait long enough without sending any bits to allow the pixels to latch and // display the last sent frame void show(){ delayMicroseconds (9); } // end of show // Display a single color on the whole string. Turn interrupts off while using. void showColor (unsigned int count, unsigned char r , unsigned char g , unsigned char { noInterrupts (); for (unsigned int pixel = 0; pixel < count; pixel++) sendPixel (r, g, ; interrupts (); show (); // latch the colours } // end of showColor The timing, when checked on a logic analyzer, checks out with the calculations above (hooray for math). The "gaps" between pulses are within tolerance and largely set by code overhead as well as the byte being sent. And here it is showing the strip lit up in one color. I tried this on several other LaunchPads I had handy and here is a summary: FR6989 - I had never noticed, but Energia defaults to 8 MHz. Doing the math, there isn't a good match to the WS2812 requirements without changing processor speed (which I did not try). MSP432 - there was behavior I couldn't explain, probably due to RTOS and I didn't pursue this for long. In summary, the method works although I did limited experimentation. It would be even easier to implement outside of Energia with full access to clocks. It was an interesting exercise but alternative methods have been posted here on 43oh with tuned assembler and having used those successfully in the past, I will probably continue to preferentially use them in the future.
  5. hello all, i am working currently with MSP430F5529 launch pad and looking for SD card library for data logging purpose. i already checked out few libraries which are given on Github. i have added one library to my Energia software. and got following errors In file included from C:\Users\hp-pc\Documents\Energia\libraries\SD-master/utility/Sd2Card.h:26:0, from C:\Users\hp-pc\Documents\Energia\libraries\SD-master/utility/SdFat.h:29, from C:\Users\hp-pc\Documents\Energia\libraries\SD-master/SD.h:25, from C:\Users\hp-pc\Documents\Energia\libraries\SD-master\examples\Datalogger\Datalogger.ino:24: C:\Users\hp-pc\Documents\Energia\libraries\SD-master/utility/Sd2PinMap.h:371:2: error: #error Architecture or board not supported. exit status 1 Error compiling for board MSP-EXP430F5529LP. can anyone help out for this.
  6. My compact Lisp interpreter, uLisp, now supports the MSP430F5529 and MSP430FR5969 LaunchPads. As well as supporting a core set of Lisp functions, uLisp includes Arduino/Energia extensions, making it ideal as a control language for the MSP430. For more information see http://www.ulisp.com/.
  7. Hi i would like to do a nfc reader using dlp7970 and msp 430f5529. How do i get the library if i want to code in energia regards durga
  8. I am using DLP-7970ABP and MSP430F5529. I downloaded the example file from http://www.ti.com/tool/dlp-7970abp#Technical Documents. The target configuration of the source code and my board was different. When i attempt to change the target configuration, an error pops up. i am not sure how to rectify the error. Thanks
  9. Hello all I am almost done with my project due to all your help Posting probably the last query I am trying to download library for external eeprom connected using i2c to my msp430f5529 launch pad. The entire library is available on github As github recently updated the website i cannot download the new libraries. Can anyone help me out by providing some other sources for this library. Library i am searching is External eeprom using i2c for msp430f5529 launch pad Thanks and regards
  10. Hello Forums I am trying to use GUI Composer v2 (on the cloud) to create a GUI for a battery managment system, similar to the one in the SLAA478 Application Report, using the MSP-EXP430F5529LP and bq76PL536EVM-3. I've decided to use USB/Serial comms, which requires me to modify the code to send the information using JSON. I am following the example of using USB/Serial IO: https://dev.ti.com/gc/designer/help/Tutorials/Serial/index.html. The code given is as follows: #include <aJSON.h> // most launchpads have a red LED #define LED RED_LED //see pins_energia.h for more LED definitions void printled_statewithjson(int state){ aJsonObject* root = aJson.createObject(); if (root == NULL) { return; } aJson.addItemToObject(root, "LED", aJson.createItem(state)); char* string = aJson.print(root); if (string != NULL) { Serial.println(string); free(string); } aJson.deleteItem(root); } // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(LED, OUTPUT); Serial.begin(9600); } // the loop routine runs over and over again forever: void loop() { digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level) printled_statewithjson(1); // print json object with LED status set to 1 to UART delay(1000); // wait for a second digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW printled_statewithjson(0); // print json object with LED status set to 0 to UART delay(1000); // wait for a second } I am trying to fully understand this example code, before implementing it into my program. Using CCS Cloud, I stepped through the program in debug mode. From what I understand, the loop() function is essentially the main function, which blinks the LED; setup() does as expected and initializes the MCU LED pin, and opening a serial port at 9600 baud rate. I cannot, however, understand the printled_statewithjson() function. How exactly does it work to be able to send the information? Regards
  11. Hello all I just joined this forum. I am working on aa product which requires rtc time stamp and flash to store some variables Can anybody provide me some libraries related to internal rtc of msp430f5529 and how to write integers to msp flash Also if anyone can provide me library to write anything flash like integers characters etc
  12. Energia and Arduino users eventually get to the point where they need more direct access to the hardware if they take on more complicated projects. In addition to the direct access of registers using the provided header files, TI offers DriverLib which contains abstractions for accessing the peripherals. To better understand the peripherals, and to check out DriverLib, I recently created 20+ short examples for my own edification. All of them were written for the MSP430F5529 LaunchPad and most of the peripherals are covered. In some cases pushbuttons, LEDs, resistors, potentiometer, etc. are required that you probably have on hand. A multimeter is required, and in some cases an oscilloscope and logic analyzer are instructive but not necessary. DriverLib SPI Example 13A_USCI_B_SPI_MCP41010_digiPot All of the examples are located here: https://github.com/fmilburn3/MSP430F5529_driverlib_examples It is necessary to have some understanding of the registers before using DriverLib because the DriverLib documentation doesn't describe how the peripherals and their registers work. The documentation for registers is located in the User
  13. Hello, I am trying to interface mlx90614 IR temperature sensor with MSP430f5529. Initially i interfaced this sensor with arduino uno without any problem. I could even fetch object and ambient temperature. But when it came to interfacing with MSP430 board using i2c. Kindly guide me for this. Regards.
  14. Hello! I am using Energia 17 & 18 to code for the MSP430F5529 and ADXL345. The following is the code I used. //Add the SPI library so we can communicate with the ADXL345 sensor #include <SPI.h> //Assign the Chip Select signal to pin 2. int CS = 2; //This is a list of some of the registers available on the ADXL345. //To learn more about these and the rest of the registers on the ADXL345, read the datasheet! char POWER_CTL = 0x2D; //Power Control Register char DATA_FORMAT = 0x31; char DATAX0 = 0x32; //X-Axis Data 0 char DATAX1 = 0x33; //X-Axis Data 1 char DATAY0 = 0x34; //Y-Axis Data 0 char DATAY1 = 0x35; //Y-Axis Data 1 char DATAZ0 = 0x36; //Z-Axis Data 0 char DATAZ1 = 0x37; //Z-Axis Data 1 //This buffer will hold values read from the ADXL345 registers. char values[10]; //These variables will be used to hold the x,y and z axis accelerometer values. long x,y,z; void setup(){ //Initiate an SPI communication instance. SPI.begin(); //Configure the SPI connection for the ADXL345. SPI.setDataMode(SPI_MODE3); //Create a serial connection to display the data on the terminal. Serial.begin(115200); Serial.println("GO!"); //Set up the Chip Select pin to be an output from the Arduino. pinMode(CS, OUTPUT); //Before communication starts, the Chip Select pin needs to be set high. digitalWrite(CS, HIGH); //Put the ADXL345 into +/- 4G range by writing the value 0x01 to the DATA_FORMAT register. writeRegister(DATA_FORMAT, 0x00); //Put the ADXL345 into Measurement Mode by writing 0x08 to the POWER_CTL register. writeRegister(POWER_CTL, 0x08); //Measurement mode } void loop(){ //Reading 6 bytes of data starting at register DATAX0 will retrieve the x,y and z acceleration values from the ADXL345. //The results of the read operation will get stored to the values[] buffer. readRegister(DATAX0, 6, values); //The ADXL345 gives 10-bit acceleration values, but they are stored as bytes (8-bits). To get the full value, two bytes must be combined for each axis. //The X value is stored in values[0] and values[1]. x = ((long)values[1]<<8)|(long)values[0]; //The Y value is stored in values[2] and values[3]. y = ((long)values[3]<<8)|(long)values[2]; //The Z value is stored in values[4] and values[5]. z = ((long)values[5]<<8)|(long)values[4]; //Print the results to the terminal. Serial.print(x); Serial.print('\t'); Serial.print(y); Serial.print('\t'); Serial.println(z); delay(100); } //This function will write a value to a register on the ADXL345. //Parameters: // char registerAddress - The register to write a value to // char value - The value to be written to the specified register. void writeRegister(char registerAddress, char value){ //Set Chip Select pin low to signal the beginning of an SPI packet. digitalWrite(CS, LOW); //Transfer the register address over SPI. SPI.transfer(registerAddress); //Transfer the desired register value over SPI. SPI.transfer(value); //Set the Chip Select pin high to signal the end of an SPI packet. digitalWrite(CS, HIGH); } //This function will read a certain number of registers starting from a specified address and store their values in a buffer. //Parameters: // char registerAddress - The register addresse to start the read sequence from. // int numBytes - The number of registers that should be read. // char * values - A pointer to a buffer where the results of the operation should be stored. void readRegister(char registerAddress, int numBytes, char * values){ //Since we're performing a read operation, the most significant bit of the register address should be set. char address = 0x80 | registerAddress; //If we're doing a multi-byte read, bit 6 needs to be set as well. if(numBytes > 1)address = address | 0x40; //Set the Chip select pin low to start an SPI packet. digitalWrite(CS, LOW); //Transfer the starting register address that needs to be read. SPI.transfer(address); //Continue to read registers until we've read the number specified, storing the results to the input buffer. for(int i=0; i<numBytes; i++){ values = SPI.transfer(0x00); } //Set the Chips Select pin high to end the SPI packet. digitalWrite(CS, HIGH); } The output is all -1,-1,-1. When I moved the ADXL345 module, they became 0,0,0 or some wired combinations like -1,0,-678234. Can someone help me to see what is wrong with the code? I changed the chip select pin numbers when I code for them and I am using USCIA port. This code is from other places. Thanks! Yutao Li
  15. Hello everybody, I would like to measure the speed rotation of a motor. For this, i use a photodiode. The signal waveform is given by the picture. I want to measure this signal frequency using the MSP430F5529 and Energia and display it in the serial monitor. I know i have to use the Timer A in Capture/Compare mode but I don't know how. I saw a lot of codes but they use CCS and the MSP430g2553 and it is not clear for me. How can I proceed to measure the frequency of my signal ? The frequency can vary from 50Hz to 500Hz. Thank you for your help.
  16. I like the boosterPack concept, but for my current project I needed access to all the pins on an F5529 as well as an F2013. So, I constructed a couple of boards to plug into an MSP-TS430PN80USB in a boosterpack fashion. As is probably obvious, I missed a couple of traces (GND lines), for which I had to add the little green wires. The top board has all my sensors, and the bottom is basically battery management and a sx1509 port expander to manage a number of LEDs. I don't actually need the extra ports, but I wanted the sx1509's built-in LED "breathe" capability. Saves coding... -lazy programmer I was a happy camper when I fired-up the system and was able to access and program both MCUs. I've found that I can choose between running two instances of IAR (or CCS) and debug both micros simulaneously. Handy for the comms and interrupt handing. So, let the fun begin... BTW - the TFT LCD is from buydisplay.com - 2.8" TFT with Cap touch (about $15.00 U.S.). It's using the ILI9341 controller for the LCD and the FT6206 controller for the cap touch. For proof of concept I was able to use the Adafruit sketches to connect with both, and the edits were limited to pin assignments, if I remember correctly.
  17. While trying to incorporate Adafruit's FT6206 library (capacitative touch for a TFT LCD) after calling the constructor: Adafruit_FT6206 ctp = Adafruit_FT6206(); a following call to: ctp.begin() would hang. While stepping in with the CCS debugger I finally found (after a couple of hair-pulling hours) in the call stack that there were a number of calls to Serial.print() to enumerate and display the registers and status of the FT6206. My solution, which leaves me wondering if there's not a better way, is to wrap their calls in a #ifdef/#endif regarding a debug console for the hardware serial port on my msp430F5529. So, is there a more elegant solution? Thx, Bob
  18. My wife wants to know that when I do my John Muir Trail trek starting on 7/26/2016 I've not fallen down and can't get up, or been eaten by a bear... So, I've been building my DIY "SpotMe" Iridium Network-based GPS-Satellite Comm device. I've gotten to the basic level of communication; It reports my position on a regular basis (the following is from a morning conditioning hike). To my surprise, when I set the deconstructed system up on my kitchen table, it managed to both get a GPS fix AND successfully transmit the data to an Iridium satellite. Given that there is really no "sky" visible from my kitchen, a better than expected performance! Why build it when I could buy similar? Well, why not??? Similar to Dave Jones' "take it apart" I'm a firm believer in DIY to figure out how something works, and can I make one... Future travel plans: I do "Iron Butt" rides on my 2005 ST1300 - now with 175,000+ miles (there's no typo there, I've really driven that far on my bike...), and I'm planning to do 300 mile sections of the Pacific Crest Trail for the next 10 years. So, again, keeping the wife happy and "in the know." So, this will be something I plan to use on a regular basis over the next several years. Once finished with the project I will publish all code, hex and design files for those who have an interest. Finally, thanks to all who have helped me. Especially Robert Woodruff, yyrkoon, and Spirilis. Bob http://www.nursebobsblog.org - currently stale content, updates planned for after the hike and teaching again... On 7/14/2016 at 09:01:47 PDT Bob was here: https://www.google.com/#q=%2B38.564295,-122.432641 -Aprx Elev.: 1676 ft On 7/14/2016 at 09:14:44 PDT Bob was here: https://www.google.com/#q=%2B38.572575,-122.428550 -Aprx Elev.: 1645 ft On 7/14/2016 at 09:25:53 PDT Bob was here: https://www.google.com/#q=%2B38.575296,-122.433725 -Aprx Elev.: 1644 ft On 7/14/2016 at 09:36:38 PDT Bob was here: https://www.google.com/#q=%2B38.580748,-122.431888 -Aprx Elev.: 1784 ft On 7/14/2016 at 09:50:50 PDT Bob was here: https://www.google.com/#q=%2B38.582575,-122.431873 -Aprx Elev.: 1743 ft On 7/14/2016 at 10:05:25 PDT Bob was here: https://www.google.com/#q=%2B38.574358,-122.427476 -Aprx Elev.: 1564 ft On 7/14/2016 at 10:16:14 PDT Bob was here: https://www.google.com/#q=%2B38.569375,-122.423606 -Aprx Elev.: 1740 ft No visible sky, from inside my kitchen: On 7/14/2016 at 11:34:57 PDT Bob was here: https://www.google.com/#q=%2B38.539415,-122.471001 -Aprx Elev.: 593 ft
  19. Since my only 5529LP was confirmed no longer functioning properly and the likely cause is the USB hub module, there have been some thoughts going through my mind to salvage the core 5529 device on the LP for some good use. And this weekend I have decided to give it a try. As the USB host part is confirmed not functioning, the first step is to verify the F5529 is still good. The easiest way is to try program it and check if it can run new program. With a good F5529 LP (the new replacement board ordered after the old one retired), I removed all the jumpers between the ez-FET and the target device, and then wired the GND, 5V, 3V3, RXD, TXD, SBW RST, and SBW TST from the good ez-FET to the 5529 side of the old LP. This will also power up the old board from the new one as the USB host on the old board is dead and no longer powering it. Soon after an example Energia sketch of SerialCallResponseASCII is uploaded through the new, good board, the good news is displayed on the Serial console confirming the 5529 device is still working flawlessly. At this point, I came into realization that this board can no longer be a handy development board as it once was but only good for deployment, possibly permanently, to some project because I have to rely on that good LP every time for programming. But wait, I recall recently from the forum there are some posts mentioning Forth interpreter for MSP430, one of which by monsonite with comprehensive information on various Forth offerings. However, a common requirement for Forth is serial communication for the console that my old LP is no longer capable to provide with a dead USB hub. Even though I don't have serial to usb converter to bypass the on-board hub for direct serial connection, I remember there is an old Arduino Pro Mini laying around without much used. Combining these two, I could probably build a utility development board that provide ad hoc programming capability (in Forth) on the 5529LP provide the console access required by Forth on the 5529LP via the Arduino Pro Mini (forward the serial communication from the Arduino UART to the 5529LP TX/RX) power the 5529LP via the 5V and 3V3 pin from the Arduino Pro Mini All in all, the goal is to take the Arduino Pro Mini as the controller or programmer of the 5529LP that is programmed to run Forth only. I picked the Mecrisp as it provided out of the box support for the 5529LP and pre-compiled hex file. So the build begin by first flashing the Forth hex file to the 5529LP. Again it required a good 5529LP and I used the latest MSPFlasher for the job. The following is the command line (for Windows). MSP430Flasher.exe -w "forth-mecrisp-5529.hex" -v -g -z [VCC] For a more decent looking of this utility development board, the Pro Mini is mounted to a medium sized breadboard on one end, and with four metal pins (pulled from left over connectors), the 5529LP is somehow "mounted" to the other end. This is enough for some structural support for the 5529LP Now for the Arduino side. Since there is only one set of UART on the Pro Mini, the program on it make use of the SoftSerial library that will emulate another serial port by two digital pins to relay the serial messages from the real UART to the 5529LP. Finally the moment of truth, the serial console to the Arduino is opened for a test. Apart from the line feed being weird, the expression run (1 2 + .<cr>) is successful, so is the programming of the blinky program Moving forward, the Arduino can be programmed in such a way that not only merely relaying serial message, but parse special commands to initiate specific Forth programming to the 5529LP (the Forth programs themselves stored as program in the Arduino). Hopefully this will make the whole package more versatile and practical.
  20. from now UIPEthernet library (v02) are available for MSP430F5529LP too please check on stellarisiti energia forum: http://forum.43oh.com/topic/7489-energia-library-stellarpad-uipethernet-enc28j60-library/
  21. I am working on a school project that requires me to use the MSP430 microprocessor. While the entire class is working primarily with the MSP430G2553 launchpad, I have elected to use the MSP430F5529 launchpad as it uses a superior microprocessor in every respect. I have experience programming AVR chips and I could draw the minimum circuit for the ATMEGA1284p and ATMEGA328p blindfolded, I cannot seem to find a schematic of the minimal circuit for the MSP430F5529 on the web anywhere. Also I would like to point out that as an AVR guy, the documentation provided from Ti is pretty bad by comparison. Any information on these two topics would be helpful.
  22. Some time back I ordered an INA125P Instrumentation Amplifier in order to fool around with a cheap, broken "postal" scale that I had. It arrived and I promptly put it away and forgot it about it. So the other day I was digging through my junk box, saw the scale, and decided to tear it apart. Since it is getting near Halloween, and I knew my grandchildren would be interested, I wrote a little sketch in Energia to estimate the amount of candy in a bowl. Here is a schematic of the circuit. It "works" but given my skills it may not be best. This being a MSP430 project I hooked up the sleep pin on the INA125P. I also made it where I could change out Rg, the gain controlling resistor, easily. Once I had it working I made up a little BoosterPack that goes on the bottom of the LaunchPad. The INA125P sits between the daughter board and the MSP430F5529 LaunchPad - you are looking down on the male pins in the photo above. I hot glued a piece of cardboard on the bottom so as to reduce the chance of shorts and provide a reminder on how to connect it. Below is a view from the bottom with it connected up to the LaunchPad and the scale. The sketch is here on github. There is a little calibration routine it goes through when started up where it asks for the empty bowl and then a known quantity of candy to be placed into it. After that, it displays on a SHARP96 BoosterPack. I thought about connecting it up to the IOT, but after due consideration decided I didn't want the neighborhood kids knowing how much candy I have left.
  23. Here is some code to drive ws281x strips using DMA driven SPI for the msp430f5529. I hadn't seen any example code showing how to use DMA and SPI. The example also provides some code that shows how to use inline asm that will work with both msp430-gcc and msp430-elf-gcc. The code below was tested with a ws2811 strip and msp430-elf-gcc. https://gist.github.com/RickKimball/9761b8f5a89d46a53939 -rick
  24. Hi Everyone, Anyone has tried the connection already by SPI? Any sample code available? Thanks
  25. Hello! So I'm building a robot that is eventually supposed to implement an autonomous functionality, which means obstacle avoidance. I'll be using the HC-SR04 as the ultrasonic sensor of choice. I started out by verifying that the sensor works by running it using Energia, which is the standard "loop infinitely and take a measurement every so many microseconds". In my actual application, however, I want to send out a pulse on command. So when I say so, the ultrasonic will do a measurement (or an average of a few measurements) to tell me if an object is in the path of my robot or not. My actual code is a combination of C (my main function) and a modification of the original Energia project I started with, whose functionality I call from my main application. In my application I'm using uart interrupts on both A0 and A1, and when a certain character is received by A1 I want to access the ultrasonic sensor and take a reading to see if there is an object in the way of my robot or not. There are a few issues that I've been having. The first is that the micros() function doesn't work, so I've taken to making my own delays by using a volatile integer and burning clock cycles that way. The main issue that I'm having (and the reason for this post) is that no matter what I do, the pulseIn() does not work properly. I've pasted the relevant code below. Note that the sensors.cpp file was originally made in Energia, then imported into code composer so that it could be integrated with the main.c file. So this is how my code works. In main.c, U1 will receive an 'I' as an interrupt. In this case, I will call the function fwd(). In the fwd() function, I call the function detectUltraFwd(), which is in sensors.cpp. (It's labeled fwd because later there will be a second ultrasonic sensor for the reverse direction). detectUltraFwd() calls detectUltrasonic(int trig, int echo), where "trig" and "echo" are the specific pins where the ultrasonic sensor is connected to the msp. (Note again, this file came from Energia, so it's a little different than a standard code composer c file). The problem arrives at the line with the pulseIn() function, which was taken from Arduino. According to the function, 0 is returned when there was no measured pulse within the specified timeout. I've tried timeout values varying from 100us to 1s, the maximum value for the function, to no avail. This function always returns 0 and I don't know why. I'm not sure if it's even possible to take a single sample using an ultrasonic sensor. I've tried having the detectUltrasonic() function loop a few times in case just the initial reading was zero, but that wasn't it. The conclusion that I've come to is that it has something to do with micros() not working. Since I'm using interrupts, calling micros() will return 0. (Which is why I'm using the volatile integers to pass time. And yes, I am well aware that I need to play around with the timing to get it close enough to the values I want.) So maybe it's possible that I just don't have my loops timed right, but I ran the original Energia infinite loop code using my made up senswait() function and it worked, so I don't think that's the case. Any insight / help with this matter would be appreciated. My initial searches did not show a resolution to this issue. main.c: #include <msp430.h> #include <string.h> #include <stdlib.h> #include "motors.h" // my file used for motor control #include "sensors.h" // my file used for sensor control int sensingDist=46; //cm int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT // initialize A0 uart for communication P3SEL = BIT3+BIT4; // P3.4,5 = USCI_A0 TXD/RXD UCA0CTL1 |= UCSWRST; // **Put state machine in reset** UCA0CTL1 |= UCSSEL_2; // SMCLK UCA0BR0 = 9; // 1MHz 115200 (see User's Guide) UCA0BR1 = 0; // 1MHz 115200 UCA0MCTL |= UCBRS_1 + UCBRF_0; // Modln UCBRSx=0, UCBRFx=0, over sampling UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt // initialize A1 uart for communication P4SEL |= BIT4+BIT5; // P4.4,5 = USCI_A1 TXD/RXD UCA1CTL1 |= UCSWRST; // **Put state machine in reset** UCA1CTL1 |= UCSSEL_2; // SMCLK UCA1BR0 = 9; // 1MHz 115200 (see User's Guide) UCA1BR1 = 0; // 1MHz 115200 UCA1MCTL |= UCBRS_1 + UCBRF_0; // Modln UCBRSx=0, UCBRFx=0, UCA1CTL1 &= ~UCSWRST; // **Initialize USCI state machine** UCA1IE |= UCRXIE; // Enable USCI_A1 RX interrupt // Set the pinout for the motor controller. setup(); // see motors.h P1DIR |= 0x01; // set blue led as output 1.0 P4DIR |= 0x80; // set green led as output 4.7 P4OUT |= 0x80; // turn on green led P1OUT &= ~0x01; // turn off blue led __bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled __no_operation(); // For debugger } // lots of irrelevant code was removed, including the A0 interrupt. // USCI_A1 interrupt -- bluetooth module (or terminal if debugging) #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=USCI_A1_VECTOR __interrupt void USCI_A1_ISR(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(USCI_A1_VECTOR))) USCI_A1_ISR (void) #else #error Compiler not supported! #endif { switch(UCA1IV) { case 0:break; // no interrupt case 2: // RXIFG - received a character! if('I' == UCA1RXBUF) { // Move forward fwd(); } break; case 4: break; // TXIFG - sending a character default: break; } } void fwd() { // Check to see if there's an object in the way int dist = detectUltraFwd(); if(dist > sensingDist) // if the returned distance is greater than sensingDist, we can freely move forward. { forward(rotateSpeedFB, rotateLengthFB); // see motors.h - tells the robot to move forward. } else // otherwise the ultrasonic sensor has detected an object in the way. blink the blue led a couple times as an indication. { toggleBlue(); volatile int c = 0; for(c=0; c<10000; c++); toggleBlue(); for(c=0; c<10000; c++); toggleBlue(); for(c=0; c<10000; c++); toggleBlue(); for(c=0; c<10000; c++); toggleBlue(); } } sensors.cpp #include "Energia.h" #include "sensors.h" const int ultraTrigFwd = P3_5; const int ultraEchoFwd = P3_6; int detectUltraFwd() { return detectUltrasonic(ultraTrigFwd, ultraEchoFwd); } //ultrasonic function int detectUltrasonic(int trig, int echo) { long duration, cm; // set pin as output pinMode(trig, OUTPUT); // set it low & wait 2us - in order to get a clean signal. digitalWrite(trig, LOW); senswait(3); // Then set it high for 5 us - i.e. begin taking the measurement. digitalWrite(trig, HIGH); senswait(10); digitalWrite(trig, LOW); // now stop taking the measurement //setting up input pin, and receiving the duration in microseconds pinMode(echo, INPUT); duration = pulseIn(echo, HIGH, 1000); // *** THIS RIGHT HERE ALWAYS RETURNS ZERO *** cm = microSecondsToCentimeter(duration); return cm; } long microSecondsToCentimeter(long microseconds) { //The speed of sound is 340 m/s or 29 microseconds per centimeter. //Convert speed return microseconds/29/2; } // This function is being used since micros() will always return zero. So I'm burning clock cycles this way. void senswait(int delay) { for(int i=0; i<delay; i++) { volatile unsigned int x; x = 5000; do x--; while(x !=0); } } If there are small issues like a missing function declaration or header or something, it's because I've had to remove the rest of my project that was irrelevant to my question; my entire code does compile and run! Last notes: the puleIn() function comes directly from Energia. My suspicion is that is somehow is using time, though I did take a look at it and between the bitmasks and counting I didn't see an explicit call to micros() but I'm not sure. All I know is that pulseIn() always returns zero even when I know it shouldn't be. Also if I've violated some rule or completely missed another forum post that's relevant please nudge me in the right direction. And thanks in advance for any help!