Jump to content

Fmilburn

Members
  • Content Count

    618
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by Fmilburn

  1. Fmilburn

    [SOLVED] Is this code blocking suspend()/lpm4?

    @@p2baron My skills in C++ are limited but here are some things to try. Below are your ISRs... void newmail() { wakeup(); awake = true; newMail = true; } void mailgone() { wakeup(); awake = true; newMail = false; } In general it is best to minimize code in an ISR. In any event, wakeup should cause suspend to return control to the next executable line after suspend. In your case, this is the top of loop(). So if would appear the variables in the ISR, awake and newMail, do not have their contents updated. So move those two out of the ISR and after suspend (or at least in front of wakeup). This is what wakeup (located in Energia.h) looks like. extern volatile boolean stay_asleep; #define wakeup() { stay_asleep = false; } As soon as wakeup is called in your ISR, then the while condition in suspend is made false (since stay_asleep is now false) and it exits. So if you are still having the problem after trying the change above, then put a print statement right after suspend. If it prints something immediately after calling suspend then perhaps the ISR is being called, stay_asleep is made false, and it just isn't staying in LPM4.
  2. Fmilburn

    [SOLVED] Is this code blocking suspend()/lpm4?

    Thanks spirilis! I learned something. So p2baron can try putting analogReference(DEFAULT) at the end of getVCC(). Pretty sure wakeup is needed but you could try taking it out . I don't understand the external interrupt that you are using so no idea how it works...
  3. Fmilburn

    [SOLVED] Is this code blocking suspend()/lpm4?

    I recommend trying abecedarian's suggestion and adding the debugger to your bag of tricks. As stated above, you can also try CCS Cloud which I find a bit easier to use and convenient (but you can't look at registers). After looking at your code again, it seems that if everything else is behaving then it should be looping. And if it is looping then it should be calling suspend(). The code for suspend() is located in wiring.c and here it is.... void suspend(void) { // Stop WDT for now WDTCTL = WDTPW | WDTHOLD; sleeping = true; stay_asleep = true; while (stay_asleep) { /* Halt all clocks; millis and micros will quit advancing, only * a user ISR may wake it up using wakeup(). */ __bis_status_register(LPM4_bits+GIE); } sleeping = false; // Re-activate WDT in SMCLK Interval mode enableWatchDogIntervalMode(); } It seems to me that one reason you might not be seeing it stay in LPM4 is that the interrupt is occurring and wakeup() is being called immediately after it calls __bis_status_register(LPM4_bits+GIE) in the suspend() function. Can you test for this? How is the interrupt reset?
  4. Fmilburn

    [SOLVED] Is this code blocking suspend()/lpm4?

    Hi @@p2baron, I'm glad you found the article helpful. I looked at your code quickly and while I didn't see the problem, I have two questions: Does everything in the code work as you expect other than it doesn't go into LPM4 when you call suspend()? Have you tried using debug mode in CCS to step through and see what is happening - e.g. suspend() is called and the variables awake, newMail, etc. are what you expect? Lately I have been using CCS Cloud with Energia when I need debug and find it more convenient than using CCS on the desktop if I don't need to view memory or registers.
  5. Fmilburn

    msp430fr5969 pins

    Hi @@Marc, I don't see the problem.... Here is the LaunchPad schematic from the User's Guide: Can you point out the issue on it?
  6. Hi @@theja2289 That would be nice wouldn't it? I'm not the most qualified to answer, but here goes anyway. The short answer is that it isn't practical for a number of reasons but ultimately because the underlying hardware is different and Energia / Arduino / Wiring have diverged somewhat over time. When the authors of code and libraries stick to the common "language" and libraries then things pretty much work. But, there are a number of reasons they might not, and plenty of deviations. For example: The pin functions vary The software may access hardware features present in one microcontroller but not another The software may directly accesses hardware, say to speed things up or reduce memory requirements (maybe even through assembly language) The C++ compiler upon which Energia/Arduino are based differ somewhat There are core features/libraries added to Arduino but not Energia (and vice versa). This even holds for different boards within Energia / Arduino. The language evolves with time Etc. It is possible to write libraries and sketches that work with different underlying architecture but it requires more effort - basically the author needs to be familiar with and deal with the issues listed above. This isn't always possible. Anyway, the further things get from the high level abstractions in Energia / Arduino, the harder it gets to directly port (and the harder it would be to write a universal translator). Sometimes it is easier just to start from scratch and write new code - hard to expect a compiler translator to do that EDIT: This link has useful information also.
  7. Fmilburn

    Oct 2015 - 43oh Halloween Contest

    I agree with you @@Fred - I would like to see more of what others are doing and winning a prize is icing on the cake.
  8. Fmilburn

    Multimedia Center

    Really nice build, especially for a prototype...
  9. Fmilburn

    Oct 2015 - 43oh Halloween Contest

    Thanks @@bluehash. I will send you a personal message.
  10. Fmilburn

    Hi

    Welcome! That sounds like a EdX course I took. If so, it was more hardware oriented than software but I found it useful (pretty simple from a mechanical viewpoint and no battlebot weaponry as I remember though). You will find a lot of knowledgable and helpful people at 43oh...
  11. Fmilburn

    Contents of the MSP-EXP430G2 development toolkit

    @@excalibur2811 Hi John, and welcome. The hardware is different from Arduino. One of the features is that you can use a LaunchPad G2 to develop any of the MSP430G2x microcontrollers. A bonus is that you get two of them with the kit. They don't burn out easily (but don't apply 5V to them like you would an Arduino - they are 3.3 V devices). You could use the second one in another project - they can even be used easily on a breadboard. The crystal is optional. See this link for more information: http://www.ti.com/tool/msp-exp430g2?keyMatch=launchpad%20g2&tisearch=Search-EN-Everything
  12. Fmilburn

    getting the hibernate library to play nice

    @@phaseform I have used it successfully on MSP430 microcontrollers as documented in the blog post linked above. I am not as familiar with the other TI microcontrollers and after looking back I am not sure how the functions are implemented in Energia on the EK-TM4C123GXL. If you want full control of power modes it is better to use the libraries that TI provides and CCS as L.R.A suggests.
  13. Fmilburn

    [POTM] Blue Angels F-18 Costume

    Completed project at the local fall festival parade for children... EDIT: People loved the rotating / blinking / changing lights in the exhaust as well as the fact that it was hand made. If I do something like this again I will probably make the front light flash and add better sound. Strangers were taking pictures of him and asking how it was made.
  14. Fmilburn

    [POTM] Blue Angels F-18 Costume

    This project is a submission for the 2015 Project of the Month Halloween contest. It came about as a request from my four year old grandson after he had seen the Blue Angels fly over during Seafair in Seattle. The basic air frame was constructed from two cardboard boxes as shown in the photograph below. . The boxes are attached to each other with brads and hot glue. Edges are reinforced where I felt necessary by folding extra cardboard over or gluing in reinforcement cardboard. Also shown in the photograph above are the following: wings, tail, and fins constructed from a corrugated plastic storage box and hot glued in place reflector on the nose constructed from a coffee can bottom which will eventually become the "search light". There is a similar reflector on the tail which will become the jet exhaust. control panel with various switches and a potentiometer I had in my junk box installed on a wooden paint stirring stick The visible surfaces were then covered with wrapping paper using Outdoor Mod Podge - a waterbased sealer, glue and finish available in craft stores in the United States. A second coat was then put on to make it a bit more waterproof. This is the schematic for the avionics. A little custom MSP430G2553 board with two AA batteries beside it in the tail controls an Adafruit neopixel ring "jet exhaust" with a toggle switch on the panel to turn it on and off. Everything else runs off of three AA batteries with the wiring in the front of the aircraft between a cardboard firewall and the nose. Two latching buttons turn colored LEDs on the panel on and off while a third turns a 3W LED (searchlight) on and off. There is a potentiometer to control the brightness of the searchlight. Finally I repurposed the sound board and speaker from an old greeting card that was originally powered by a coin cell. The WS2812 Adafruit Neopixel ring is controlled by the MSP430G2553. I used the library posted by ILAMtitan at 43oh - so full credit to those who had a hand in developing it. The library example worked well as is for my purposes and about the only thing I changed was the output pin and the number of pixels being controlled in the code. Here is a picture of my grandson trying it out. We glued plastic cups over the headlight and jet exhaust and stuck Energia stickers on it. I may touch it up a bit more if I have time and post a final picture. Improvement Ideas: I also made a "candy counter" out of an old scale for his entertainment (and mine). His immediate reaction was that we should somehow attach the candy counter to the airplane. Clever, but not practical due to the need for the scale to be level and not banged around by a four year old. Using a counter where candy is funneled past a beam, like Chicken did with his counter might work though. My idea is that we add GPS along with thumbs up/down buttons. Then he could rate offerings and either store the data as a reminder for next year or send it out over the IOT with location so that his buddies know where the good candy is.
  15. Fmilburn

    getting the hibernate library to play nice

    What @L.R.A said, and to elaborate further... There are several places where sleep(), sleepSeconds(), suspend(), and wakeup() are discussed in 43oh forums. Energia on the TI microcontrollers actually has fairly sophisticated energy management features. For example, see this recent post on the 43oh blog and this simple example. I tried the example just now on the EK-TM4C123GXL with Energia 16 on my Windows 10 machine and it works fine.
  16. Fmilburn

    [POTM] dAISy - A Simple AIS Receiver

    It looks like modern art. I think you should call it the dAISy Navy.
  17. @@tobydjones I used it successfully on the following LaunchPads with Energia 16 and Windows 8.1: MSP-EXP430G2 LaunchPad MSP-EXP430G2553 LaunchPad MSP-EXP430F5529 LaunchPad MSP-EXP430FR5969 LaunchPad The version I used is here: https://github.com/fmilburn3/CardReader_RFID_RC522
  18. Some time back I ordered an INA125P Instrumentation Amplifier in order to fool around with a cheap, broken "postal" scale that I had. It arrived and I promptly put it away and forgot it about it. So the other day I was digging through my junk box, saw the scale, and decided to tear it apart. Since it is getting near Halloween, and I knew my grandchildren would be interested, I wrote a little sketch in Energia to estimate the amount of candy in a bowl. Here is a schematic of the circuit. It "works" but given my skills it may not be best. This being a MSP430 project I hooked up the sleep pin on the INA125P. I also made it where I could change out Rg, the gain controlling resistor, easily. Once I had it working I made up a little BoosterPack that goes on the bottom of the LaunchPad. The INA125P sits between the daughter board and the MSP430F5529 LaunchPad - you are looking down on the male pins in the photo above. I hot glued a piece of cardboard on the bottom so as to reduce the chance of shorts and provide a reminder on how to connect it. Below is a view from the bottom with it connected up to the LaunchPad and the scale. The sketch is here on github. There is a little calibration routine it goes through when started up where it asks for the empty bowl and then a known quantity of candy to be placed into it. After that, it displays on a SHARP96 BoosterPack. I thought about connecting it up to the IOT, but after due consideration decided I didn't want the neighborhood kids knowing how much candy I have left.
  19. Fmilburn

    Oct 2015 - 43oh Halloween Contest

    My submission is a Blue Angels F-18 costume for a four year old with the main visual effect coming from a custom MSP430G2553 driving an Adafruit WS2812 "neopixel" ring. More documentation here.
  20. Fmilburn

    Brand new from Oklahoma!

    Welcome! I have a couple of suggestions (I haven't been doing this too long myself).... Get familiar with the pin map for your LaunchPad The Energia tutorials on YouTube Of course the examples in the Energia IDE are good also. The tutorials associated with the Sparkfun Inventor's Kit are pretty good for getting started. Lots of Arduino stuff is easy to port (remember to look at that pin map!). Don't hesitate to ask for help if you get stuck but if you do following these guidelines helps a lot.
  21. Fmilburn

    ws281x driver using DMA SPI for msp430f5529

    Nice... I am going to spend some time with it and see if I can figure it out.
  22. Fmilburn

    Halloween projects, anyone?

    Oooh, moving houses. Now that is a scary thought. ;-) Hope it is going well.
  23. Fmilburn

    MCP3008 ADC Library

    The MCP3008 is an easily used 10bit, 8 channel, Serial Peripheral Interface (SPI) Analog to Digital Converter. I created an Energia library that can be found here and used to read any of the eight pins with a single call. Conversion is done for voltages between 0 and 3.3 V, including on the CC3200, and results in a integer reading between 0 and 1023. This library is for single ended operation only and uses hardware SPI. An example is included that demonstrates reading from all 8 channels. Tested with Energia 0101E0016 on the following LaunchPads * CC3200-LAUNCHXL Rev 4.1 (80 MHz) EMT * CC3200-LAUNCHXL Rev 4.1 (80 MHz) * MSP-EXP432P401R (48 MHz) EMT * MSP430F5529 Rev 1.5 (25 MHz) * MSP-EXP430FR5969 Rev 2.0 (16 MHz) * MSP-EXP430G2553 Rev 1.5 (16 MHz)
  24. Fmilburn

    MSP432 Latching relay trouble

    @@Tkelly278 Please be careful with that level voltage and currents if you are not sure of your abilities. A safe and easy to use, although somewhat expensive solution, would be something like this.
  25. @@CodeComposer This is a shot in the dark, but do you have the Grove BoosterPack on while you are doing this? If so, you might try removing it to see if that makes a difference. You may be already aware, but be careful with analog input on the CC3200. It is OK at 3.3V for digital, but analog is only good for 1.5V.
×