Jump to content

Search the Community

Showing results for tags 'MSP430G2553'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 150 results

  1. 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.
  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. Edit 09.12.2016: I added Arial_16x24.h and Arial_24x40 (really a 24x36, but I had to keep a multiple of 8), digits only, created with GLCD Font Creator (I had to edit the result slightly manually). See images below. So I can confirm that adding any further fonts created with GLCD Font Creator works (I run it on Linux on wine BTW) and is only limited by how much fits into the SSD1306_OLED_5x8_11x16_16x24_24x36_fonts.zip
  4. Hello! I've got a problem when I want to show the output on serial monitor of a GPS. When I put a basic example (fade example) and the TX of the GPS on the TX of MSP430 (P1_2 pin) the output shows good, without any problem. The baud rate was the stock one (9600). When I try to make the same thing on other pins (I've choosed RX of GPS to P1_3 and TX of GPS to P1_4) a scrambled output takes place on the serial monitor and I don't really know what to do. I'll attach the code, maybe it's a code issue. Thanks in advance! I'm new in this so take me easy please //THE CODE https://pastebin.com/cjFyjHns #include <SoftwareSerial.h> static const int RXPin = P1_4, TXPin = P1_3; static const uint32_t GPSBaud = 9600; // The serial connection to the GPS device SoftwareSerial ss(RXPin, TXPin); void setup() { Serial.begin(115200); ss.begin(GPSBaud); } void loop() { // Output raw GPS data to the serial monitor while (ss.available() > 0){ Serial.write(ss.read()); // delay(10); } }
  5. Hello, I found an Arduino library for tea5767 module. Has anyone tried to import it on Energia IDE or at least has an idea about how can I do this? I work with msp430g2553. Please help me!! https://github.com/andykarpov/TEA5767
  6. I have to ask if someone knows better. If I have MSP430G2553 controller but in CCS I forget to change the settings for controller and there was chosen the G2453, which is the 8KB version of the same controller..does this somehow damage the controller when I program them? They seem to work but I am not sure if this can cause some surprises or failures as it may happen accidentally when using different controllers??
  7. The goal of this project is to utilize an MSP430 to allow existing remote-controlled outlets to by controlled over Wi-Fi. As purchased, the outlets can be controlled with a provided remote control which uses 434 MHz radio signals. By programing the MSP430 to replicate the signals from this remote and hosting a web page with controls on the MSP430, the outlets can be able to be controlled from anywhere on the same Wi-Fi network. The completed project provides a web page that can both control each of three outlets individually or all three at once. This is done using an MSP430 as a controller with a 434MHz transmitter sending commands to the outlets, and an ESP 8266 Wi-Fi module connecting to the network. A schematic of the completed project is shown in Fig. 1, and a photo of the completed project is shown in Fig. 2. With this set up the outlets can be reliably controlled from anywhere on the same Wi-Fi network. The components required for this project, along with the equipment necessary are listed below. All the components can be purchased for less than $30. I was able to write an interface to control the outlets, as well as serve a webpage to control the outlets. This was the final project for my Embedded Systems class at John Brown University. more details are avalible in the attached file. Parts list: · TI MSP430G2553 Launchpad · 434 MHz RF transmitter https://www.sparkfun.com/products/10534 · ESP8266 wifi module · Syantek Remote Controlled Outlets https://www.amazon.com/Syantek-Electrical-Household-Appliances-Expandable/dp/B07JF93XB5 · Breadboard · Jumper cables · USB power supply Equipment · 434 MHz RF receiver https://www.sparkfun.com/products/10532 · Digilent Analog Discovery Module · Code Composer Studio · Serial to USB converter Light_Switch_Final_Report.docx
  8. Hi... So let me ask this straight. I have to run a 3phase BLDC Motor using a full bridge inverter. The PWM signals for the switches of the inverter need to be generated using a microcontroller. Which means I need 6 different PWM signals. Can this be achieved using an MSP430g2553 chip? I currently have the 20 pin version only. I happen to be a complete beginner in the matter of microcontrollers. So please be kind enough to overlook my dumbness if I've missed out something very obvious!
  9. 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.
  10. I am trying (for quite long time) to write to EEPROM 64 bytes of data in 4 chunks (as EEPROM's page size is 16 bytes). Unfortunately, the MCU sends few extra bytes every time it transmits. For example, if I send 16 bytes, it transmits 22, with 6 last bytes being of unknown origin to me. For example, I send 15 text bytes within for(...) cycle xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx but see on the scope xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx BF F6 FD D7 3A C0 I tried another approach: send 15 bytes + 00. My program stops at 00, then I try to replace 00 with whatever has to be there using yet another write (1 byte only). However, I see 3 extra bytes: xx 2F 9A C9 00 I tried to write this 4 times at consequent addresses: 50 00 xx 00 50 01 xx 00 50 02 xx 00 50 03 xx 00 but every times I have the same extra bytes, like 50 01 xx 2F 9A C9 00 which result in (when reading 4 bytes) 50 00 xx xx xx xx 2F (5 bytes are read). Due to size of my project vs ROM size and also the need to learn C, I create all functions by myself, without using standard libraries. Below is I2C_write function, other ones regulating initialization, address selection or reading do not seem to be a problem. DCO is running at 16 MHz, with no division. void I2Ctext_write(unsigned int MemoryAddress, char * text, int length) { short int i = 0; UCB0I2CSA = addressSelect(MemoryAddress).three_bits_offset; while (UCB0STAT & UCBBUSY); //wait for USCI B0 bus to be inactive UCB0CTL1 |= UCTR + UCTXSTT; // I2C TX, start condition while (!(IFG2&UCB0TXIFG)); UCB0TXBUF = addressSelect(MemoryAddress).seven_bits_address; if(length) { for (i = 0; i < length; i++) { while(*text) { while (!(IFG2&UCB0TXIFG)); if(!(*text)) { break; } UCB0TXBUF = *text; *text++; } } } else { while(*text) { while (!(IFG2&UCB0TXIFG)); if(!(*text)) { break; } UCB0TXBUF = *text; *text++; } } while (!(IFG2&UCB0TXIFG)); UCB0TXBUF = 0; while (!(IFG2&UCB0TXIFG)); // data transmission has begun and the UCTXSTP bit may be set. UCB0CTL1 |= UCTXSTP; // Stop condition enabled; while (UCB0CTL1 & UCTXSTP); } Why do I see those extra bytes and what to do to get rid of them?
  11. So I'm working on a fingerprint scanner project with this repo written for arduino for the scanner I'm using. I am trying to make it work with an MSP430G2553 instead of the Arduino Uno. When I try using this library in Energia, it can't find the scanner despite being wired on the launchpad the same way that it is wired on the Arduino (External 5V source, Arduino pin 2 --> MSP430 pin 1.1, Arduino pin 3 --> MSP430 pin 1.2). The code compiles and the serial monitor outputs the test looking for the scanner, but it has yet to be able to find it. If anyone could give me any help with this, it would be greatly appreciated. Energia ino sketch is attached. EDIT: So after making myself more familiar with the code and the C++ imports, it seems the scanner works in 4 phases: 1) Take image 2) If image is a finger, convert it to digital features 3) Compare fingerprint features against features of enrolled fingerprints 4) Able to return result for the comparison and if its a match, return the ID# These lines: SoftwareSerial mySerial(5, 6); //Define serial communication on two pins Adafruit_Fingerprint finger = Adafruit_fingerprint(&mySerial); Seem to be whats handling all the fingerprint logic. So the issue isn't with the scanner, its with the communication between scanner and the MSP, most likely that I'm somehow defining output pins 5 and 6 (P1_3 and P1_4) incorrectly so they are not handling the scanner at all. fingerprint.ino
  12. 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
  13. Hello fellows, I need some help, i have get a code http://store.43oh.com/download/uploads/TheTerminal-OLEDDisplay/code/GWDeveloper-OLED_MSP430_USCI.zip. Now I have made some changes and I get the code working correctly, This display shows 4 lines of 8 pixels each, the code is implemented to work with a 6x8 font that is displayed correctly. I need to run a larger font, can anyone help me to rewrite the source code correctly that allows me to view a larger font correctly.
  14. Can anyone help me to transfer the data from msp430g2553 to CC3200? I want to know how to interface these two modules
  15. Hello. I have wrote an Energia program for digital potentiometer control. I want to save variable "counter" (it is an integer number from 0-255) in non-volatile memory using mspflash.h library in case of reset or power interrupt. But it doesn't saves. I am allmost sure there is something wrong with initialization of variables or pointers inside my code. Can anyone help? Any improvements in code? My code: #include <SPI.h> #include "MspFlash.h" #define outputA P2_1 #define outputB P2_2 #define flash SEGMENT_D int aState; int aLastState; const int slaveSelectPin = SS; const int shutDownPin = P1_4; int pos=0; int counter=0; int p=0; void setup() { pinMode (outputA,INPUT_PULLUP); pinMode (outputB,INPUT_PULLUP); aLastState = digitalRead(outputA); pinMode (slaveSelectPin, OUTPUT); pinMode (shutDownPin, OUTPUT); SPI.begin(); digitalWrite(shutDownPin, HIGH); digitalPotWrite(1, 0); } void loop() { Flash.read(flash+(pos * sizeof(int)), (unsigned char*)&p, sizeof(int)); counter=p; aState = digitalRead(outputA); if (aState != aLastState){ if (digitalRead(outputB) != aState) { counter=++counter; } else { counter=--counter; } } if (counter <= 255) { if (counter < 0) { digitalPotWrite(1, 0); counter = 0; Flash.erase(flash); Flash.write(flash+(pos * sizeof(int)), (unsigned char*)&counter, sizeof(int)); } else { digitalPotWrite(1, counter); Flash.erase(flash); Flash.write(flash+(pos * sizeof(int)), (unsigned char*)&counter, sizeof(int)); } } if (counter > 255) { digitalPotWrite(1, 255); counter = 255; Flash.erase(flash); Flash.write(flash+(pos * sizeof(int)), (unsigned char*)&counter, sizeof(int)); } aLastState = aState; } int digitalPotWrite(int address, int value) { digitalWrite(slaveSelectPin,LOW); SPI.transfer(address); SPI.transfer(value); digitalWrite(slaveSelectPin,HIGH); } Regards, Superpanky
  16. Hi Guys! I have MSP430 EXP LauchPad for my course. I want to program this lauchpad on Linux Mint but I have some troubles about that. Firstly, I downloaded Code Composer Studio to work on it but I had a error about port FET. Now I decided to download Energia, it looks like arduino IDE that is why I know about cart and port settings. My trouble on Energia is on the picture:
  17. This is my first attempt with Energia. Sorry to ask so many questions. I need to know what state the G2553 is left in after whatever Energia does to it automatically so I know what I need to do, such as: Does it set the top of the stack? Does it set the clock to 1 MHz? 8 MHz? Does it disable the watchdog function? Does it return P2.6 and P2.7 to GPIO use? Does it leave all port pins as inputs with PU resistors? Does it set up a timer to generate interrupts for millis()? Also, where can I find this kind of information? I didn't have any luck searching for it here, or on the .nu site. Thanks
  18. Here are the files for my PCB Exposer/Printer, it is the complete package including mechanical design files. The printer itself. Example - a power control PCB for Raspberry Pi - 40 x 40 mm. Code includes driver for MCP4725 DAC, buffered serial port driver, stepper motor control and command parsing for the MSP430G2553 used as the main controller. Code and design files: PCB Exposer - controller code for MSP430G2553.zip PCB Exposer - desktop application.zip PCB Exposer - mechanical design files in Vectric format.zip PCB Exposer - schematics and PCBs.zip Desktop application is coded in C#, schematics and PCBs in KiCad format. There is some more information to be found in this tread: http://forum.43oh.com/topic/4990-what-are-you-doing-right-now/page-5 Terje
  19. Hi, I am completely new to serial communication. I wish to use a high speed ADC from TI ADS 8361. I want to interface with msp430g2553 using energia IDE. Can I get some code to check the ADC functions.
  20. I believe to have all connections correct from the launchpad to my breadboard, but when I connect VCC to my board the LCD just flickers some vertical lines and then the LCD goes dark again. Anyone have an suggestions? /* The circuit: ================================= LCD pin Connect to --------------------------------- 01 - GND GND, pot 02 - VCC +5V, pot 03 - Contrast Pot wiper 04 - RS Pin8 (P2.0) 05 - R/W GND 06 - EN Pin9 (P2.1) 07 - DB0 GND 08 - DB1 GND 09 - DB2 GND 10 - DB3 GND 11 - DB4 Pin10 (P2.2) 12 - DB5 Pin11 (P2.3) 13 - DB6 Pin12 (P2.4) 14 - DB7 Pin13 (P2.5) 15 - BL+ +5V 16 - BL- GND ================================= */ // include the library code: #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(P2_0, P2_1, P2_2, P2_3, P2_4, P2_5); void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); analogReference(DEFAULT); } void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(millis()/1000); }
  21. Hi everyone I am beginner and I want to use the adxl345 with msp430g2553 with I2C, but the example that I am using don´t working, always send 0 in the axes x,y and z. I use energia 1.6.10e18, the circuit have the pull'up resistor in SDA and SCL pines, and I remove the jumper of the green led. I used the same code but with arduino and it working but with enegia not, help me please. My launchpad is MSP-EXP430G2 rev 1.5 The SCL is connected in pin 14 and the SDA in pin 15. My OS is windows 7 When i put this function "Wire.setModule(0)" the mcu does make nothing, the uart don´t send nothing. The code is the follow: #include <Wire.h> void setup() { Serial.begin(9600); Serial.print("Iniciado"); Wire.begin(); writeTo(DATA_FORMAT, 0x01); //Put the ADXL345 into +/- 4G range by writing the value 0x01 to the DATA_FORMAT register. writeTo(POWER_CTL, 0x08); //Put the ADXL345 into Measurement Mode by writing 0x08 to the POWER_CTL register. } void loop() { uint8_t howManyBytesToRead = 6; readFrom( DATAX0, howManyBytesToRead, _buff); //read the acceleration data from the ADXL345 int X = (((int)_buff[1]) << 😎 | _buff[0]; int Y = (((int)_buff[3]) << 😎 | _buff[2]; int Z = (((int)_buff[5]) << 😎 | _buff[4]; Serial.print("x: "); Serial.print( X ); Serial.print(" y: "); Serial.print( Y ); delay(500); } void writeTo(byte address, byte val) { Wire.beginTransmission(DEVICE); // start transmission to device Wire.write(address); // send register address Wire.write(val); // send value to write Wire.endTransmission(); // end transmission } void readFrom(byte address, int num, byte _buff[]) { Wire.beginTransmission(DEVICE); // start transmission to device Wire.write(address); // sends address to read from Wire.endTransmission(); // end transmission Wire.beginTransmission(DEVICE); // start transmission to device Wire.requestFrom(DEVICE, num); // request 6 bytes from device int i = 0; while(Wire.available()) // device may send less than requested (abnormal) { digitalWrite(RED_LED,HIGH); _buff = Wire.read(); // receive a byte i++; } Wire.endTransmission(); // end transmission }
  22. Usama

    MSP430 GPS

    Hi, Is there any GPS library for energia that supports MSP430g2553? TinyGPS++ doesn't seem to work. Please help. Thank you.
  23. Hi, When doing offset calibration for pH sensor in Arduino we bring pH 7 to 2.5V as Arduino analog output is 5V. Does that mean when the same is done with msp430g2553 the voltage be adjusted to 1.5V as msp430g2553 analog pins output around 3V only? When I tried adjusting the pot I could only bring it to a minimum of 2.5V with msp430. Does anyone know why? Thanks.
  24. I'm trying to create a toggle button but the code is not working. The code is as shown below: #include <msp430g2553.h> int main(void) { WDTCTL = WDTPW + WDTHOLD; // stop watchdog timer P1DIR &= ~BIT3; //P1.3 i/p P1REN |= BIT3; //P1.3 enable pullup resistor P1IES |= BIT3; //P1.3 high to low transition P1IFG &= ~BIT3; //P1.3 clear interrupt flag P1IE |= BIT3; //enable P1.3 interrupt P1DIR |= BIT0; //P1.0 o/p P1OUT &= ~BIT0; //clear P1.0 _BIS_SR(LPM0_bits + GIE); //enter LPM0 with interrupts enabled } #pragma vector = PORT1_VECTOR __interrupt void Port1(void) { P1IFG &= ~BIT3; //clear P1IFG P1OUT ^= BIT0; //toggle LED at P1.0 } Please let me know why it is not working. I am using MS430G2553 launchpad kit. Thanks!
  • Create New...