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

  1. Hi, I'm working in this library with some useful DSP and math functions (ideally focusing on embedded systems). Currently it's in the initial version with few functions, but I hope to add more in the next update. I prefered to use some structs to save parameters and use just one function to various instances of filters (very versatile). Functions - High Pass Filter (Single pole): Float, fixed and fixed extended version (with more bits to fractional part) - Low Pass Filter (Single Pole): Float, fixed, fixed extended and fixed fast (with some limitations related to cuttof frequency, but more efficienty. - RMS value: calculate RMS value of an array or sample by sample. Currently using square root function of math.h, but in the next update I will add a optimized version. I hope this can be useful. Feel free to test, share and contribute with this project. Github: https://github.com/agaelema/DSP_and_Math
  2. Dear developers, model of LaunchPad used and revision number : MSP430 Launchpad : rev-3 model of the MCU used : msp430g2553 model of BoosterPack used or model of the sensor or actuator or screen : Sensor : Honeywell HIH9000 series humidity and temperature transmitter optionally, links to the sensor or actuator or screen data sheet : NA name and version of the IDE used : Energia IDE V18 OS the IDE is running on : Linux Mint 18.2 Sonya I am simply using Serial.println(); command, but I get some weird characters in the serial port display window. Code : #include <Wire.h> // HIH6130 I2C address is 0x27(39) #define Addr 0x27 int tzero = 196; int tspan = 17; int hzero = 196; int hspan = 17; void setup() { Wire.setModule(1); Wire.begin(); pinMode(P1_3,OUTPUT); pinMode(P1_2,OUTPUT); pinMode(P1_6,OUTPUT); Serial.begin(9600); Serial.println("OK"); delay(300); } void loop() { unsigned int data[4]; // Start I2C Transmission Wire.beginTransmission(Addr); // Select data register Wire.write(0x00); // Stop I2C Transmission Wire.endTransmission(); // Request 4 bytes of data Wire.requestFrom(Addr, 4); // Read 4 bytes of data // humidity msb, humidity lsb, temp msb, temp lsb if (Wire.available() == 4) { data[0] = Wire.read(); data[1] = Wire.read(); data[2] = Wire.read(); data[3] = Wire.read(); } // Convert the data to 14-bits float humidity = ((((data[0] & 0x3F) * 256) + data[1]) * 100.0) / 16383.0; float temp = ((data[2] * 256) + (data[3] & 0xFC)) / 4; float cTemp = (temp / 16384.0) * 165.0 - 40.0; // Output data to serial monitor Serial.print("Relative Humidity :"); Serial.println(humidity); Serial.println(" %RH"); Serial.print("Temperature in Celsius :"); Serial.println(cTemp); Serial.println(" C"); Serial.println("=============================================================== "); int VcTemp = map(cTemp, -5, 125, tzero, tspan ); int vhumidity = map (humidity, 0, 100, hzero, hspan); analogWrite(P1_2, VcTemp); analogWrite(P1_6, vhumidity); delay(1000); } Serial Output : (in one single line, means it keeps printing these characters in just one line on and on.picture : Thax.
  3. Dear developers, I am simply using Serial.println(); command, but I get some weird characters in the serial port display window. Code : #include <Wire.h> // HIH6130 I2C address is 0x27(39) #define Addr 0x27 int tzero = 196; int tspan = 17; int hzero = 196; int hspan = 17; void setup() { Wire.setModule(1); Wire.begin(); pinMode(P1_3,OUTPUT); pinMode(P1_2,OUTPUT); pinMode(P1_6,OUTPUT); Serial.begin(9600); Serial.println("OK"); delay(300); } void loop() { unsigned int data[4]; // Start I2C Transmission Wire.beginTransmission(Addr); // Select data register Wire.write(0x00); // Stop I2C Transmission Wire.endTransmission(); // Request 4 bytes of data Wire.requestFrom(Addr, 4); // Read 4 bytes of data // humidity msb, humidity lsb, temp msb, temp lsb if (Wire.available() == 4) { data[0] = Wire.read(); data[1] = Wire.read(); data[2] = Wire.read(); data[3] = Wire.read(); } // Convert the data to 14-bits float humidity = ((((data[0] & 0x3F) * 256) + data[1]) * 100.0) / 16383.0; float temp = ((data[2] * 256) + (data[3] & 0xFC)) / 4; float cTemp = (temp / 16384.0) * 165.0 - 40.0; // Output data to serial monitor Serial.print("Relative Humidity :"); Serial.println(humidity); Serial.println(" %RH"); Serial.print("Temperature in Celsius :"); Serial.println(cTemp); Serial.println(" C"); Serial.println("=============================================================== "); int VcTemp = map(cTemp, -5, 125, tzero, tspan ); int vhumidity = map (humidity, 0, 100, hzero, hspan); analogWrite(P1_2, VcTemp); analogWrite(P1_6, vhumidity); delay(1000); } Serial Output : (in one single line, means it keeps printing these characters in just one line on and on.picture : Thax.
  4. I don't know why but my energia is running very slow. All the other apps are running at good speed. I am using windows 10 64-bit version. I am using Energia V17. Pictures from my task manager are attached here, please take a look at it. Thax and peace.
  5. Hello everyone, I have a project which requires GPS + Wi-fi capability and fastest clock speed mcu possible. For GPS capability I came across CC4000 which seems alright, but I'm confused on which launchpad board to select that has Wifi capability also. I have worked on Arduino but new to TI's Launchpad. Please suggest me for what should I buy. link for the CC4000 gps module kit : http://www.ti.com/tool/cc4000gpsem?keyMatch=gps&tisearch=Search-EN-Everything#descriptionArea
  6. Hello again, I am trying to connect up 2 MSP430FR4133 using the slave_sender and Master_reader examples in the energia given examples. There is no information about which pins to use but RXD and TXD are the only pins outputting on the scope so i have tried these pins. I have also tried connecting up the pins that say they are for SPI on the pin layout to no success. Any help would be greatly appreciated. Kind regards, Chris
  7. After joining this forum over 3 years ago I thought it overdue that I say hello and contribute something that I hope you will find useful. Attached is a picture of simple booster packs that I make. But are they really a "booster pack"? Hmmm. Debatable! They are cheap and easy to make and I have made 5 of them. I use them all the time because the whole of each project, including the MSP430, is attached to the booster pack. This means I can switch between projects without re-wiring, I can change the model of MSP430 in seconds and I only need one Launchpad. You can see from the picture that I provide two sets of header pins to attach "stuff" to, but provide four header pins for the 3.3V and GND. I also use long-leaded header plugs, partly because I have to solder the strip boards "upside down" (notice the small gap between the strip board and the header sockets) and also because the excess leads are easily accessible test points for things like logic analysers, etc. I keep the strip board to the smallest possible size so that all the Launchpad jumpers remain accessible. I've tried different designs, some with LEDs, switches, small breadboards and more besides, but this is the one I use all the time. I call it a "pop top" because you pop the top off a launchpad and swap it for another, then another. That's all for now. Hopefully it'll not be another 3 years before my next posting!
  8. Hey everyone, I am trying to reduce the power consumption of my msp430FR4133 by reducing the clock speed from 8MHZ. I am using the http://annem.github.io/ADXL362/ example code as a base which sets the default clock speed to 8MHZ. I have read that the Wiring.c file defines the clock speed but I cannot find where F_CPU is defined. Any help would be greatly appreciated thanks.
  9. Hi, Wondering if anyone can confirm if the MSP430 source code listed in this article can indeed be used with Energia (IDE and library) ? Idea being mixing Energia library for AnalogRead and SPI data sending capability. Also, I'd like to use the LP with MSP430G2553 to perform ADC for 6-8 channels, and convey the same to RaspberryPi over SPI using this mechanism. Given the very limited RAM on MSP430G2553, what is the likelihood of being able to squeeze in such functionality along with the SPI communication ? Pointers to any existing projects at achieving similar goals, would be highly appreciated. regards, BD
  10. 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
  11. Hi, These after read this thread about how to use temperature calibration data, I tried to use TLV register to obtain the "real" voltage reference value and increase the ADC conversion by compensating the gain and offset. The test was performed in a Launchpad EXP430FR6989, but can be applied to other launchpads compatible with MSP430Ware driverlib. The increase in the accuracy is very interesting. in the table (sorry by the comma instead of point, brazilian notation). HP 3478A - value measured with DMM ADC_correct1 - value measured with MSP430 without any correction ADC_correct4 - with all corrections using float variables ADC_correct5 - using mainly integer Here there is an article about this test and the Github with the example. Regards
  12. I am developing a timeout / soft timer library for the MSP43x and would like to share it with you. It's still in the initial version, but all the functions are working. I'm developing and testing on MSP430F6736, but it worked fine on launchpad EXP430F5529LP. The library uses a timer to periodically generate ticks. In the base version developed by Felipe Lavratti, the timer-tick occur every 1us through a 32-bit timer (ARM Cotex). To avoid overloading the CPU I modified the code to accept longer time intervals and also functions to automatically calculate the Capture / Compare value of the timer. I also tried to isolate the timer configuration in a separate file, so in the future it would allow to select from more than one timer source or different devices, perhaps with compatibility with the old Value Line uCs. How the objective is not to give a perfect time base in us, I'm using ticks of 100us (10kHz) and works very well. The library has delay, getTime, and Timeout functions, the latter two of which are interesting for managing tasks without holding down processing like a normal delay. The example using the EXP430F5529LP use delay_Ms function to toggle 4 times both leds, geTime_ms() to toggle LED1 every 234ms and timeoutCheck_ms() to toggle LED2 every 1s. Feel free to leave your opinions and contribute to the project - Github of project Thank you.
  13. I'm new to MSP430 and I'm trying to do a frequency/period measurement. I've read about timers and get the main concepts though I'm still learning. To get an idea of how they work, I'm using this code. It outputs a PWM on one pin which I connect to another pin for capturing period: http://coecsl.ece.illinois.edu/ge423/datasheets/MSP430Ref_Guides/Cexamples/MSP430G2xx3 Code Examples/C/msp430g2xx3_ta_21.c After making some modifications (removing unneeded code to light led and adding calculations for frequency) it works with the original pins. However, I want to change which input pin will take measurements. I want pin 2.0 to do so. Currently, TimerA0 captures and TimerA1 outputs PWM. Since PIN 2.0 uses TimerA1 and not A0, I assumed I would just need to flip the timers and pins. However, it's not working. I looked at the datasheet and can't figure out whats wrong. What am I missing? Here is my code: #include <msp430.h> unsigned char Count, First_Time; unsigned int REdge1, REdge2, FEdge; int main(void) { unsigned int Period, ON_Period; unsigned char DutyCycle; WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer // P1SEL |= BIT0; if (CALBC1_8MHZ==0xFF) // If calibration constant erased { while(1); // do not load, trap CPU!! } DCOCTL = 0; // Select lowest DCOx and MODx settings BCSCTL1 = CALBC1_8MHZ; // Set DCO to 8MHz DCOCTL = CALDCO_8MHZ; // Configure Port Pins P1DIR |= BIT2; // P2.1/TA1.1 Output P1SEL |= BIT2; // TA1.1 Option select P2DIR &= ~BIT0; // P1.1/TA0.1 Input Capture P2SEL |= BIT0; // TA0.1 option select // Configure TA1.1 to output PWM signal // Period = 82/32khz = 2.5ms ~ 400Hz Freq TA0CCR0 = 82-1; // Period Register TA0CCR1 = 21; // TA1.1 25% dutycycle TA0CCTL1 |= OUTMOD_7; // TA1CCR1, Reset/Set TA0CTL = TASSEL_1 + MC_1 + TACLR; // ACLK, upmode, clear TAR // Configure the TA0CCR1 to do input capture TA1CCTL1 = CAP + CM_3 + CCIE + SCS + CCIS_0; // TA0CCR1 Capture mode; CCI1A; Both // Rising and Falling Edge; interrupt enable TA1CTL |= TASSEL_2 + MC_2 + TACLR; // SMCLK, Cont Mode; start timer // Variable Initialization Count = 0x0; First_Time = 0x01; while(1) { __bis_SR_register(LPM0_bits + GIE); // Enter LPM0 __no_operation(); // For debugger // On exiting LPM0 if (TA1CCTL1 & COV) // Check for Capture Overflow while(1); // Loop Forever Period = REdge2 - REdge1; // Calculate Period ON_Period = FEdge-REdge1; // On period DutyCycle = ((unsigned long)ON_Period*100/Period); } } // TA0_A1 Interrupt vector #pragma vector = TIMER1_A1_VECTOR __interrupt void TIMER1_A1_ISR (void) { switch(__even_in_range(TA1IV,0x0A)) { case TA1IV_NONE: break; // Vector 0: No interrupt case TA1IV_TACCR1: // Vector 2: TACCR1 CCIFG if (TA1CCTL1 & CCI) // Capture Input Pin Status { // Rising Edge was captured if (!Count) { REdge1 = TA1CCR1; Count++; } else { REdge2 = TA1CCR1; Count=0x0; __bic_SR_register_on_exit(LPM0_bits + GIE); // Exit LPM0 on return to main } if (First_Time) First_Time = 0x0; } else { // Falling Edge was captured if(!First_Time) { FEdge = TA1CCR1; } } break; case TA1IV_TACCR2: break; // Vector 4: TACCR2 CCIFG case TA1IV_6: break; // Vector 6: Reserved CCIFG case TA1IV_8: break; // Vector 8: Reserved CCIFG case TA1IV_TAIFG: break; // Vector 10: TAIFG default: break; } } I checked and there is a pulse going into P2.0 but P2.0 is not capturing it. Is it just not possible with this pin or am I missing something obvious?
  14. I have the chip number MSP430FR6989 and I want to use it to read 10 analog DC signals then do some processing (multiply them by certain factors) after that I want to convert them back to analog using PWM and RC filter, my issue is in the second part , how to use timers( set period , duty cycles) of the MSP430 to produce PWMs from the analog inputs. This is the code: #include <msp430.h> #define ACLK 0x0100 // Timer ACLK source #define UP 0x0010 // Timer UP mode #define ENABLE_PINS 0xFFFE // Required to use inputs and outputs #define ENABLE_PINS 0xFFFE // Enables inputs and outputs void ADC_SETUP(void); // Used to setup ADC12 peripheral const int x1=1; const int x2=1; volatile int multiplied_value,duty; main() { PM5CTL0 = ENABLE_PINS; // Enable inputs and outputs P1DIR =BIT0; // Set RED LED to output ADC_SETUP(); // Sets up ADC peripheral while(1) { ADC12CTL0 = ADC12CTL0 | ADC12ENC; // Enable conversion ADC12CTL0 = ADC12CTL0 | ADC12SC; // Start conversion while ( ADC12BUSY == 1){ multiplied_value = (ADC12MEM0); if (multiplied_value > 0x800) // If input > 1.65V { P1OUT = BIT0; // Turn on red LED } else // Else input <= 1.65V { P1OUT = 0x00; // Turn off red LED } P1DIR |= BIT5; // P1.5 to output P1SEL1 |= BIT5; // P1.5 to TA0.1 TA0CCTL1 = OUTMOD_7; // CCR1 reset/set TA0CCR1 = multiplied_value*65536/3.3 ; duty=TA0CCR1;// CCR1 PWM duty cycle TA0CCR0 =1000; // PWM Period TA0CTL = TASSEL_2 + MC_1; // SMCLK, up mode _BIS_SR(LPM0_bits); // Enter LPM0 } } } void ADC_SETUP(void) { #define ADC12_SHT_16 0x0200 // 16 clock cycles for sample and hold #define ADC12_ON 0x0010 // Used to turn ADC12 peripheral on #define ADC12_SHT_SRC_SEL 0x0200 // Selects source for sample & hold #define ADC12_12BIT 0x0020 // Selects 12-bits of resolution #define ADC12_P92 0x000A // Use input P9.2 for analog input //#define ADC12_P43 0x000A //#define ADC12_P32 0x000A //#define ADC12_P93 0x000A //#define ADC12_P14 0x000A //#define ADC12_P20 0x000A //#define ADC12_P41 0x000A ADC12CTL0 = ADC12_SHT_16 | ADC12_ON ; // Turn on, set sample & hold time ADC12CTL1 = ADC12_SHT_SRC_SEL; // Specify sample & hold clock source ADC12CTL2 = ADC12_12BIT; // 12-bit conversion results ADC12MCTL0 = ADC12_P92; // P9.2 is analog input //ADC12MCTL1 = ADC12_P43; } I have the voltmeter, when I measure the frquency at the pin1.5 it gives me a number reanges between 14kHz to 0.11.. I'm not sure if I used PWM correctly?
  15. Hi, I am using MSP430 launchpad with G2553 controller. When I am using sleep(5000), and varying the voltage on the controller from 3v to 4v the timing is varying based on the voltage, but the timing in not changing when I am using delay(5000) when I am varying voltage. Any help will be appreciated. Regards,
  16. 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
  17. This project is an offshoot of an earlier investigation of wireless wearables using the MSP430G2553: http://forum.43oh.com/topic/10060-msp430-wearable-with-radio/. The concept has been successfully tested and is described below. I plan regular updates as the project progresses. The objective is to develop a wearable powered by a coin cell that can be controlled remotely. It could be used, as an example, in the tiara below or on a costume worn by dancers in a performance and controlled from offstage. In the photo an earlier MSP430G2553 coin cell powered wearable is attached to the tiara and driving 3 WS2812 LEDs. The constraints are: cost - unit cost for the receiver of $10 or less technology - common off the shelf components, MSP430G2553 construction - standard double sided PCB spec, keep SMD parts large enough to be hand soldered power - CR2032 (rated 3V and 225 mAH) life - needs to run at least half an hour on fresh batteries reception - 10m with clear line of sight, update at least every 100 ms transmission - desirable but not required size - 40mm/1.6" diameter for receiver programming - Energia desirable schedule - 6 month completion The transmitter will probably be placed on a "Booster Pack" for a LaunchPad running Energia. Multiple LEDs will be driven to gain extra distance, and if required multiple transmitters could be set up from different angles to assure good reception. A display would be helpful as on the FR6989 shown below with an IR LED. The initial Energia transmission sketch to test the concept is located here: https://github.com/fmilburn3/Infrared/blob/master/IR_sendByte.ino. The sketch was developed in Energia V17 using a MSP430G2553 LaunchPad and a 940 nm infrared LED. It loops from 0 to 255 and sends a single byte with the count via infrared to the receiver when a button is pushed. The packets for sending bytes do not follow an existing protocol. It is specific to this application and developed with the goal of getting a byte transmitted at least every 100 ms. The receiver will be a custom MSP430G2553 board powered by a coin cell with a TSOP38238 IR receiver. There will LEDs on the PCB and it will also have the capability to drive LEDs off board. The preliminary receiver code was written in C using CCS and direct register access: https://github.com/fmilburn3/Infrared/blob/master/IR_Receiver/main.c . The framework for the code is based on a post by RobG here on 43oh. The receiver takes transmissions from the Energia sketch linked above and outputs the current byte on eight LEDs in binary form. When the last byte is received it clears the LEDs and outputs the number of bytes received in error out of the expected 255. This allows analysis of reception at different distances and conditions. Shown below is the preliminary testing setup. In the foreground is the G2553 receiver with a TSOP38238 and output LEDs on a breadboard. Middle ground is a G2553 with the infrared LED sending bytes. Background is output from the receiver being monitored on an oscilloscope. The output of the TSOP38238 is quite clean and no errors were seen with the transmitter and receiver this close together. Transmission is at approximately 1000 bytes per minute or 16+ bytes/sec which is within the desired range. I subsequently modified the test setup to run off batteries so I could do some preliminary distance testing. With clear line of sight reception I saw no errors up to 5 meters with one transmission LED aimed directly at the receiver. Errors crept in after that, especially if the transmission is off to one side, not pointed directly at the receiver, or at a greater distance. Near term activities: increase the number of transmission LEDs evaluate the impact of off-center transmission further test in an environment that doesn't have reflective surfaces add WS2812 driver capability and investigating the impact of TSOP38238 interrupts on the WS2812 driver evaluate 2032 battery life further
  18. Is msp430fr5994 launchpad supported by any realese of energia ? I searched in boards section and couldn't find. Is there any patches to make it work ? Or it's not supported ?
  19. 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.
  20. Hello guys i have a project at my school were i need to make an energy metter with a msp430f5529 and a hardware part i did all the code myself and the hardware part (current metters,voltage divider etc), (i know is rudimental and ineffective) , the code and the montage works well and does everything i need it to do.Now my professor asked me to save "energie1" and "energie2" so when my microcontroler runs out of battery this 2 variables are saved , i read a lot of threds but i can't figure it out.Here is the code if it helps ( i can provide you with hardware montage if needed). #include <Wire.h> #include "LiquidCrystal_I2C.h" byte address = 0x27; // LCD I2C address int columns = 20; // number of columns on LCD int rows = 2; // number of rows on LCD LiquidCrystal_I2C lcd(address, columns, rows); long previousMillis = 0; long previousMillis1 = 0; int timp; int sensorPin = 23; int sensorValue = 0; float volt; byte newChar1[] = { B11111, B10001, B10001, B10001, B10001, B10001, B10001, B11111 }; byte newChar2[] = { B00000, B00000, B11100, B11100, B11100, B11100, B00000, B00000 }; byte newChar3[] = { B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111 }; int sensorPin1 = 24; int sensorValue1 = 0; float amp1; int sensorPin2 = 25; int sensorValue2 = 0; float amp2; float putere1; float total_putere1; float energie1; float media_puteri1; float putere2; float total_putere2; float energie2; float media_puteri2; long interval = 1000; long interval1=270; const int buttonPin = PUSH2; int buttonPushCounter = 0; int buttonState = 0; int lastButtonState = 0; void setup() { lcd.init(); pinMode(buttonPin, INPUT_PULLUP); lcd.createChar(0, newChar1); lcd.createChar(1, newChar2); lcd.createChar(2, newChar3); } void loop() { buttonState = digitalRead(buttonPin); sensorValue = analogRead(sensorPin); sensorValue1 = analogRead(sensorPin1); sensorValue2 = analogRead(sensorPin2); unsigned long currentMillis = millis(); unsigned long currentMillis1 = millis(); timp=currentMillis/1000; if(currentMillis - previousMillis > interval) { previousMillis = currentMillis; volt=sensorValue; volt=(volt*3.3)/4096; volt=volt*8.51; amp1=sensorValue1; amp1=(amp1*3.3)/4096; if(amp1<0.5) amp1=0; amp1=amp1/0.5; amp2=sensorValue2; amp2=(amp2*3.3)/4096; amp2=amp2/0.05; if(amp2<1.25) amp2=0; putere1=volt*amp1; putere2=volt*amp2; total_putere1=putere1+total_putere1; total_putere2=putere2+total_putere2;} if (buttonState == LOW) { lcd.backlight(); } else lcd.noBacklight(); if(currentMillis1 - previousMillis1 > interval1) { previousMillis1 = currentMillis1; if(buttonPushCounter==1){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Battery Voltage"); lcd.setCursor(0,1); lcd.print(volt); lcd.print(" V");} if(buttonPushCounter==2){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Solar Current"); lcd.setCursor(0,1); lcd.print(amp1); lcd.print(" A");} if(buttonPushCounter==3){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Pump Current"); lcd.setCursor(0,1); lcd.print(amp2); lcd.print(" A");} if(buttonPushCounter==4){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Solar Energy"); lcd.setCursor(0,1); lcd.print(energie1); lcd.print(" Wh");} if(buttonPushCounter==5){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Pump Energy"); lcd.setCursor(0,1); lcd.print(energie2); lcd.print(" Wh");} if(buttonPushCounter==6){ lcd.clear(); if(volt>12.6){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("100"); lcd.print("%");} if(volt<12.45 && volt>12.21){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(0); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("80"); lcd.print("%");} if(volt<12.20 && volt>11.91){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(0); lcd.write(0); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("60"); lcd.print("%");} if(volt<11.90 && volt>11.60){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(2); lcd.write(0); lcd.write(0); lcd.write(0); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("40"); lcd.print("%");} if(volt<11.59){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(0); lcd.write(0); lcd.write(0); lcd.write(0); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("20"); lcd.print("%");}} if(buttonPushCounter>6) buttonPushCounter=1;} if (buttonState != lastButtonState) { if (buttonState == HIGH) { buttonPushCounter++;}} lastButtonState = buttonState; media_puteri1=total_putere1/timp; energie1=media_puteri1*timp/3600; media_puteri2=total_putere2/timp; energie2=media_puteri2*timp/3600; }
  21. Dear Developers, I want to send data from MSP430F5529 to my Arduino Nano through UART connection. But somehow it is not working filne. I have used voltage devider circuit to convert Arduino's 5V to MSP's 3.3V. Connection Arduino's RX -> MSP's TX Arduino's TX -> MSP's RX Ground of Both -> ground of voltage devicer. Code of Arduino : const int chipSelect = 10; String inByte = " "; void setup() { // initialize both serial ports: Serial.begin(9600); } void loop() { if(Serial.available()) { char b = Serial.read(); Serial.println(b); } delay(50); } Code of MSP430F5529 void setup() { Serial.begin(9600); } void loop() { Serial.write("Hii"); delay(50); } Please Help me. Thank you.
  22. Hi! I would like to interface a combined GPS + GSM module to an MSP-EXP430FR5969 using Energia. The aim is at the press of a button/signal, an SMS is sent with the GPS lat/long coordinates at the time of the press. I am planning to use this module (https://tronixlabs.com.au/arduino/shields/3g-shield/adafruit-fona-3g-cellular-breakout-900-and-2100-mhz-for-optus-vodafone-australia/) to connect it all up. I've seen a lot of Arduino examples on this (e.g. using tinyGPS and softwareSerial) but I'm not sure if this same code will work on the MSP430. Will it? How can I go about changing the Arduino set up/pin definitions so that it'll work on the MSP430 using Energia? Thanks in advance
  23. Dear Engineers, Please help me send data to Arduino from my MSP430F5529 using SPI interface. I want to use SPI iterface because in future I want to use the modified code for Attiny13A instead of the Arduino Leonardo. Details are given below. Thank you for your support. Information to Provide When Asking for Help: Model of LaunchPad used and revision number : MSP430F5529 Launchpad Rev 1.6 & Arduino Leonardo Model of the MCU used : MSP430F5529 & ATMEGA32U4~AU at 15Mhz Name and version of the IDE used : Energia 1.6.10E18 & Ardduino IDE 1.8.2 OS the IDE is running on : Linux Mint 18 Whenever possible, minimal code to replicate the issue : Required from good developer
  24. 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
  25. 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.