Jump to content


  • Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    manhdan reacted to Fmilburn in Resetting a MSP430 from within Energia   
    I have an Energia project that seems to go astray under rare and seemingly random circumstances - it can occur anywhere from hours to months apart and I haven't been able to pin the cause down.  It starts right up again after a reset.  It isn't critical if it is down for a minute or so but I am usually not around to reset it manually.  However, I can monitor things in the firmware and tell when things are not working correctly.
    In this situation it is easy enough to force a reset from Energia by writing to the watchdog timer and control register with an improper password.  For example, in the following sketch the green LED will not turn on and the red LED will start flashing again after the reset.
    void setup() { pinMode(RED_LED, OUTPUT); pinMode(GREEN_LED, OUTPUT); digitalWrite(RED_LED, LOW); digitalWrite(GREEN_LED, LOW); } void loop() { unsigned int i; for (i = 1; i < 5; i++) { digitalWrite(RED_LED, HIGH); delay(500); digitalWrite(RED_LED, LOW); delay(500); } WDTCTL = 0x00; // causes a reset for(; { digitalWrite(GREEN_LED, HIGH); // this line is never reached } } Note:  This is not using the watchdog timer in the normal fashion as Energia uses it for other timing functions.  It is just a easy way to force a reset if needed.
  2. Like
    manhdan reacted to Fmilburn in MSP430G2452 and Energia   
    Hi @@pyrosmog, and welcome to 43oh...
    If it is the latest version 1.6.10E18 then it does not have the G2452 in the Tools->Board pulldown menu.
    The latest version is based on the new Arduino IDE and for some reason the G2452 isn't included. I don't know if it will be officially added in future. There are a number of threads here in 43oh on adding a new MSP430 if you want to try it yourself.
    The easiest thing for now may be to use an earlier version of Energia that has the G2452 such as Energia v17.
    Of course there could be other problems, e.g. putting the chip in upside down or not getting it seated properly.
  3. Like
    manhdan reacted to Rei Vilo in Can't find G2231 in latest energia   
    The G2231 is no longer supported on Energia 18. Please consider Energia 17 instead.
  4. Like
    manhdan got a reaction from bluehash in Can MSP430 do this?   
    I'm very interested in this Dancing traffic light, can msp430 do this?
  5. Like
    manhdan reacted to bobnova in Can MSP430 do this?   
    That is absolutely glorious.
    You could do a finite number of frames with an MSP430 of some sort. If you want to do the motion capture style like in that video you'll need to aim a lot higher in processing power I think.
  6. Like
    manhdan reacted to L.R.A in Can MSP430 do this?   
    yea, motion capture you are going to need sometigh like a Raspberry Pi wich is a processor of 700Mhz
    for simply making that LED matrix to do cool paterns and drawings you can use a MSP 
  7. Like
    manhdan reacted to roadrunner84 in Can MSP430 do this?   
    Let's assume we use regular passive matrix scanning: you "update" one row at a time but in very fast succession.
    You'll need as many pins as the sum of the rows and the columns. I estimate this dancing light to be 32 by 32 pixels, so you'll need 64 I/O pins. You could even get away with no extra pins to use both the green and the red light (not at once), just have the red LEDs in forward from one pin to another and the corresponding green LEDs the other way around in parallel to that.
    Your scanning speed need to be high enough to look like it's continuous, let's assume you'll need about 50Hz to make it look clean.
    This means you'll need to update all 64 output pins 50 * 32 times per second, or 1600 Hz.
    This seems perfectly reasonable for an MSP430, except for the pin count (for value line devices that is), so you'll either need to use shift registers or multiple MSP430s to allow for this much I/O pins.
    Another issue is the current draw, the row selection lines will need to supply enough current to power 32 LEDs at once. You will need to use driver ICs or transistors to allow for such a current (say 32 * 20mA = 640mA)
  8. Like
    manhdan reacted to maelli01 in Tiny low power LED clock   

    Oh no, not another clock...

    My first standalone MSP430 project and also my first project to
    be programmed "in circuit", and a soldering exercise for the TSSOP housing

    A tiny LED clock. It is minimalistic by all means:
    -a TSSOP G2452, no other IC
    -only one button to set the time
    -a dumb 4 digit white LED 7 segment display, https://www.sparkfun.com/products/11409
    -a PCB size of 25mm x 25mm
    -extremely low power

    Wanted to find out whether I can use the TSSOP with my usual home made setup,
    that is Eagle, Deskjet printer, photosensitive base material, UV-lamp, develop,
    the ugly FeCl3 etching, and then hand-solder.
    The PCB is single sided of course.

    I use the lauchpad for programming.

    The white LEDs of the display are pretty bright at their nominal current.
    I wanted something low power and just enough brightness to see the time in the
    middle of the night with darkness-adapted eyes.
    So at 4:30 in the morning, the display is much more useful than an LCD.

    The whole thing draws around 0.3- 0.5mA, LEDs included.
    CPU runs at 1Mhz, but is in LPM3 most of the time, even though the poor thing has
    a restless sleep: it has to wake up 512 times a second, to do the multiplexing.

    At this low current there are quite a few options for a power supply, I considered

    - 2 AA cells; would run around half a year
    - something solar, with supercap
    - I ended up with direct AC supply via a capacitive dropper, 4700pF mains rated film
    cap. Where I live, plugs are polarized, so I know which one if life and which one
    is neutral. Still I think that this would not be street-legal without double insulation

    Overall I calculated 2milliwatt total power consumption, probably the lowest of
    any mains powered clock.

    If anybody is interested, I might bring schematic and software into
    human-readable form.

  9. Like
    manhdan reacted to maelli01 in PWM glitches, Analog Write   
    now I can do fun things with PWM
    feed a 1kHz sine wave into Pin2, go through this shortish sketch:
    void setup() {analogFrequency(20000);} void loop()  {analogWrite(9,analogRead(2)/4);} look at the signal on pin 9, blue trace, low pass filtered yellow trace.
    With the new library: nice 1kHz PWMded sinewave on a 20Khz carrier!
    With the old library: garbage.
    the loop() runs with 6.8kHz, should be fast enough for very low quality audio

  10. Like
    manhdan reacted to spirilis in What is new in the new value line?   
    Value Line is a specific lineup of chips.  Most of the Value Line chips come in different packages; DIP being the popular one that works with MSP430G2 LaunchPad.  All those same chips available in DIP are available in a TSSOP (surface mount 0.65mm pin pitch) and QFN variations.
    My understanding is of course the Value Line isn't just for hobbyists, it's meant to be an affordable option for TI's professional customers too, and many probably do use them in small gadgets & toys and such.  Last year TI released an expansion of the Value Line, but only offers the chips in surface mount (TSSOP, QFN) variations of the package, no DIP so they won't work with the MSP430G2 LaunchPad without installing the chip on a separate carrier board.  These chips have notably expanded memory (flash & SRAM) and are much more comfortable to code for since you're far less constrained--the chips' resources are closer to what Arduino has been using for years (and exceeds it, in the case of the MSP430G2955).  But TI doesn't have any easy LaunchPad-style boards for them, so a couple of us have built our own.  That said, it all became a somewhat moot point when TI released the MSP430F5529 LaunchPad, whose resources far exceed even the highest of the new Value Line chips.  So enthusiasm for the higher-end Value Line chips (e.g. MSP430G2955) has waned a bit.  I personally feel there's a place for them in my projects though.
  11. Like
    manhdan reacted to energia in Serial Monitor/Serial.print() issue   
    If you have not already done so then you will have to adjust the jumpers on J3. Depending on which version you will have to cross connect RX/TX (v1.4) or place them horizontal (v1.5). For v1.5 the PCB has instructions for how to place the jumpers for hardware vs software UART.
    See detailed pictures on the following page: http://energia.nu/Guide_MSP430LaunchPad.html
    Make sure that you are referencing the pictures for v1.4 or v1.5 with MSP430G2553.
  12. Like
    manhdan reacted to Rei Vilo in [Energia Library] DHT22 Temp & RH% One-Wire Sensor   
    With the right links:
    I bought from Adafruit a DHT22 sensor that provides temperature and relative humidity. It uses a one-wire connection.
    Product: http://www.adafruit.com/products/385[/url] Datasheet: http://www.adafruit.com/datasheets/DHT22.pdf Tutorial: http://www.ladyada.net/learn/sensors/dht.html Library for Energia: DHT22_430_main.zip
      The sensor works fine when powered at 5v or 3.3v.

  13. Like
    manhdan reacted to grahamf72 in [Energia Library] MSP430 Real Time Clock   
    Updated version of the library attached. Main changes are:
    Configuration option allows the Watch-Dog Timer to be used for the RTC instead of TimerA. This also requires replacements for the functions in wiring.c. A side effect caused by limitations of the 430 hardware is that delay, millis and micros only have a resolution of 1.9mS. Added helper functions to convert the hmsDMY time into UnixTime format, return day-of-week, etc. Added an alarm class. Improved documentation. RTCplus.zip
  14. Like
    manhdan reacted to grahamf72 in [Energia Library] MSP430 Real Time Clock   
    Attached is my latest version of the Real Time Clock library, adapted from xv4y's original library.  Some significant changes in this version are:
    Now works with both the MSP430G2553 and the MSP430G2452 processors (with some limitations on the 2452). The library may work on other processors, but I don't have any to test with. Rewrite of the logic used to detect the number of days in a month and leap year detection so that it uses considerably less RAM. Option to use the built-in VLO clock. The VLO is much less accurate than the crystal - about the best that can be achieved is accuracy to within a few minutes per day. The advantage of the VLO is that it frees up 2 IO pins, and can be used if you can't solder the tiny crystal to the launchpad. If you don't need a very accurate clock, or have a means of external synchronisation, the VLO may be sufficient for your needs. The #define's that configure the settings of the timer have been moved to a separate RTCconfig.h file, so they are easier to edit without having to edit the main header file. Documentation has been moved from the header file into a separate .txt file. Some example files have been included in the library. Known Limitations:
    Because the MSP430G2452 only has one timer, the RTC library cannot be used in conjunction with other functions that also require the timer. This includes Serial, AnalogWrite, Tone, and possibly some others. Because the MSP430G2452 doesn't have hardware serial, this means that the RTC library and Serial are completely incompatible.
  15. Like
    manhdan reacted to clay_shooter in Porting MSTimer2   
    I've ported a version of MsTimer2 to the Energia / MSP430 environment. Its called TwoMsTimer and it provides a way to get a method called on regular intervals, as fast as once very two msec. You just create a TwoMsTimer object passing in the (void) method that you want called and TwoMsTimer will take care of the rest. The timer relies on Timer 1 in a way that is compatible with PWM letting you use the Timer 1 PWM pins and get timed function invocation. It is named TwoMsTimer because the PWM CCR0 interrupt rate is about 500Hz giving us 2 msec resolution.
    You can find the sample code and a demo showing how it works on http://joe.blog.freemansoft.com/2012/09/msp430-fading-and-other-long-running.html
    The code is really simple with no "if define" behavior for different processors. I've only tested it on the Launchpad with the 2553 processor.
  16. Like
    manhdan reacted to bluehash in [Energia Library] MSTimer2   
    From: Porting MSTimer2
  17. Like
    manhdan reacted to Rei Vilo in [Energia Library] Nokia 5110 LCD BoosterPack/Breakout PCB   
    Library link: Energia library for Nokia 5110 LCD
    Store link : Nokia 5110 LCD BoosterPack/Breakout PCB
    The Nokia 5110 LCD is on the right:

  18. Like
    manhdan reacted to OzGrant in [Energia Library] OneWire DS18B20 (430 & Stellaris)   
    Tks Pivden,
    Yes your correct, no idea how the microsec's snuck through, they seem to do that at 2AM.
    Have updated the zip file.
    Tks again
  19. Like
    manhdan reacted to energia in Building low power into Energia   
    I just finished the first version of low power implementation. 2 new functions were introduced: sleep(uint32_t milliseconds) and sleepSeconds(uint32_t seconds).
    sleep() has a resolution of 2 ms while sleepSeconds() has a resolution of 250ms. So calling sleep(1) will actually get you 2 ms. calling sleepSeconds(1) will get you 1.25 seconds. sleep() will go to LPM3 2ms at the time while sleepSeconds() will go to LPM3 250ms at the time. For this reason sleepSeconds() is a lot more efficient. sleep() depending on the MSP430 will get you between 15uA for the FR5969 and 25uA for the G/F5-Series. sleepSecond on the other hand will get you between 700nA for the FR5969 and 2uA for the G/F5-Series. If you would like to give this a try then replace the flowing files in your Energia installation. Make sure that you create a backup of your original files first.
    Replace: hardware/msp430/cores/msp430/Energia.h with https://raw.githubusercontent.com/energia/Energia/master/hardware/msp430/cores/msp430/Energia.h
    Replace: hardware/msp430/cores/msp430/wiring.c with https://raw.githubusercontent.com/energia/Energia/master/hardware/msp430/cores/msp430/wiring.c   Below is an example Sketch for the G-Series that spends most of it's time in LPM3 and briefly flashes the green LED every x seconds/milliseconds. /* * To reduce power consumption all unused pins should be set as output low. * Setting pins as output can potentiall cause conflicsts. * Therefor this below functions set all pins to input pulldown as a good alternative. */ void setInputLow(uint8_t port, uint8_t pins) { volatile uint8_t *out; volatile uint8_t *ren; /* Get the output register */ out = portOutputRegister(port); /* Get the internal resistor pull up/down register */ ren = portRenRegister(port); /* If the port is not a port then return */ if(out == NOT_A_PORT || ren == NOT_A_PORT) return; /* Enable the internal pull up/down resistors */ *ren |= pins; /* Clear output register bits to select pull down */ *out &= ~pins; } void setup() { /* IMPORTANT: Set all unused pins to input low to reduce power consumption. * The XTAL bits, P2.6/7 on the G-series and P5.4/5 on the F5529 and PJ4/5 on the FR5969 * should NOT be set as input low since this significantly increases current draw and * the crystal will fail to start. * The example below shows the pin settings for the G2553. * P1.6 is the Green LED and P2.6/7 are the the Crystal pins. */ setInputLow(1, BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT7); setInputLow(2, BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5); // setInputLow(3, BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7); // setInputLow(4, BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7); // setInputLow(5, BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7); // setInputLow(6, BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7); // setInputLow(7, BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7); // setInputLow(8, BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6 + BIT7); /* Set the GREEN_LED as OUTPUT */ pinMode(GREEN_LED, OUTPUT); } void loop() { /* Briefly flash the RED LED every x seconds */ digitalWrite(GREEN_LED, HIGH); // turn the LED on (HIGH is the voltage level) delay(10); digitalWrite(GREEN_LED, LOW); // turn the LED off by making the voltage LOW delay(10); /* Sleep for 2 seconds. Around 1.5 uA of current */ sleepSeconds(2); /* Sleep for 500 ms. Around 25 uA current */ // sleep(500); }
  • Create New...