Jump to content
43oh

dubnet

Members
  • Content Count

    566
  • Joined

  • Last visited

  • Days Won

    30

Reputation Activity

  1. Like
    dubnet got a reaction from tripwire in Analog Devices RF Detector Kit offer for $5   
    I did order two, hesitated at the unknown shipping charges but proceeded thinking domestic ground shipping on less than a pound shouldn't be much. Bad assumption. The shipping weight was actually 2 pounds due to the marketing material included (at my expense) in each board's box. Long story short...the $5 boards ended up costing just under $14 each. I won't be using RichardsonRFPD again.
     
    You were wise to abort.
  2. Like
    dubnet got a reaction from gsutton in Analog Devices RF Detector Kit offer for $5   
    I did order two, hesitated at the unknown shipping charges but proceeded thinking domestic ground shipping on less than a pound shouldn't be much. Bad assumption. The shipping weight was actually 2 pounds due to the marketing material included (at my expense) in each board's box. Long story short...the $5 boards ended up costing just under $14 each. I won't be using RichardsonRFPD again.
     
    You were wise to abort.
  3. Like
    dubnet got a reaction from abecedarian in Analog Devices RF Detector Kit offer for $5   
    I did order two, hesitated at the unknown shipping charges but proceeded thinking domestic ground shipping on less than a pound shouldn't be much. Bad assumption. The shipping weight was actually 2 pounds due to the marketing material included (at my expense) in each board's box. Long story short...the $5 boards ended up costing just under $14 each. I won't be using RichardsonRFPD again.
     
    You were wise to abort.
  4. Like
    dubnet got a reaction from spirilis in Analog Devices RF Detector Kit offer for $5   
    I did order two, hesitated at the unknown shipping charges but proceeded thinking domestic ground shipping on less than a pound shouldn't be much. Bad assumption. The shipping weight was actually 2 pounds due to the marketing material included (at my expense) in each board's box. Long story short...the $5 boards ended up costing just under $14 each. I won't be using RichardsonRFPD again.
     
    You were wise to abort.
  5. Like
    dubnet reacted to cubeberg in Trying to alternate blinking of two LEDs   
    My guess would be because you're not setting the initial state - you should set them explicitly instead of assuming state when your code executes.  Try P1OUT = 0x00; when you set P1DIR. or instead of P1OUT ^= 0x01, use P1OUT = 0x01;
  6. Like
    dubnet reacted to cubeberg in Having trouble installing Code Composer.   
    Just "MSP ultra low power MCU" is what you need for the MSP430.  You can leave the rest of the options at their default (the normal debugger option is usually greyed out - you don't need any of the optional debuggers).  
    You don't have to install any of the app center tools - if anything seems interesting you can install - but you can always install those later as well.  
  7. Like
    dubnet reacted to tripwire in MSP430G2553 SPI Slave mode behaviour   
    That bug only happens with UCCKPH=1, which isn't the case in the slave code shown. I suspect the problem might just be a mismatch between the Raspberry Pi's SPI mode and the one selected on the g2553. That can manifest as a one-bit offset in one direction or the other.
     
    You can use ioctl(fd, SPI_IOC_WR_MODE, &mode) to set the mode on the raspi end. Doing that means you can avoid setting UCCKPH=1 on the g2553 and not have to worry about the USCI40 problem. The bad news is that the arduino slave code will need changing to match.
     
    I think that setting SPI_MODE_3 on the raspi will match what you've selected on the g2553, and will let you remove the bit shift workaround.
  8. Like
    dubnet got a reaction from tripwire in msp430g2553 / msp430x2xx pinmux   
    If I read it correctly the table below each flow chart shows the configuration setup bits for those particular pins in the chart. Given this shows each pin is configurable individually it would seem to be the written proof that you would need to support your answer of "yes". Could also point out that this behavior is inferred in Energia as you can assign one pin as analog in, and others as digital I/O.
  9. Like
    dubnet reacted to spirilis in MSP430G2553 SPI Slave mode behaviour   
    You are right, hardly anybody uses USCI Slave mode for SPI or I2C!
     
    Looking at the chip's errata sheet though, check out USCI40:
    http://www.ti.com/lit/er/slaz440g/slaz440g.pdf page 9
     

  10. Like
    dubnet got a reaction from yyrkoon in msp430g2553 / msp430x2xx pinmux   
    If I read it correctly the table below each flow chart shows the configuration setup bits for those particular pins in the chart. Given this shows each pin is configurable individually it would seem to be the written proof that you would need to support your answer of "yes". Could also point out that this behavior is inferred in Energia as you can assign one pin as analog in, and others as digital I/O.
  11. Like
    dubnet reacted to Fmilburn in Have feedback for TI? Please share here.   
    Energia/Arduino has undeniably filled a void and made microcontrollers more accessible, especially to beginners. Further, many of the libraries are quite good, are useable with a very wide range of hardware, and it is possible to get entirely acceptable results quickly. On the other hand some of the stuff out there is junk, repetitive, or just silly. So here are my thoughts on Energia and making it better:
    Put a FAQ section in 43oh or on Energia.nu that might cut down on all those repetitive questions from beginners Document the features that make Energia a better product like sleep, sleepSeconds, .... Make sure the documentation is kept up to date. Add some of the new libraries like counterLib to the library page on Energia.nu and remove the ones that are no longer maintained. Poll users on the features / libraries they would like added and put together a prioritized list. Perhaps offer a bounty like TI hardware to those who develop libraries of an acceptable quality. Offer a prize for users who develop quality libraries for TI chips or open source boosterpacks that TI wants developed. The github site is full of requests / bugs that have been there a very long time. Some bugs with apparently known fixes aren't fixed. This needs better management. It seems like there are too many LaunchPads for the Energia team to manage. Don't add new LaunchPads to Energia if the resources aren't there to maintain it. If only the IDE had decent debug capability (I use CCS sometimes with Energia but with varying success) I am just starting to work my way through CCS and MSPWare / driverlib. Ask me about that next year .
     
    LaunchPads offer superior hardware and are very reasonably priced for hobbyists / makers in my opinion (at least when shipped to a US address). I like the way the extra pins were brought out at the bottom on the MSP432. Please keep the 40 pins for the boosterpacks as close to the standard as possible.
     
    The documentation is extensive and generally good although it has taken me a while to understand how datasheets, family guides, etc. are organized.
     
    TI employee visibility is pretty low on 43oh at times. Thanks to @@energia for all he does. Thanks to @@bluehash also.
     
    I really like the projects that show up on 43oh from time to time and encourage members to post them here. P.S. But not the tutorials on how to turn on a single LED on a breadboard with a phone or read temperature with a DHT22 and an Arduino like show up on hackster please.
     
    EDIT: I would like to see a TI response to these suggestions here on 43oh.
  12. Like
    dubnet got a reaction from agaelema in New launchpad msp-exp430fr5994 with microSD   
    @@agaelema Thanks for doing the second test. Assuming the Launchpad user guide is accurate on the power consumption of the inserted SD card at 100uA, then that would infer that the average current consumption for the demo, without the SD, would be about 200uA. Then at 5uA average current for a periodic data logger perhaps you could get 40 hours (assuming very low leakage for the cap). Haven't done much with supercaps so I will need to take a look at the specs and come up to speed.
     
    Thanks again for taking the time to do another test.
  13. Like
    dubnet got a reaction from tripwire in Have feedback for TI? Please share here.   
    I agree with bluehash in that TI is unusual in its commitment to the enthusiast community. Even though it is a marketing effort at it's heart, it is one that is difficult to directly measure in terms of ROI and therefore reflects a corporate culture truly committed to the effort. I highly value both TI and this forum. As a result TI is my first choice, not only for MCUs, but for other semiconductors as well.
     
    As good as things are I do have some suggestions.  Based on the forum activity it seems that lately a fair number of people are migrating from the Arduino camp to Launchpads using Energia.  I realize Energia has been an effort that has grown organically, probably taking a boat load of man hours to create and maintain. It is a valuable and very useful tool. However, given the number of installation related questions on the forum perhaps an installation wrapper could be developed.  I envision this wrapper installing Energia to a consistent directory path which would eliminate path issues (e,g, spaces, invalid characters, overall path length). Also, the wrapper could install the Launchpad drivers (either all the current models or specific models chosen by the user at installation).  Improving the documentation is another area that would ease the migration of both Arduino users, and new users, into the TI camp.  I understand that these suggestions would take resources to implement, but I feel that the ROI in terms of increased adoption of the TI product could be worth it.
     
    The other area, a minor one, is the TI store.  I fully understand why TI incorporated a shipping charge (and a reasonable one at that) after offering free shipping for so long. In fact, I often wondered how they could sustain free two day Fedex shipping.  However, a significant number of companies offer free shipping above a certain dollar threshold. Perhaps TI could do this as well. An order, somewhat independent of size, has an internal processing cost to the company. A free shipping threshold could encourage orders with a larger dollar value which could benefit both TI and the purchaser.  TI in that the average dollar value per order would increase and the purchaser who would save shipping charges.
     
    @bluehash  Appreciate everything you do. This continues to be a great forum.
  14. Like
    dubnet reacted to tonyp12 in Hard intvec rejumping through Soft intvec for Firmware updates   
    #include "msp430.h" #define UART_RX BIT1 #define UART_TX BIT2 #define UART_PORT(x) (P1 ##x) #define softintvec 0xC0004210 // start of flash + opcode for BR void bootloader_reset(void); void TXdata(char* pnt, int len); void bootloader_USCIAB0TX(void); void bootloader_flasherase(void); __interrupt void bootloaderRX_ISR(void); //-------------------- define structures -------------------- struct jumpstruct { const unsigned long branch[16]; const unsigned int bsl; const unsigned long* vector[16]; }; //-------------------- declare strings ---------------------- #pragma location = "BOOTSTRINGS" const char uartstring1[] = "run main, password anytime erases\r\n"; #pragma location = "BOOTSTRINGS" const char uartstring2[] = "Ready for Firmware\r\n"; //-------------------- reserve a fixed ram location --------- #pragma location = 0x200 __no_init char* passwordpnt; //-------------------- entry on reset ----------------------- #pragma location = "BOOTLOADER" void bootloader_reset(void) { asm(" MOV #SFE(CSTACK), SP"); // set stack pointer WDTCTL = WDTPW+WDTHOLD; if (CALBC1_1MHZ != 0xff){ // erased by mistake? BCSCTL1 = CALBC1_1MHZ; // Set DCO to factory calibrate 1MHz DCOCTL = CALDCO_1MHZ; } UCA0CTL1 = UCSWRST; // Set UCSWRST (hold USCI in Reset state) UCA0CTL1 |= UCSSEL_2; // Use SMCLK UCA0CTL0 = 0; // UART N,8,1 UCA0BR0 = 104; // upper register (9600) UCA0BR1 = 0; // the lower rate register UCA0MCTL = UCBRS1; // don't use modulation as it jitters UART_PORT(SEL) |= UART_TX + UART_RX; UART_PORT(SEL2) |= UART_TX + UART_RX; UCA0CTL1 &= ~UCSWRST; // relase reset, Initialize USCI state machine IE2 |= UCA0RXIE; // enable USCI_A0 RX interrupt if (*(int*)0xC01E != 0xffff){ // is reset vector filled in? TXdata((char*)&uartstring1, sizeof(uartstring1)-1); passwordpnt = (char*) &uartstring1; // use string1 as password __bis_SR_register(GIE); // so our RX_ISR can get data asm (" BR &0xC01E"); // indirect jump } TXdata((char*)&uartstring2, sizeof(uartstring2)-1); BCSCTL3 |= LFXT1S_2; // aclk = vloclk BCSCTL1 |= DIVA_3; // aclk divided by 8 WDTCTL = WDTPW+WDTCNTCL+WDTSSEL; // aclk sourced ~28sec __bis_SR_register(LPM3_bits); // trap it } //-------------------- uart byte tx routine ----------------- #pragma location = "BOOTLOADER" void TXdata(char* pnt, int len) { while(len--){ UCA0TXBUF = *pnt++; while (!(IFG2 & UCA0TXIFG)); } } //-------------------- UartRX sniffer ISR ------------------- #pragma location = "BOOTLOADER" __interrupt void bootloaderRX_ISR(void){ if (IFG2 & UCA0RXIFG){ // our USCI_A0 Recive Interrupt? if (UCA0RXBUF == *passwordpnt){ // a match? if (++passwordpnt == uartstring1+sizeof(uartstring1)-3){ bootloader_flasherase(); WDTCTL = WDTPW+WDTCNTCL+WDTSSEL; // reset the system __bis_SR_register_on_exit(LPM3_bits); } } else passwordpnt = (char*) &uartstring1; // reset it to the start if (*(int*)0xC00E != 0xffff){ // is USCIAB0RX vector filled in? IFG2 |= UCA0RXIFG; // if real routine needs it asm (" BR &0xC00E"); // indirect jump to user isr } } } //-------------------- flash erase blocks ------------------- #pragma location = "BOOTLOADER" void bootloader_flasherase(void){ int* pnt = (int*) 0xC000; // start of flash unsigned int i = 16*2-1; // erase 16K -512B WDTCTL = WDTPW+WDTHOLD; // no WDT __bic_SR_register(GIE); // so no interupt FCTL2 = FWKEY + FSSEL0 + FN1; // MCLK/3 for Flash Timing Generator FCTL3 = FWKEY; // Clear Lock bit while (i--){ FCTL1 = FWKEY + ERASE; // Set Erase bit *pnt = 0; // Dummy write to erase Flash block pnt += 256; // 256 ints up (e.g 512 bytes) } FCTL3 = FWKEY + LOCK; // Set LOCK bit } //-------------------- const rejumping real intvec ---------- #pragma location = "JUMPTABLE" const struct jumpstruct jumptable = { .branch[0] = softintvec + 0 * 0x20000u, .branch[1] = softintvec + 1 * 0x20000u, .branch[2] = softintvec + 2 * 0x20000u, .branch[3] = softintvec + 3 * 0x20000u, .branch[4] = softintvec + 4 * 0x20000u, .branch[5] = softintvec + 5 * 0x20000u, .branch[6] = softintvec + 6 * 0x20000u, .branch[7] = softintvec + 7 * 0x20000u, .branch[8] = softintvec + 8 * 0x20000u, .branch[9] = softintvec + 9 * 0x20000u, .branch[10] = softintvec + 10 * 0x20000u, .branch[11] = softintvec + 10 * 0x20000u, .branch[12] = softintvec + 12 * 0x20000u, .branch[13] = softintvec + 13 * 0x20000u, .branch[14] = softintvec + 14 * 0x20000u, .branch[15] = softintvec + 15 * 0x20000u, .bsl = 0x0000, .vector[0] = &jumptable.branch[0], .vector[1] = &jumptable.branch[1], .vector[2] = &jumptable.branch[2], .vector[3] = &jumptable.branch[3], .vector[4] = &jumptable.branch[4], .vector[5] = &jumptable.branch[5], .vector[6] = &jumptable.branch[6], .vector[7] = (unsigned long*) &bootloaderRX_ISR, .vector[8] = &jumptable.branch[8], .vector[9] = &jumptable.branch[9], .vector[10] = &jumptable.branch[10], .vector[11] = &jumptable.branch[11], .vector[12] = &jumptable.branch[12], .vector[13] = &jumptable.branch[13], .vector[14] = &jumptable.branch[14], .vector[15] = (unsigned long*) &bootloader_reset }; #pragma required=jumptable // tell compiler it's not a dead var Override linker location, copy it and edit the last sections so it looks like thisit moves intvec to just before code so firmware is just now one block including the vectors
    -Z(CONST)DATA16_C,DATA16_ID,TLS16_ID,DIFUNCT,CHECKSUM=C020-FDFF // normally C000-FFDD // ------------------------------------- // Code // -Z(CODE)CSTART,ISR_CODE,CODE_ID=C020-FDFF // normally C000-FFDD -P(CODE)CODE=C020-FDFF // normally C000-FFDD // ------------------------------------- // Signature memory and interrupt vectors // -Z(CONST)SIGNATURE=FFDE-FFDF -Z(CODE)INTVEC=C000-C01F // normally FFE0-FFFF -Z(CODE)RESET=C01E-C01F // normally FFFE-FFFF -Z(CODE)BOOTLOADER=FE00-FF5F // new addition -Z(CONST)BOOTSTRINGS=FF60-FF9D // new addition -Z(CONST)JUMPTABLE=FF9E-FFFF // new addition ?Done with  IAR Workbench for G2553
    The bootloaders Uart RX routine sniffs all incoming data so user can share uart for its intended purpose,
     
    so if you have a Cellular GSM module and you want remote firmware update capability
    ?this may be best near un-brickable way, as soon it detects the password it erase the Flash (except the boot loader block)
    and now it will go in to a waiting sequence for new firmware, It will send a text string ~28second to remind you.
    ?The firmware Flash Loader itself is not done yet, probably need to move up to a 1K size block to fit everything
  15. Like
    dubnet reacted to pine in Salvaging and re-purposing a 5529LP with lost USB hub function to run Forth   
    Since my only 5529LP was confirmed no longer functioning properly and the likely cause is the USB hub module, there have been some thoughts going through my mind to salvage the core 5529 device on the LP for some good use. And this weekend I have decided to give it a try.
     
    As the USB host part is confirmed not functioning, the first step is to verify the F5529 is still good. The easiest way is to try program it and check if it can run new program.
     
    With a good F5529 LP (the new replacement board ordered after the old one retired), I removed all the jumpers between the ez-FET and the target device, and then wired the GND, 5V, 3V3, RXD, TXD, SBW RST, and SBW TST from the good ez-FET to the 5529 side of the old LP. This will also power up the old board from the new one as the USB host on the old board is dead and no longer powering it.
     

     
    Soon after an example Energia sketch of SerialCallResponseASCII is uploaded through the new, good board, the good news is displayed on the Serial console confirming the 5529 device is still working flawlessly. At this point, I came into realization that this board can no longer be a handy development board as it once was but only good for deployment, possibly permanently, to some project because I have to rely on that good LP every time for programming.
     
    But wait, I recall recently from the forum there are some posts mentioning Forth interpreter for MSP430, one of which by monsonite with comprehensive information on various Forth offerings. However, a common requirement for Forth is serial communication for the console that my old LP is no longer capable to provide with a dead USB hub.
     
    Even though I don't have serial to usb converter to bypass the on-board hub for direct serial connection, I remember there is an old Arduino Pro Mini laying around without much used. Combining these two, I could probably build a utility development board that
    provide ad hoc programming capability (in Forth) on the 5529LP provide the console access required by Forth on the 5529LP via the Arduino Pro Mini (forward the serial communication from the Arduino UART to the 5529LP TX/RX) power the 5529LP via the 5V and 3V3 pin from the Arduino Pro Mini All in all, the goal is to take the Arduino Pro Mini as the controller or programmer of the 5529LP that is programmed to run Forth only. I picked the Mecrisp as it provided out of the box support for the 5529LP and pre-compiled hex file.
     
    So the build begin by first flashing the Forth hex file to the 5529LP. Again it required a good 5529LP and I used the latest MSPFlasher for the job. The following is the command line (for Windows).
    MSP430Flasher.exe -w "forth-mecrisp-5529.hex" -v -g -z [VCC]
     
    For a more decent looking of this utility development board, the Pro Mini is mounted to a medium sized breadboard on one end, and with four metal pins (pulled from left over connectors), the 5529LP is somehow "mounted" to the other end. This is enough for some structural support for the 5529LP
     

     
    Now for the Arduino side. Since there is only one set of UART on the Pro Mini, the program on it make use of the SoftSerial library that will emulate another serial port by two digital pins to relay the serial messages from the real UART to the 5529LP.
     

     
    Finally the moment of truth, the serial console to the Arduino is opened for a test. Apart from the line feed being weird, the expression run (1 2 + .<cr>) is successful, so is the programming of the blinky program
     

     
    Moving forward, the Arduino can be programmed in such a way that not only merely relaying serial message, but parse special commands to initiate specific Forth programming to the 5529LP (the Forth programs themselves stored as program in the Arduino). Hopefully this will make the whole package more versatile and practical.
  16. Like
    dubnet got a reaction from energia in TM4C129 Launchpad and XBee   
    You may want to try using Serial1 (e.g. Serial1.begin) instead of Serial and make your connections to RX1 and TX1. The first serial port on the launchpads is usually tied to the programming portion of the board and is used for as the backchannel serial port for terminal output.
  17. Like
    dubnet reacted to Fred in RANT: Cloud of this, IoT of that . . .   
    It could be worse. They could have called it the Internetduino.
  18. Like
    dubnet reacted to energia in How is Energia MT organized?   
    Right now EMT is not compiled from source. We link against a pre-compiled binary. Please see hardware/emt/ti/runtime/wiring/msp432/linker.cmd for which precompiled libraries are linked with. The sources of the Wiring framework can be found here: https://github.com/energia/emt.
     
    What we do is we create something called a closure that has all the binaries / headers included. I then take that closure and consume it during the build of Energia.
    We realize that this is not the ideal way to do it since it is very difficult to rebuild the wiring framework from source. For that reason, the next release of Energia based on Arduino 1.6 will utilize the core package management system. With that release the Wiring framework will always be build from source just as we do with the other none emt implementations. SYS/BIOS / TI-RTOS will not be build from source however since that would take way to long when you hit verify on a Sketch. Reason is that it is very unlikely that you would want to change anything in those sources. We will post instructions for how to recreate those binaries if you do want to change things in those sources.
     
    The next release is about a month out.
     
    Robert
  19. Like
    dubnet got a reaction from tripwire in Is there a way in Energia to access the LPM's?   
    @@JasonP Turns out it wasn't a task related issue after all. I had disconnected the jumpers to the XDS110 portion of the board so that power being measured by Energy Trace (via a MSP-FET) was only the target MCU. However, I overlooked the internal/external JTAG switch. Once it was set to the external connector, power consumption dropped from 100uA to less than 4uA. A classic facepalm moment...
  20. Like
    dubnet got a reaction from tripwire in Is there a way in Energia to access the LPM's?   
    With the MSP432 Launchpad you can use CCS6 and Energy Trace to measure LPM supply currents. You can import your Energia sketches into CCS and do full debug as well.  I haven't had a lot of success getting much below 100uA on the 432 with my testing, both with Energia MT using long delays in the program, and with a TI LPM3 (maybe LPM3.5, can't remember for sure) demo program under CCS.  Under Energia I shut down the serial port prior to the delay (which helped) and the CCS demo program supposedly put all the ports in a low power configuration prior to calling LPM3.x  I am sure that I am missing something and am planning to dig deeper when I get some free time. 
  21. Like
    dubnet got a reaction from jtvalley in MSP432 LP with xbee devices not transmitting or receiving   
    Not dumb. It would probably be safe to say that everyone on this board has had numerous "That was so obvious....why didn't I see that earlier" moments. Given the complexity of all this it is to be expected.  The challenges make it all the more rewarding when your project finally works as expected.
  22. Like
    dubnet got a reaction from jtvalley in MSP432 LP with xbee devices not transmitting or receiving   
    Your last sentence made me wonder if you are connecting pin 4 (TX of the MSP432) to the TX of the Zigbee module.  The TX of the MSP432 should be connected to the RX of the Zigbee and the TX of the Zigbee to the RX of the MSP432. 
  23. Like
    dubnet reacted to JasonP in Is there a way in Energia to access the LPM's?   
    Hello everyone,
     
    I just wanted to post an update on my MSP432 project.  Today after a few hours of messing around trying to get RTC interrupts working properly I gave up.  I did have a calendar based event trigger an interrupt but afterwards I was in no mans land.  All code execution stopped and I wasn't quite sure were I was ending up.  I suppose thats where the power of CCS comes in?  
     
    Anyways, I have seen the comment posted several times "when the processor is in an idle, it automagically enters a low power state".  A few days ago this was the first thing I tried, but it didn't seem to change the power consumption much.  I assumed it was entering LPM0 or LPM1 because during the delay state I was still up around 4.5mA.  After failing miserably with the RTC interrupt I figured I would re-explore this. 
     
    Huge thanks to @@dubnet for posting this
     
     
    The key words in there are long delays.  After I added delay(10000); in each of my loops I saw the current all the way down to 2.5uA!!!!  The trick to get this low of current is to make sure to end Serial if it is used.... Serial.end(); Otherwise I could never get below 1.5mA.  Thank you @@energia for this awesome MT platform!  I can now use interrupt based code with delays() in my loops and achieve my power budget goals. 
     
    I really only wished I had paid more attention to what was right in front of me or someone had spelled it out clearer.  
     
    LONG DELAYS = LOW POWER!
     
    IF YOU HAVE A MULTIPLE SKETCHES, ALL LOOPS MUST DELAY TO ENTER THIS LOW POWER STATE.  A FREE SPINNING LOOP IS NOT IDLE. 
     
     
    Cheers!
  24. Like
    dubnet got a reaction from JasonP in Is there a way in Energia to access the LPM's?   
    With the MSP432 Launchpad you can use CCS6 and Energy Trace to measure LPM supply currents. You can import your Energia sketches into CCS and do full debug as well.  I haven't had a lot of success getting much below 100uA on the 432 with my testing, both with Energia MT using long delays in the program, and with a TI LPM3 (maybe LPM3.5, can't remember for sure) demo program under CCS.  Under Energia I shut down the serial port prior to the delay (which helped) and the CCS demo program supposedly put all the ports in a low power configuration prior to calling LPM3.x  I am sure that I am missing something and am planning to dig deeper when I get some free time. 
  25. Like
    dubnet reacted to JasonP in Is there a way in Energia to access the LPM's?   
    #include "driverlib.h" #include "msp.h" /* Standard Includes */ #include <stdint.h> #include <stdbool.h> volatile int state = HIGH; volatile int flag = HIGH; int count = 0; void setup(){ Serial.begin(9600); delay(1000); Serial.println("Starting setup"); delay(1000); //Set all I/0s as out put except for reset and power pins. setPins_LowPower(); // Set pin mode for interrupt pinMode(73, INPUT_PULLUP); pinMode(GREEN_LED,OUTPUT); attachInterrupt(73, blink, FALLING); // Interrupt is fired whenever button is pressed Serial.println("Done with setup"); delay(1000); } void loop(){ if(state) { digitalWrite(GREEN_LED, state); //LED starts ON } else{ digitalWrite(GREEN_LED, state); //delay(1000); if(flag){ flag = LOW; Serial.begin(9600); Serial.println(count); Serial.end(); // Without ending Serial I was not able to enter LPM3 lowpower(); } } } void blink() { //count++; state = !state; flag = HIGH; } void setPins_LowPower(){ for (int i = 2; i < 11; i++) { pinMode(i, OUTPUT); digitalWrite(i, LOW); } for (int i = 11; i < 16; i++) { pinMode(i, OUTPUT); digitalWrite(i, LOW); } for (int i = 17; i < 20; i++) { pinMode(i, OUTPUT); digitalWrite(i, LOW); } for (int i = 23; i < 79; i++) { pinMode(i, OUTPUT); digitalWrite(i, LOW); } } void lowpower(){ MAP_WDT_A_holdTimer(); // Turn off watchdog timer? //MAP_RTC_C_holdClock(); // Turn off RTC MAP_PSS_disableHighSide(); // MAP_PSS_disableLowSide(); // MAP_PCM_gotoLPM3(); } So I threw a Hail Mary with with bits and pieces I have found from this forum and TI's forum.  The above code although a bit scabby, toggles the MSP-432 in and out of LPM3 mode.  While the device is in low power mode the the LED is off.  While out of low power mode the LED is on.  Not sure how to handle debouncing of the button but it seems to work well enough to get the idea of power consumption.
     
    **************************************************
    @3.3V
     
    LPM3 / LED OFF ~ 2.5uA !! low power
    ACTIVE / LED ON ~12mA
    ACTIVE/ LED OFF ~6mA
     
    ***************************************************
    I was happy to see "count" is maintained after entering and exiting LPM3.  There are still some quirks to get passed such as delay() doesn't work after calling my lowpower() function and coming back, but that's not too surprising since I disabled WDT?  Also without Serial.end() the device never reaches a low power state.  It gets stuck somewhere in between at about 4.5mA.  I will keep playing with this to see if I can completely come back from LPM3 with full functionality.
     
    Anyways things are looking OK thus far but I realized today that I need a way to wake the device on some specified time interval also.  I was thinking an RTC interrupt but I am looking for some advice on this.  I am finding snippets of code here and there but nothing really concrete yet.  
     
    I would be grateful if anyone can verify those sleep currents with the above code and give and or advise on timer interrupt in LPM3.
     
    Thanks guys.
×
×
  • Create New...