Search the Community

Showing results for tags 'MSP430'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Calendars

There are no results to display.


Found 223 results

  1. Hello, I have an issue related to SoftwareSerial.h related header file. I place this header file in ..\energia-0101E0017\hardware\cc3200\libraries. But still I got following error: D:\..\energia-0101E0017\hardware\cc3200\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual size_t SoftwareSerial::write(uint8_t)': D:\\..\\energia-0101E0017\hardware\cc3200\libraries\SoftwareSerial\SoftwareSerial.cpp:450:21: error: 'SREG' was not declared in this scope uint8_t oldSREG = SREG; ^ D:\..\energia-0101E0017\hardware\cc3200\libraries\SoftwareSerial\SoftwareSerial.cpp:451:7: error: 'cli' was not declared in this scope cli(); // turn off interrupts for a clean txmit ^ D:\..\energia-0101E0017\hardware\cc3200\libraries\SoftwareSerial\SoftwareSerial.cpp:455:26: error: 'XMIT_START_ADJUSTMENT' was not declared in this scope tunedDelay(_tx_delay + XMIT_START_ADJUSTMENT); ^ D:\..\energia-0101E0017\hardware\cc3200\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual void SoftwareSerial::flush()': D:\..\energia-0101E0017\hardware\cc3200\libraries\SoftwareSerial\SoftwareSerial.cpp:498:21: error: 'SREG' was not declared in this scope uint8_t oldSREG = SREG; ^ D:\..\energia-0101E0017\hardware\cc3200\libraries\SoftwareSerial\SoftwareSerial.cpp:499:7: error: 'cli' was not declared in this scope cli(); ^ So, please give me a solution. Regards, Pratik
  2. Hello, I'm using MSP430F5131 and trying to program it by IAR Embedded Workbench while using the MSP-FET debugger. A short background of the PCB: After i compiled the code in IAR with not errors found , i connected the MSP-FET to the MSP430 in a Spi-Bi-Wire connection according to the datasheet. The MSP430 is placed in a PCB which includes 12V input voltage and 2 regulators of 5V and 3.3V . The MSP430 I/O's are connected according to the datasheet (including external pullup resistors and capacitors) along with the Spi-Bi-Wire connections. I energized the PCB with a 12V supply voltage , connected the MSP-FET's connector to a Header connector on the PCB and the other side connected to the PC by USB. My problem is : In the IAR , once i try to download the code into the MSP430 (by clicking the 'Download and Debug' button) it says that it needs a firmware update , so i clicked ok and download the new update , but when it tries to initialize hardware i encounter the error : "Fatal error: Could not find device (or device not supported) Session aborted!" I have tried multiple things in order to find the solution - with no success . Does the AVcc and AVss needs to be connected even if i dont use any analog options? coz its not connected to anything. I also tried to download the program to the MSP430 with code composer studio but encounter the same error. Thanks in advance.
  3. I have an mpu9250 module (accelerometer + gyro). Is there any sample code or tutorials on how to connect the two and have it work on energia?
  4. System uses PWM outputs to power two brushless DC motors, using servos to rotate the motors. IMG_5778.MOV
  5. I've been using Energia successfully (on Mac) with several programs and the MSP430FR5969 and MSP430F5529 LaunchPad boards for a couple of weeks now. Today I acquired an MSP432P401R LaunchPad and so installed the "Energia MSP432 boards by Energia" package from Boards Manager, version 3.8.0. After that all my MSP430 sources compile with large numbers of errors, and I can't get them to work. Is there some way I can undo the effect of installing the MSP432 update and get back to how things were before? I've tried downloading a fresh copy of the Energia application, and deleting the Energia15 folder in my Library folder, but I still get the errors and nothing works. Help!
  6. Is there any documentation about how to view the assembler code for the object file that the Energia IDE produces? On the Arduino you can do it by copying a line from the verbose compiler output, editing it, and then running it from the command prompt: http://rcarduino.blogspot.co.uk/2012/09/how-to-view-arduino-assembly.html Thank you, David
  7. Hello! In my own automation system I have to encrypt data transferred between sensor and main controller (data transfers via twisted pair). For this reason, I need a special devices - encryption gateways (one gateaway installs on sensor-side, another on controller-side). These gateways realize following algorithm: Sensor-side: Receive some data from sensor (via discrete input); Encrypt data using AES; Transfer encrypted data to controller-side gateway. Controller-side: Receive encrypted data from sensor-side gateway; Decrypt data; Transfer data to controller (via discrete output). So, I need MCU with hardware accelerated AES, LaunchPad kit and Energia IDE support. From MSP portfolio I have chosen two models: MSP432P401R and MSP430FR5994 (MSP430FR5969 and MSP430FR6989 also meet my criteria). What is the best solution suitable for me and my goal? Thank you for your help!
  8. Overview dAISy (do AIS yourself) is a very simple AIS receiver that I developed from scratch. It is built around the Silicon Labs EZRadioPRO Si4362 receiver, using a Texas Instruments MSP430G2553 MCU for processing and the MSP-EXP430G2 v1.5 LaunchPad as development platform. The complete project source code and schematics are available on GitHub: https://github.com/astuder/dAISy Update 5/18/2015: A finished, self-contained AIS receiver based on this project is now available for purchase on Tindie. AIS, short for Automatic Identification System, is a standard for tracking ships. Ships advertise their position, course and other information with short transmissions on specific frequencies (161.975 MHz and 162.025 MHz). More on Wikipedia. An AIS receiver, like dAISy, receives and decodes AIS transmissions. It then re-packages the raw data into NMEA sentences (specifically formatted ASCII strings). Finally, using a serial connection, these strings are forwarded to more capable equipment for further processing. If you're the lucky owner of a tricked out boat, you could connect dAISy to your navigation computer. For land lobbers like me, a more common use case is to run naval mapping software that supports AIS data input on a PC. In the screenshot below I've connected dAISy to OpenCPN (link), an open source chart plotter and navigation software. On the top right you can see my setup war-driving at the Seattle waterfront as my lab is too far from the coast to receive anything. The LaunchPad sits on the dashboard with a white USB cable connecting to the notebook computer in the foreground. dAISy's data is fed into OpenCPN, bottom right shows a log of the serial data received. OpenCPN maintains a database of all the collected data (lower left) and visualizes nearby ships on a map (top center), including past and projected course. Hovering the mouse over a ship will display its name (text on yellow ground) and clicking it will reveal more detail (top left). Hardware I wanted to build my own, non-SDR, AIS receiver for a long time. There are a few projects floating around the internet (e.g. here) which refer back to an article by Peter Baston, published 2008 in Circuit Cellar magazine (copy available here gone.. google for Peter Baston Circuit Cellar to find other copies). Unfortunately, the CMX family of modem ICs by CMS Microcircuits (link) used in these projects are relatively expensive ($15+) and hard to find for hobbyists. In addition you'd need a radio to do tune into and down-convert from the ~162 MHz carrier frequency. So I was quite excited when earlier this year a parametric search on Mouser brought up a new IC that covered the required range (162 MHz) and modulation (GMSK). And best of all, available in single quantities for $3.56 $2.27 $2.22! (link) The Silicon Labs EzRadioPRO Si4362 (link) is a single chip receiver that covers frequencies from 142 to 1050 MHz and supports various modulations, including GMSK. It comes in a tiny 20-pin QFN package and the only external parts required are a 30 MHz crystal, an antenna with a few capacitors and inductors for impedance matching, and finally some decoupling caps and pull-down resistors. Time to whip up a breakout board. I used the opportunity to give KiCad a try and quite like it. Here's the schematic: And the layout: I used OSHPark to make the PCBs. At a smidgen over one square inch it cost $5.15 for 3 copies: http://oshpark.com/shared_projects/QUWi71r4 Note that the layout still has three issues that I already fixed in the schematic: GPIO0 and GPIO1 were flipped SDO required a pull-down resistor as the radio leaves it floating when not actively sending, which confused the hell out of me while trying to figure out the communication protocol. Lastly, the holes for the headers turned out to be slightly too small to comfortably fit the cheap breakout headers I had at hand. Edit: Here's Rev B where I fixed these issues: http://oshpark.com/shared_projects/WI6u3Qmk Which brings us to the BOM: Silicon Labs Si4362 (U1) 30 MHz crystal (X1)Si4362 datasheet specifies <11 pF load capacitance, but a crystal specified for 12pF load capacitance seems to work fine too Antenna/LNA matching network, calculated based on SiLabs AN643 (link, approx. values, +/- 5% shouldn't matter too much):75 ohm (dipole): 10 pF (CR1), 5 pF (CR2), 280 nH (LR1), 200 nH (LR2) 50 ohm: 12 pF (CR1), 6 pF (CR2), 240 nH (LR1), 160 nH (LR2) Decoupling caps:100 pF, 100 nF, 1uF (C1, C2, C3) Pull-down resistors100 k (R1, R2) First thing I noticed when I received the parts: The 20-pin QFN at 4x4 millimeters is tiny! I mounted it by first tinning the pads with a small quantity of solder. I then added flux and placed the chip on the pad. I then used a hot air station to carefully reflow the solder. Worked the first time around. After using jumper wires to figure out how to talk to the chip, I mounted the breakout board on a makeshift BoosterPack using perfboard, double-sided tape and wire (see picture at the top of the post). Here's how I ended up connecting the breakout board to the LaunchPad / MSP430G2553: SEL -> P1.4 (SPI chip select) SCLK -> P1.5 (SPI CLK) SDO -> P1.6 (SPI MISO) SDI -> P1.7 (SPI MOSI) GPIO0 -> P2.0 (I/O unused) GPIO1 -> P2.1 (I/O clear-to-send) GPIO2 -> P2.2 (I/O RX clock) GPIO3 -> P2.3 (I/O RX data) SDN -> P2.4 (shutdown / reset) IRQ -> P2.5 (I/O channel-clear) Software The software of dAISy consists of three major blocks: Radio configuration and control over SPI Packet handler, including a basic FIFO for received messages NMEA encoding and transmission to the PC over UART For UART (TX only) and SPI (TX/RX) I use the MSP430G2553's USCI A0 and B0 respectively. In both cases I don't use interrupts which simplifies things considerably. Upon reset the following steps happen: Initialize MSP430 peripherals Initialize packet handler, which will also reset FIFO Initialize and configure of radio, which will also setup SPI Start packet handler, which will also put the radio into receive mode And in the main loop: If debug messages are enabled, poll packet handler for status and errors and report them over UART Check FIFO for new packets If there is a new packet, invoke NMEA processing (which sends the message over serial to the PC) and remove packet from FIFO Below follows a more detailed discussion of the radio integration and the implementation of the packet handler. Radio The communication with the radio is vanilla SPI using 4 wires: MOSI (SDI), MISO (SDO), CLK (SCLK) and CS (SEL). I used the MSP430's USCI B0 to implement SPI and a separate pin to control CS. The only tricky thing to figure out was, that the Si4362 keeps the MISO line floating unless it actively transmits data. This is unfortunate as the master is supposed to poll for a specific response (FF) to detect when the radio is ready to receive more commands. This is easily fixed by adding a weak pull down resistor to SDO. I did this on the board, but it probably also works with using MSP430's internal pull-down. Additional lines I used to control the radio are: SDN to reset the radio CTS, which by default is mapped to the radio's GPIO1, indicating that the radio is ready for the next command While taking up an extra pin, CTS turned out to be much more convenient than the SPI response code to properly time communication flow with the radio. In dAISy, I wait for CTS to go high after each command to ensure the radio completed its task. The communication protocol is quite extensive but well documented: EZRadioPRO API Documentation describes the complete API and all registers AN633 Programming Guide for EZRadioPro Si4x6x Devices describes how to use the API in common scenarios Both are available on the Si4362 product page (link), under Documentation > Application Notes and are still updated quite frequently. The radio is set up by dumping a large configuration sequence into it. This includes configuration of radio frequency, modulation, GPIO pins and more. This information is stored in radio_config.h, which has to be generated with a tool called WDS (Wireless Development Suite). WDS is available in the Tools section on the Si4362 product site. Above are the settings I used for dAISy. WDS will use this information to configure various amplifiers, filters, clocks and decoding algorithms inside the chip. As Si4362 supports GMSK encoding only indirectly (see this thread), I'm certain there's more optimization potential by tweaking registers, but that's currently way beyond my knowledge of RF theory. While the Si4362 comes with its own packet handler, it unfortunately does not support NRZI encoding (Wikipedia). So I set up the radio to expose the 9600 baud clock and received data on separate pins and implemented my own packet handler. Packet Handler The packet handler (inspired by Peter Baston's implementation) is implemented as a state machine that is invoked on each rising edge of pin P2.2 which receives the data clock. There are 5 main states: Off, no processing of incoming data Reset, start from anew, either on start up or after successful/failed processing of a packet Wait for Sync, waiting for a training sequence to arrive (010101..) and start flag (01111110), implemented with its own state machine Reset, start new preamble 0, last bit was a zero 1, last bit was a one flag, training sequence complete, now process start flag Prefetch, ingest the next 8 message bits to ease further processing Receive Packet, process bits until the end flag (01111110) is found or an error situation occurs Independent of state, the interrupt routine continually decodes NRZI into actual bit sequence. In the "Receive Packet" state there's continuous calculation of the packet CRC and some bit-de-stuffing. When the end flag is found and the CRC is correct, the received message is committed into the FIFO. If an error is encountered, the bytes already written to the FIFO are discarded. In both cases, the state machine starts anew by transitioning into RESET. This reads like a lot of code for an interrupt handler. However with the MCU running at 16MHz even the most complex state only uses a fraction (<10%) of the available time. Future Improvements Lastly a list of things I'd like to improve with the next version of dAISy. Software: Receiving on both AIS channels through channel-hopping done 1/5/2014 Tweak radio settings for better sensitivity and lower error rate LED(s) for indicating reception of valid/corrupt packets Hardware: Proper antenna connector Layout PCB as BoosterPack and/or USB dongle Receiving on both AIS channels at once with two radio ICs -- edit 12/25: replaced original post with high-level project description, more detailed documentation of implementation to come -- edit 12/28: added documentation for hardware (here and on Github), fixed some typos -- edit 12/31: added documentation for software and list of future improvements -- edit 01/05: implemented channel hopping (change to state machine) -- edit 01/15: changed state machine to reflect recent changes (see post further down for details), added link to shared project on OSHPark -- edit 01/25: major rework of sync detection state machine
  9. I am using energia msp430 and gsm900a module. I want to send and receive sms & send sms from msp430 to and gsm900a to any mobile number is working fine but at time of receiving sms in serial monitor of energia is not showing any responses from to incoming msg . I am attaching my code also #include<msp430.h> void setup() { Serial.begin(9600); // Setting the baud rate of GSM Module // Serial.begin(4800); // Setting the baud rate of Serial Monitor (Arduino) delay(1000); } void loop() { if (Serial.available()>0) switch(Serial.read()) { case 's': sendsms(); break; case 'r': RecieveMessage(); break; } if (Serial.available()>0) Serial.write(Serial.read()); } void sendsms() { Serial.println("AT\r"); delay(1000); Serial.println("AT+CMGF = 1\r"); delay(1000); //Serial.println(" AT+CMGS =\"XXXXXXXXXX\"\r"); delay(1000); Serial.println("HELLO WORLD"); delay(1000); Serial.println((char)26); delay(100); } void RecieveMessage() { Serial.println("AT+CMGF = 1\r"); delay(1000); Serial.println("AT+CNMI=2,3,0,0,0\r"); // AT Command to receive a live SMS delay(1000); }
  10. Hi, I needed a way to see how much of my C++ stack was being consumed in my MSP application - the traditional way is to "poison" the stack with a known pattern, and then to see how much of it gets burnt away. So I wrote the following - hope folk find it useful: The following code allows you to simply do this and to check at any point how much of the pre-allocated stack was consumed during peak usage, i.e. how close your app got to the bottom of the stack, or indeed, whether it over-ran. The TI CCS documentation is completely wrong in the names it gives for the global symbols that define the size and start of the stack - needs to be updated, Stick this code (or similar) wherever you want to report on/check stack usage <smallest number of byes left free on the stack since initialisation>/<configured size of the stack>. #if defined(STACK_CHECK) std::printf( "Stack: %d/%d\n", stackMinFreeCount(), stackMaxSize() ); #endif and then, in your main code you need to poison the stack as early as possible and then define the reporting routines: // Define STACK_CHECK to include stack usage diagnostics #define STACK_CHECK #if defined(STACK_CHECK) #define STACK_INIT 0xBEEF // Pattern to use to initially poison the stack extern uint16_t _stack; // Start of stack (low address) uint16_t stackMinFreeCount(void); uint16_t stackMaxSize(void); #endif #if defined(__cplusplus) extern "C" { #endif #if defined(__TI_COMPILER_VERSION__) || \ defined(__GNUC__) int _system_pre_init( void ) #elif defined(__IAR_SYSTEMS_ICC__) int __low_level_init( void ) #endif { //... stuff... #if defined(STACK_CHECK) // // Poison the stack, word by word, with a defined pattern // // Note that _system_pre_init is the earliest that we can // do this and that it may not be possible in TI-RTOS // // When we call the __get_SP_register intrinsic (same on IAR & CCS), it will return the address // of the RET address for the caller of this routine. Make sure that we don't trash it!! // register uint16_t *stack = &_stack; // Address of lowest address in .stack section register uint16_t *stack_top = reinterpret_cast<uint16_t *>(__get_SP_register()); do { *stack++ = STACK_INIT; // Poison stack addresses } while (stack < stack_top); // Stop before top of stack to leave RET address #endif return 1; } #if defined(__cplusplus) } #endif #if defined(STACK_CHECK) /** * Check how deep the stack usage has been * * \return \c uint16_t Minimum number of bytes to bottom of stack */ extern uint16_t __STACK_END; // End of data extern uint16_t __STACK_SIZE; // Linker-set size of stack uint16_t stackMinFreeCount(void) { const uint16_t *stack = &_stack; uint16_t freeCount = 0; while (*stack == STACK_INIT && stack++ <= &__STACK_END) { freeCount++; } return freeCount << 1; } /** * Return size of C++ stack * * Set by the linker --stack_size option * * \return \c uint16_t Configued maximum size of the stack in bytes */ uint16_t stackMaxSize(void) { return static_cast<uint16_t>( _symval(&__STACK_SIZE) ); } #endif int main(void) { ... stuff #if defined(STACK_CHECK) std::printf( "Stack: %d/%d\n", stackMinFreeCount(), stackMaxSize() ); #endif ...stuff }
  11. So I have my MSP430 launchpad with g2553 and g2452 lying around for year now and finally have a reason to use it. I'm a total noob (I mean I programmed some assembler and C in college and know some basic stuff about MCUs but never actually put it to use), but my for my first project I've picked a tough one. That way I'll be challenged and won't get bored. So I've just bought a motherboard that only has 2 fan connectors on it, but I need at least 4 of those, so I decided to make a fan controller. I could just use some 7805s but what's the fun in that? The idea is to use the inferior msp430g2452 controller from the launchpad to generate 4 pwm channels to control 4 fans by changing the duty cycle with potentiometers. From what I've found on the internet, you can only have as many PWM channels as Capture/Compare Registers on a timer, but the first one will always be used for frequency and have 50% duty cycle. 2452 has only one timer with 3 CCRs, so I could only use 2 PWM channels. With g2553 in a 20 pin package that number is 3 and for SMD package you could have 4 PWM channels. But from what I understand from page 6 in tidu761 design guide, you could have as many software PWM channels as you have GPIO pins available. They can all be the same frequency after all, I only need to change the duty cycle. So far as I keep researching design guides and datasheets I have a few questions: 1) What frequency should I use for PWM? I'm guessing it should at least be outside the audible range, so 25 to 30khz should be fine, right? 2) What pins should I use? I would need at least 4 pins for potentiometers, say P1.0 through P1.3 and 4 pins for PWM, P2.0 to P2.3 would be fine? Or should I use some specific pins? Thanks for reading this!
  12. I know I haven't finished off my desk clock project just yet, But I've been requested to design a new GPS logging device for my sisters Beagle Club, The basic idea is that a sent is placed with a guy that forms a path, the GPS logger is taken along also. They then attach the device to a beagle (using some kind of vest, I think). And let them follow the scent. Post event they extract the GPS data from the logger and overlay both tracks in google earth. They have one unit that has been working well for them, developed by a previous club member. It consists of off the shelf components from Sparkfun. With a total BOM just over $150 Logomatic V2 (https://www.sparkfun.com/products/12772) GPS (https://www.sparkfun.com/products/8975) 128mb uSD Old Cell phone battery (Li-ion) (~700mAh judging from physical size) All of these are connected together and fit into an off the shelf jiffy box. They would like 5 more made, which would perform identical/similar function Design goals: Lower cost (< $50AUD per unit, making 5 units) Externally operates identically to the old versionUSB MSC Logs start when unit powered on via toggle switch new log created when button pressed All additional tools stored on SD card (GPS utilities, past logs) Long battery life, unit should operate for > 10Hours Physically the same size or smaller (if time allows, a simple PC tool to to reset the device into DFU mode, and update the firmware) I'm planning to source a more slimline case. once I have that I will begin PCB design. I have drawn some quick System level schematics The hardware is pretty straight forward Same with the software, I have already played with the MSP430 USB MSC examples, and am familiar with FATFS. I should be able to glue in some UART code to get it all to work. The device will operate under two modes depending on if it's connected to USB or not. Hopefully someone will find this mildly interesting as I work through it.
  13. I'm attaching a link to github with Energia code examples for various sensors. I started this as a place to put examples for students in a course I was helping to develop for middle and high school level students using the MSP430F5529. Unfortunately the course was not held but I'm putting them out there in the hope they might help someone. Where the code has been tested with other LaunchPads I've noted it. Here it is: https://github.com/fmilburn3?tab=repositories You won't find anything sophisticated but many are at least somewhat unique in that I couldn't find an example for that sensor tailored specifically for the F5529, or I wanted to better document it for beginners. Essentially all are variants of work done by others, including work on 43oh, and I hope I've recognized the contribution in the code. There is a wiki associated with some that has the schematic and photographs. There is some other example code that is almost complete - e.g. using small DC motors and servos and I might add them. Here is a list of sensors and devices currently out there: CNY70 - used as a proximity switch CNY70 - used as a tachometer MCP41010 - digital pot HC-SR04 - distance sensor 3 watt high intensity LED MAX4466 -sound level I2C LCD (4x20) and (2x16) HC-SR501 - PIR movement detection SW-180xxP - vibration sensor Joystick PFatFs - compiles and runs on the F5529 Hall effect rainfall sensor TMP36 - temperature Sharp GPf1S53VJ000F - photo interrupter Using low power modes (LPM) in Energia TCS3200 Color Sensor using MSP432 *** added 8/8/15 DS1307 Real Time Clock (RTC) Module *** added 8/9/15 INA125P Instrumentation Amplifier *** added 10/9/15 MCP3008 ADC *** added 10/12/15 TLC5615 DAC *** added 11/30/15 dAISy MarineTraffic shore station w/ CC3200 ** added 12/16/15 AD9850 Frequency Generator ** added 1/20/16 FFT ** added 1/20/16 Rotary encoder ** added 1/23/16 W5500 Ethernet ** added 3/25/16 MSP430G2955 pins_energia.h ** added 3/25/16 DriverLib examples for F5529 ** added 8/16 Infrared Transmission ** added 12/16 WS2812 LEDs using SPI ** added 12/16 Battery measurement ** added 1/17 Finite State Machine - alarm system ** added 2/6/17 Using RTC module with Energia - F5529 ** added 2/24/17
  14. Hello, I am hoping to convert Example 09 of the Energia examples (thermistor temperature with the MSP430F5529) to entirely C language to use in Code Composer Studio - I've already used the import function to use this example in CCS and it works fine with the code given, but I'd like to re-work the example to only use C functions like main().c. Is there a simple way to do this? I'm still learning C and need the experience! Example 09 is attached for reference.EXAMPLE09_Temperature.ino
  15. Came across this while browsing. MSP430 Analog Gauge Clock
  16. Hi , I am interfacing MSP430F5529 and SIM900A using energia software. I have tried the code using Arduino Uno before and it seemed to work fine. However when I try the same with msp430 , there is no output on the serial monitor. Few days back I came to know that there is a voltage mismatch between the msp430 output and sim900 input and as suggested by few members of the thread , I am supposed to use a voltage translator to convert the 3.3V output of the Msp430 board and then apply it to sim900A module. They recommended Rs232 for this purpose . I want to know the connection that'll be required to made in order to translate the voltage of the msp430. Where do I connect the rs232 cable and where do I apply it's output voltage ? Thank you .
  17. I am interfacing LM35 and SIM900 using MSP430F5529 board . For this purpose i am using Energia software . As we all know arduino code is compatible in Energia . Hence , I have used the same code that i used in Arduino Uno . The code works fine and i get my thingspeak channel updated with every HTTP request however , when i use Energia , it doesnt show any error , neither does it show/update my thingspeak channel . I had used Pin 7 and 8 for receiving and transmitting in Arduino . In Msp430 , I have used Pin P3.4 and P3.3 for receiving and transmitting . My Energia code is as follows - #include <SoftwareSerial.h> #include <String.h> SoftwareSerial mySerial(P3_4, P3_3); boolean pin2=LOW,pin3=LOW,pin4=LOW,pin5=LOW,pin6=LOW; float temp=0.0; void setup() { mySerial.begin(9600); // the GPRS baud rate Serial.begin(9600); // the GPRS baud rate pinMode(2,INPUT); pinMode(3,INPUT); pinMode(4,INPUT); pinMode(5,INPUT); pinMode(6,INPUT); delay(1000); } void loop() { temp=analogRead(A0); temp=temp*0.4887; delay(2); Send2Pachube(); if (mySerial.available()) Serial.write(mySerial.read()); } void Send2Pachube() { mySerial.println("AT"); delay(1000); mySerial.println("AT+CPIN?"); delay(1000); mySerial.println("AT+CREG?"); delay(1000); mySerial.println("AT+CGATT?"); delay(1000); mySerial.println("AT+CIPSHUT"); delay(1000); mySerial.println("AT+CIPSTATUS"); delay(2000); mySerial.println("AT+CIPMUX=0"); delay(2000); ShowSerialData(); mySerial.println("AT+CSTT=\"aircelgprs\"");//start task and setting the APN, delay(1000); ShowSerialData(); mySerial.println("AT+CIICR");//bring up wireless connection delay(3000); ShowSerialData(); mySerial.println("AT+CIFSR");//get local IP adress delay(2000); ShowSerialData(); mySerial.println("AT+CIPSPRT=0"); delay(3000); ShowSerialData(); mySerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\"");//start up the connection delay(6000); ShowSerialData(); mySerial.println("AT+CIPSEND");//begin send data to remote server delay(4000); ShowSerialData(); String str="GET https://api.thingspeak.com/update?api_key=--------C&field1=" + String(temp); mySerial.println(str);//begin send data to remote server delay(4000); ShowSerialData(); mySerial.println((char)26);//sending delay(5000);//waitting for reply, important! the time is base on the condition of internet mySerial.println(); ShowSerialData(); mySerial.println("AT+CIPSHUT");//close the connection delay(100); ShowSerialData(); } void ShowSerialData() { while(mySerial.available()!=0) Serial.write(mySerial.read()); }
  18. In my project, I use a few basic macros for GPIO. The goal is, that I can easily redefine pin assignment in a central location without compromising performance or code size. The macros (gpiomacros.h): // MSP430 gpio macros #define GPIO_SEL(port) P ## port ## SEL #define GPIO_DIR(port) P ## port ## DIR #define GPIO_OUT(port) P ## port ## OUT #define GPIO_IN(port) P ## port ## IN #define GPIO_IS_INPUT(port,pin) { GPIO_SEL(port) &= ~(pin); GPIO_DIR(port) &= ~(pin); } #define GPIO_IS_OUTPUT(port,pin) { GPIO_SEL(port) &= ~(pin); GPIO_DIR(port) |= (pin); } #define GPIO_IS_PERIPHERAL_IN(port,pin) { GPIO_SEL(port) |= (pin); GPIO_DIR(port) &= ~(pin); } #define GPIO_IS_PERIPHERAL_OUT(port,pin) { GPIO_SEL(port) |= (pin); GPIO_DIR(port) |= (pin); } #define GPIO_SET(port,pin) { GPIO_OUT(port) |= (pin); } #define GPIO_CLEAR(port,pin) { GPIO_OUT(port) &= ~(pin); } #define GPIO_READ(port,pin) ( GPIO_IN(port) & (pin) ) In a central configuration file (e.g. hardware.h) I assign pins like this: // Pin assignment #define LED1_PIN BIT1 #define LED1_PORT 6 #define LED2_PIN BIT0 #define LED2_PORT 1 And then in the code I interact with GPIO like this: // Setup LEDs GPIO_IS_OUTPUT(LED1_PORT, LED1_PIN); GPIO_IS_OUTPUT(LED2_PORT, LED2_PIN); // Turn off LEDs GPIO_CLEAR(LED1_PORT, LED1_PIN); GPIO_CLEAR(LED2_PORT, LED2_PIN); The macros are resolved in two steps: 1. Higher level "functions" define the commands. E.g. GPIO_SET(), GPIO_IS_OUTPUT(), .. 2. Lower level macros used within those functions translate port, pin to a register. E.g. GPIO_IN(), GPIO_SEL(), .. The end result is code like you would write when directly working with the GPIO registers. E.g. P2OUT &= ~BIT0; Note that this translation is done by the C pre-processor before the code is compiled. This all works fine and dandy, with the exception of port J. Port J doesn't have a SEL register, which breaks the 1st half of the GPIO_IS_OUTPUT and GPIO_IS_INPUT macros. I currently work around this by adding special GPIO_IS_OUTPUT/INPUT_J macros, but then the main code needs to include some logic to invoke the proper macro. #if (LED2_PORT == J) GPIO_IS_OUTPUT_J(LED2_PORT, LED2_PIN); #else GPIO_IS_OUTPUT(LED2_PORT, LED2_PIN); #endif Any ideas, how I could include a condition inside macros, that checks whether the port is J, and if so excludes the GPIO_SEL command? And yes, I could probably use C++ templates with identical results and an easy workaround for port J, but I'd like to avoid migrating my plain old C project. Edit: Added a few missing parentheses, thanks to Rickta59 for spotting that
  19. Hello I have been trying to implement multiceiver on nrf24l01 and msp430g2553. Basically I am trying to use different pipes for the same rf channel. The library and the example code I am using is the spirilis one, one of the most common. The problem is that I can only work with the default pipe 0 given in the code when ever I try to use the other pipes I can't get anything. I read the datasheet about the multiceiver part, I guess I understand both the code and the working mechanism but I still can't use the different pipes. Any help would be appreciated. What I do is that; at first by using msprf24_set_pipe_packetsize() and msprf24_open_pipe functions I set the pipe I would like to use which is from 0 to 5. Then I try for the given addresses on both tx and rx I set it to same pipe number and the same pipe address but only the default(one I posted here) works for the pipe 0 and that given address.
  20. Hello I'm have two problem with the version 18 of energia. 1.- When I try to program my msp430g2553 the IDE show the message: exec: "C:\\Users\\CORE RIKMED\\Downloads\\energia-1.6.10E18\\hardware\\tools\\msp430/bin/msp430-g++": file does not exist Error compilaci
  21. Hey dear all, I am new at the website, have been searching for the same issue but couldn't really found. I am trying to drive 2*16 lcd on msp430g2553 with code composer. http://www.instructables.com/id/16x2-LCD-interfacing-in-4-bit-mode/step2/Code-and-Connections/ I am using the library above, It actually works fine with the port connections written. What I am trying to do is I want to transform all the ports into port2. P1.0 - D4 Pin11 to P2.0 P1.1 - D5 Pin12 to P2.1 P1.2 - D6 Pin13 to P2.2 P1.3 - D7 Pin14 to P2.3 P1.4 - RS Pin4 to P2.4 P1.5 - R/W Pin5 to P2.5 P1.6 - E Pin6 to P2.6 The thing I do is that; instead of P1OUT and P1DIR I used P2OUT and P2DIR but it doesn't work, have been trying for a day but no result. Sure that port connections are correct, checked for many times, there must be something I miss about the code. Any help would be appreciated, thank you.
  22. Has anyone been able to find a library or had any success in making their own library for the HX711 for use with Energia. I know there is a link on Github with the header and source files for Arduino but they do not work for me. The link I'm referring to is https://github.com/bogde/HX711 Thanks for any help!
  23. hello all !! I'd been worked with MSP430G25530 target for Frequency measurment ... I have a code but, when I use the Serial.print (). nothing show up. any helps please ? my code : Freq-Measurment.ino
  24. Hi all, I have recently found a sketch in arduino forum for frequency counting, which I tried running in MSP432 with energia and MSP430 with energia sketch on Code composer studio. The sketch basically counts the frequency using interrupts and prints the frequency on serial monitor but serial monitor is empty while running the program,.The sketch is as shown below, // Frequency counter sketch, for measuring frequencies low enough to execute an interrupt for each cycle // Connect the frequency source to the INT0 pin (digital pin 2 on an Arduino Uno) volatile unsigned long firstPulseTime; volatile unsigned long lastPulseTime; volatile unsigned long numPulses; void isr() { unsigned long now = micros(); if (numPulses == 1) { firstPulseTime = now; } else { lastPulseTime = now; } ++numPulses; } void setup() { Serial.begin(115200); // this is here so that we can print the result pinMode(3, OUTPUT); // put a PWM signal on pin 3, then we can connect pin 3 to pin 2 to test the counter analogWrite(3, 128); } // Measure the frequency over the specified sample time in milliseconds, returning the frequency in Hz float readFrequency(unsigned int sampleTime) { numPulses = 0; // prime the system to start a new reading attachInterrupt(0, isr, RISING); // enable the interrupt delay(sampleTime); detachInterrupt(0); return (numPulses < 3) ? 0 : (1000000.0 * (float)(numPulses - 2))/(float)(lastPulseTime - firstPulseTime); } void loop() { float freq = readFrequency(1000); Serial.println(freq); delay(1000); }
  25. HI If i import my ENERGIA project to CCS V6.1, can i also use the gui composer for the same project? best regards, avi