Jump to content

Search the Community

Showing results for tags 'msp430'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 327 results

  1. I would like to locate code (or data) in upper FRAM using something like: void __attribute__((section("REGION_FAR_TEXT"))) myFunction(void); This should be possible because Energia for MSP430 memory.x files have a line REGION_ALIAS("REGION_FAR_TEXT", far_rom); and far_rom is declared as: far_rom : ORIGIN = 0x00010000, LENGTH = 0x00004000 /* END=0x00014000, size 16K */ but this was not working back in Energia E20. Is this working now in Energia E23?
  2. RobG

    MSP430 Nixie Clock

    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.
  3. (Context: I'm an experienced embedded systems engineer, just dipping my toe into MSP430-land. My target system is an MSP-EXP430FR5994 LaunchPad dev board.) General goal: How do I wake the processor N ticks in the future, where one tick is 1/32768 second and N can be as large as 2^15? My first thought was to use the RTC, but that appears to have a resolution of 1 second. My second thought was to use a timer module (e.g. TA1) and use its compare interrupt to wake the processor from LPM4. So my questions: Is there a better / alternative way to wake the processor N ticks in the future? Table 6-1 ("Operating Modes") states that a "COMP" event can wake the processor from LPM4. Does "COMP" refer to a compare interrupt from a timer? Is there a block diagram of the counter module(s) somewhere? I didn't see it in the processor-specific datasheet.
  4. I got an MSP-EXP430G2ET yesterday, and after installing drivers and Energia (Debian unstable) I plugged it in and opened up the blink example. Energia spat out some messages about the firmware needing updating, and started the process. I don't have the log (it's fallen off my console's buffer) but it did not appear to complete successfully. Now, when I try to use Energia to flash the blink example, I get this: Sketch uses 386 bytes (2%) of program storage space. Maximum is 16384 bytes. Global variables use 20 bytes (3%) of dynamic memory, leaving 492 bytes for local variables. Maximum is 512 bytes. DSLite version 9.3.0.1863 Configuring Debugger (may take a few minutes on first launch)... Initializing Register Database... Initializing: MSP430 error: MSP430: Error initializing emulator: One of the connected MSP-FETs / eZ-FETs debuggers needs recovery. Select 'Recover' to start the recovery process. Note: Only one MSP-FET / eZ-FET debugger can be connected to your system during recovery. Updating Firmware error: MSP430: Error: MSP-FET / eZ-FET recovery failed Failed: MSP430: Error initializing emulator: MSP-FET / eZ-FET recovery failed the selected serial port does not exist or your board is not connected It's interesting that it says DSLite even though I selected mspdebug through the tools menu. So I figured I'd try just compiling a trivial C program and flashing it manually. $ mspdebug tilib appears to work, as long as I have the appropriate .so file in my dynamic loader's search path. However, this happens when I try to flash anything. $ LD_LIBRARY_PATH=energia-1.8.10E23/hardware/tools/DSLite/DebugServer/drivers/ mspdebug tilib MSPDebug version 0.22 - debugging tool for MSP430 MCUs Copyright (C) 2009-2013 Daniel Beer <dlbeer@gmail.com> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MSP430_GetNumberOfUsbIfs MSP430_GetNameOfUsbIf Found FET: HID_FET MSP430_Initialize: HID_FET Firmware version is 4294967294 MSP430_VCC: 3000 mV MSP430_OpenDevice MSP430_GetFoundDevice Device: (id = 0x0000) 0 breakpoints available MSP430_EEM_Init Chip ID data: 02 00 Available commands: = erase isearch power save_raw simio alias exit load prog set step break fill load_raw read setbreak sym cgraph gdb md regs setwatch verify delbreak help mw reset setwatch_r verify_raw dis hexout opt run setwatch_w Available options: color gdb_loop enable_bsl_access gdbc_xfer_size enable_locked_flash_access iradix fet_block_size quiet gdb_default_port Type "help <topic>" for more information. Use the "opt" command ("help opt") to set options. Press Ctrl+D to quit. (mspdebug) prog minimal.elf Erasing... Programming... Writing 80 bytes at c000 [section: .text]... Writing 32 bytes at ffe0 [section: .vectors]... Done, 112 bytes total (mspdebug) verify minimal.elf Verifying 80 bytes at c000 [section: .text]... ERROR: mismatch at c000 (read 00, expected 55) (mspdebug) I suspect this is a problem with the on-board debugger. Any information on how to fix this would be appreciated.
  5. I'm trying to use the UCA0 for SPI on MSP430FR2433 by using the SPI.setmodule(10); before SPI.begin(), but I'm not getting any data on the SPI lines. The default SPI on this launchpad is UCA1 and it works. After the above thing didn't work, I tried changing the core files: /home/username/.energia15/packages/energia/hardware/msp430/1.0.5/variants/MSP-EXP430FR2433LP/pins_energia.h In this file I changed: (from line 47 to 50) static const uint8_t SS11 = 8; /* P2.1 */ static const uint8_t SCK11 = 7; /* P2.3 */ static const uint8_t MOSI11 = 15; /* P2.4 aka SIMO */ static const uint8_t MISO11 = 14; /* P2.5 aka SOMI */ to: static const uint8_t SS11 = 8; /* P2.1 */ static const uint8_t SCK11 = 5; //P1_6 static const uint8_t MOSI11 = 4; //P1_4 aka SIMO static const uint8_t MISO11 = 3; //P1_5 aka SOMI And changed: #define DEFAULT_SPI 11 to: #define DEFAULT_SPI 10 But this also didn't work.pins_energia.h I have attached the changed file.
  6. Hello guys,i have a question for my project im using the msp430g2231 microcontroller and i want to measure frequencies up to 10Mhz.Im new to microcontrollers(not programming),and im not sure how to make the overflow work void main(void) { WDTCTL = WDTPW + WDTHOLD; // stop watchdog timer BCSCTL1 = CALBC1_1MHZ; // Set range DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation delay(100); // delay 100mS until next screen refresh /*** Timer_A Set-Up ***/ TA0CCR0 = SampleTuneTime; TA0CCTL0 |= CCIE; // Interrupt enable TA0CTL |= TASSEL_1 + ID_3; // SMCLK TA0CCTL1 |= CCIE + CCIS_0 + CM_1 + CAP; // Interrupt enable, capture select CCIxA, Positive edge, capture mode TA0CTL |= TASSEL_1; //SMCLK _BIS_SR(GIE); // Enter LPM0 with interrupts enabled while(1) { TA0CTL |= MC0; // Start timer up mode.Timer counts up to TACCR0 TA0CTL |= MC1; // Start timer //while(CounterValue != 400); // Wait while CounterValue is not equal to 400 TA0CTL &= ~MC0; // Stop timer mode TA0CTL &= ~MC1; // Stop timer Result >>= 2; // Divide Result by 4 calc_freq(); //convert long into frequency char buffer[8]= { 0, }; unsigned long toLCD = Frequency; // int Base = 10; itoa(toLCD,buffer); //convert decimal lcd_init(); send_string("FREQUENCY IS"); send_command(0xC0); send_string(buffer); send_command(0xC8); send_string("HZ"); Result = 0; // Zero Result CounterValue = 0; // Zero CounterValue StoredCount = 0; // Zero StoredCount TA0R = 0; // Zero Timer_A0 register } } #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer0_A0(void) { TA0CTL &= ~MC0; // Stop timer TA0CTL &= ~MC1; // Stop timer CounterValue++; // Increment CounterValue if (CounterValue >= (NumberSamples +1)) // Reset values if NumberSamples +1 is reached { CounterValue = 0; // Zero CountValue StoredCount = 0; // Zero StoredCount } Result += StoredCount; // Store accumulated count in Result StoredCount = 0; // Zero StoredCount TA0CTL |= MC1; // Start timer TA0CTL |= MC0; // Start timer StoredCount++; // Increment StoredCount } this is the main code of the program im using custom made function for the itoa and the communication with the LCD.I have two questions 1.) Can i make the frequency meter up to 10Mhz cuz the g2231 has one timer and 1Mhz calibration available. 2.)Can i somehow check if the code is working cuz i dont have any way to send frequency right now,like counting the internal frequency or something like that. Thank you for your time.
  7. Hello everyone, I am just a beginner in using MSP430, I want to know how to design a circuit of motion detection system. I have the ports which LCD display should be connected to , So I want to check if they are correct, since all of this is new to me. for LCD display port connection. connect RS to P2.5 connect RW to P2.6 connect E to P2.4 connect D0-D3 to NC connect D4 to P2.0 connect D5 to P2.1 connect D6 to P2.2 connect D7 to P2.3 are the above correct? where should I connect PIR sensor? please, I need help and sorry for my bad English.
  8. Hello, I am storing a sensor value in the Flash Memory in a Segment of MSP430F5529 board. Since the data from the sensor keeps changing i want the data to be overwritten so that not much of space in flash memory is used. Is there a simple way to achieve the overwrite feature in flash memory ? Also i have another doubt, i wanted to know if i keep writing continuously a data to flash memory, does the microcontroller gets caught in writing to the flash and slows the running program ? thank you for taking time to review my questions.
  9. so we were trying to code msp430FR5969 but we got these errors and now we dont know that how to solve it and one more thing are ltc libraries and linduino libraries compatible with energia and if not then what is the other method in which we can code them using msp430
  10. Hello, Has there ever been a method developed for Energia that allows it to use an external crystal? I'd like to have the ability to enable a low frequency crystal as well as a high frequency crystal on the msp430fr5994. Does anyone have any recommendations for implementing this? Thanks,
  11. Hello, I'm trying to get some code to upload to my MSP-EXP430F5529LP board. Following this forum post (I'm on Mac OS Catalina), I installed a pre-release version of Energia, and I get this error: Energia: 1.8.10E22 (Mac OS X), Board: "MSP-EXP430F5529LP" Sketch uses 706 bytes (1%) of program storage space. Maximum is 48128 bytes. Global variables use 18 bytes (0%) of dynamic memory, leaving 8174 bytes for local variables. Maximum is 8192 bytes. java.io.IOException: Cannot run program "___REMOVE___/DebugServer/bin/DSLite": error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:620) at java.lang.Runtime.exec(Runtime.java:485) at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:11) at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129) at cc.arduino.packages.uploaders.SerialUploader.runCommand(SerialUploader.java:383) at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:197) at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77) at processing.app.SketchController.upload(SketchController.java:732) at processing.app.SketchController.exportApplet(SketchController.java:703) at processing.app.Editor$UploadHandler.run(Editor.java:2075) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 11 more An error occurred while uploading the sketch This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. What could be the issue? It seems like the directory that the program is trying to use is incorrect. (Maybe ___REMOVE___ is not supposed to be there or something?) Thanks in advance!
  12. Hello, I've been developing with the msp430fr5994 on energia and I seem to have come across an issue using the serial ports on 6.0 and 6.1 I have two of these processors connected together with the Tx/Rx connected respectively on 6.0 and 6.1. I have the first processor sending out a single number using the Serial1.write("1"); command. The second processor i set to respond by displaying data on it's TFT once it gets any kind of data. So far, I can't get anything to come out of the Serial1 ports. An oscilloscope shows that it's being held high and not sending any kind of data out. I've tried just about every combination of Serial1.print and Serial1.write commands and attempted single numbers, letters, phrases, ect. I read online from about a year ago that there was an issue getting Serial1 to work on this processor using energia, was there a fix for this? Thanks,
  13. Howdy, I'm having trouble programming my MSP430FR2433LP with Energia on my Mac. When I try to upload the program, it gives me this error: MSP430: Error initializing emulator: No USB FET was found. Strangely, I am able to program it with the online Code Composer Studio. I have made it blink red and green lights. Unfortunately, I'm not trying to become an embedded programmer (while that would be fun, I do not have the time) so I do not want to learn CCS, registers, and serial communications in pure C. Props to all you who can do this. I really want this to work with Energia - it will save me many hours down the road. I also tried this on my Windows Parallels desktop emulation software (which works pretty damn near perfectly like a true Windows OS), but I got the same error message! The board and USB cable are clearly working if I can program with CCS. So what is going on with Energia? Thanks, Another Mac-using engineer with problems
  14. I an using mspexp430g2 launchpad on energia with windows 10 OS.In this while compiling the inbulit "DigitalReadSerial" example code from energia IDE ,at that time it should print the output in the Serial Monitor screen . But it does not print anything.Please help me.
  15. From time to time, threads pop up where someone tries to count very fast pulses in the hundreds of kHz or even MHz range. There is a solution for the hardcore C-coders among us, but to my surprise there was no Energia library for this simple problem. I herewith present the CounterLib for Energia Download Source code and detailed instructions are also available on GitHub: https://github.com/astuder/CounterLib-Energia Currently the library supports MSP430G2553, MSP430F5529 and MSP430FR5969. To create an instance of the counter, simply declare it as a global variable like this: Counter<> MyCounter; // create a counter that counts pulses on pin P1.0Once created, the counter has 5 functions:start() initializes the timer peripheral and I/O pin and starts the counter stop() stops the counter, but does not reset the counter value read() reads the current value of the counter reset() resets the counter to 0, the counter keeps running readAndReset() reads the current value and resets the counter to 0 And a basic example, which should work for signals lower than 65 kHz: Counter<> MyCounter; // create counter that counts pulses on pin P1.0 void setup() { Serial.begin(9600); MyCounter.start(); // start counter } void loop() { MyCounter.reset(); // reset counter to zero delay(1000); // wait one second Serial.println(MyCounter.read()); // read number of pulses during the last second delay(1000); // wait another second } The library also supports dividers to measure much faster signals. For more detailed instructions see GitHub. The library uses the external clock input of the timer peripheral. This enables the library to measure very fast signals (MHz range). On the downside, each timer only has a specific pin assigned, and the G2553 only has one timer with an external pin. It is also possible, that other Energia libraries or built-in functionality use the same timer, which won't work. Here's a list of the timers supported by the library and their pins: | Timer | G2553,| | | | | | G2452,| F5529 | FR5969 | FR6989 | | | G2231 | | | | |------------|-------|-------|--------|--------| | CL_TimerA0 | P1.0 | P1.0 | P1.2 | P1.2* | | CL_TimerA1 | n/a | P1.6 | P1.1* | P1.1* | | CL_TimerA2 | n/a | P2.2 | n/a | n/a | | CL_TimerB0 | n/a | P7.7*| P2.0* | P2.0 |Pins marked with * are not broken out on the LaunchPad or are difficult to access. The library probably works on many other MSP430's, but you'll need to adjust the #defines in the library. Please report back if you successfully tested with other devices, so that I can extend the library. Please report any bugs. And also let me know if you break any speed records. So far I only tested it up to 750 kHz. Edit 9/3/15: Added support for FR5969. Thanks @@Fmilburn Edit 9/4/15: Refactored to make it easier to add more MCUs. Several bug fixes, thanks to all the eagle-eyed members of 43oh Edit 3/13/16: Replaced attached ZIP file with link to GitHub to always give up-to-date version
  16. Hello, I've been pulling my hair out trying to get these libraries to compile in Energia for the msp430fr5994. Is there anyone here that might be able to help me port these libraries? I feel like its just about changing some of the declarations and specifics but I don't even know where to start. I would appreciate any help or advice anyone can give . Thanks, CFAF240240A1-013T_Arduino (3).zip
  17. Hi all. I have been working on a fingerprint based project using adafruit's fingerprint scanner from here http://www.adafruit.com/products/751 . I have been successfully using this with Arduino uno with the help of the following library provided by adafruit itself, from here: https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library Now, i have to switch from Arduino to Msp430g2553 LP. Can you'll please guide me with the following? : 1) How to port This library to Energia? I know the basic part is to replace Arduino.h and associated code with #include <energia.h>, but is there anything else i need to do? 2) How do work with SoftwareSerial in this case? I've read we cannot use baud rate above 9600 with g2553, is it true? Is there anyone who has worked on a similar project? Any help will be truly appreciated. Thanks in advance.
  18. So I have to figure out a way to connect my MSP430f5529LP to a local broker on a Raspberry Pi through MQTT. It is important that I use an ESP8266 as CC3100BOOST would cost me like $50 over here when I can get an ESP8266 for like $4. I went through various pages and stuff in search of codes and libraries and couldn't find a single one. This is part of my college project and I really need to get this done. Does anyone have any idea on how to work with ESP8266 for MQTT using AT commands as it is my last resort as I can't find any libraries for MSP430. And BTW, TivaC would also suffice. The basic idea is to send a reading from an analog sensor to Raspberry Pi and plotting the data. It has to be through MQTT as that is the main part of my project.
  19. 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 in my web store. 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 resistors 100 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
  20. Hi all, I have recently acquired a color click board (https://www.digikey.co.uk/en/product-highlight/m/mikroelektronika/color-click-board) and would like to get it working with one of my MSP430 Launchpads. A sketch already exists for the Arduino (https://github.com/raivisr/TCS3471-Arduino-Library/blob/master/TCS3471/examples/ColorSensor/ColorSensor.pde) I have tried porting it over to MSP430, but have been unsuccessful. Do you have any suggestions as to where I may be going wrong? Problems are with undefined references. Thanks!
  21. Hi, I am using Energia 1.8.7E21. I am interfacing a HX711 Weighing Scale kit to MSP430FR5969 Launchpad. I am using a Energia Code that worked at another weighing scale project more than a year ago. When I program it, it runs 1 time and I see the output at Serial Console. But when I program again there is no output. Out of 10 programming the first one only has output. The rest do not have output at Tera Term. To confirm that the program does not run I put a code to turn on the red led. But the red led did not turn on. #include "HX711.h" #define DOUT 5 #define CLK 6 // most launchpads have a red LED #define LED RED_LED HX711 scale(DOUT, CLK); float calibration_factor = -7050; //-7050 -130000 void setup() { // initialize the digital pin as an output. pinMode(LED, OUTPUT); digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level) Serial.begin(9600); Serial.println("HX711 calibration sketch"); Serial.println("Remove all weight from scale"); Serial.println("After readings begin, place known weight on scale"); Serial.println("Press + or a to increase calibration factor"); Serial.println("Press - or z to decrease calibration factor"); scale.set_scale(); scale.tare(); //Reset the scale to 0 long zero_factor = scale.read_average(); //Get a baseline reading Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects. Serial.println(zero_factor); } void loop() { scale.set_scale(calibration_factor); //Adjust to this calibration factor Serial.print("Reading: "); Serial.print(scale.get_units(), 3); Serial.print(" lbs"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person Serial.print(" calibration_factor: "); Serial.print(calibration_factor); Serial.println(); //digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level) if(Serial.available()) { char temp = Serial.read(); if(temp == '+' || temp == 'a') calibration_factor += 10; else if(temp == '-' || temp == 'z') calibration_factor -= 10; else if(temp == 's') calibration_factor += 100; else if(temp == 'x') calibration_factor -= 100; else if(temp == 'd') calibration_factor += 1000; else if(temp == 'c') calibration_factor -= 1000; else if(temp == 'f') calibration_factor += 10000; else if(temp == 'v') calibration_factor -= 10000; else if(temp == 't') scale.tare(); //Reset the scale to zero } }
  22. Hello everyone, I would like to know how can I get digital input working under Simulink Embedded Coder Target for Energia. I had successfully used the digital output block in my Simulink models with MSP-EXP430G2 Launchpad, but didn't succeed for the digital input. Does the digital input block require external mode to operate? Please help
  23. Hello I'm doing a projet using a MSP430G2553, a humidity sensor and a GSM module Sim800L. In the moment that i'm trying to upload my code, it gives me the following errors: c:/.../energia-1.8.7e21/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3\libcrt0.a(_copy_data.o): In function `__do_copy_data': /root/mspgcc-20120406/BUILD/gcc/gcc/../../../gcc-4.6.3/gcc/config/msp430/crt0.S:195: relocation truncated to fit: R_MSP430_16_BYTE against symbol `__data_load_start' defined in *ABS* section in C:\Users\...\Envio_GPRS.ino.elf GPRS.ino.cpp.o: In function `__static_initialization_and_destruction_0(int, int) [clone .constprop.1]': GPRS.ino.cpp:(.text._Z41__static_initialization_and_destruction_0ii.constprop.1+0x18): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' GPRS.ino.cpp:(.text._Z41__static_initialization_and_destruction_0ii.constprop.1+0x24): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' GPRS.ino.cpp.o: In function `setup': Envio_GPRS.ino.cpp:(.text.setup+0x2a): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' Envio_GPRS.ino.cpp:(.text.setup+0x36): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' Envio_GPRS.ino.cpp:(.text.setup+0x4c): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' Envio_GPRS.ino.cpp:(.text.setup+0x60): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' \Envio_GPRS.ino.cpp.o: In function `send_data()': Envio_GPRS.ino.cpp:(.text._Z9send_datav+0x20): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' Envio_GPRS.ino.cpp:(.text._Z9send_datav+0x36): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' Envio_GPRS.ino.cpp:(.text._Z9send_datav+0x4c): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol' Envio_GPRS.ino.cpp:(.text._Z9send_datav+0x62): additional relocation overflows omitted from the output After google it, i found that the solution was: contiki/cpu/msp40/Makefile.msp430 near line 132 search for CFLAGSNO = -Wall -mmcu=$(CC_MCU) -g $(CFLAGSWERROR) and erase the (-g) My problem is. I already installed the contiki and i can not find this line neither the cpu/msp40/Makefile.msp430.
  24. I made a heart rate sensor, and prototyped it with the launchpad. The mcu reads BPM and displays it on an LCD. I now want to create a pcb without the launchpad. I've attached what I have so far. I'm powering everything from a 9V battery, so I have a 3.3V regulator which I will use to power the MSP430G2553. Can I just connect the the output of the regulator to the VCC pin, and connect all the other pins to the circuit as I did with the launchpad, or are there other considerations I need to account for? Also, how do I debug and edit the program while the microcontroller is on my custom pcb?
  25. Hello, I'm try to use msp-exp430g2553et launchpad with energia but the serial monitor doesn't work. I'm using the example code:(One Wire DS18X20_temperature) I found it need to change RXD TXD but I changed it display "no more addresses" please help, thanks!
×
×
  • Create New...