Jump to content

L293D

Members
  • Content Count

    65
  • Joined

  • Last visited


Reputation Activity

  1. Like
    L293D got a reaction from 430Enthusiast in Low power mode using WDT   
    Rick,
     
        I just wanted to say thank you.  I became so frustrated trying to figure out the LPM's on these devices that I went back to ATTiny chips.  I made a few of the things I wanted, and even got them down under 60 microamps during sleep...but...I REALLLY wanted to see that 1micro in LPM3.  I finally revisited your code from the post above...and like a ton of bricks..it hit me, and I finally got it.  I set about modifying it for a test and ended up with a working parking sensor (for my wife, for the garage)...it wakes up when the light comes on (using an LDR in a voltage divider to trigger an interrupt), uses an ultrasonic sensor and three LED's to let her know if she is not far enough in the garage...just right..or too far in the garage.  Then after 2 minutes, it goes into LPM3 again, waiting for the lights in the garage to come on again.
     
       Now I think I am finally ready to tackle the watchdog to wake me up from interrupt. 
     
       Thanks again man!
     
       Jerod
  2. Like
    L293D reacted to Rei Vilo in Energia Support for 2955 and 2744?   
    See milestone https://github.com/energia/Energia/issues?milestone=11&state=open'>RC8
  3. Like
    L293D got a reaction from PTB in [Energia Library] LCD_screen Library Suite   
    Quick question -
     
    I see a bunch of examples in the library which is awesome, however I notice that for instance the gauge examples are asking for files which are not present in the zip file.  Am I missing something, or is the zip file missing something?
     
    Also, so far, I like the library Rei...great work!
     
     
    L293D
  4. Like
    L293D reacted to Rei Vilo in Time to ask for help - data type issue/or bug   
    If this may help, have a look at my page about Using Integers Instead of Reals
     
    It saves about 6 KB out of 16 KB of flash memory.
  5. Like
    L293D reacted to spirilis in Time to ask for help - data type issue/or bug   
    Ah k, use float variables & casting:
     
    float gTest;
     
    gTest = 5.0 / (float)timeold;
     
    Looks like the Serial.print* functions should support float (or actually "double" but I think float works OK with that).
  6. Like
    L293D got a reaction from Pradeepa in [Energia Library] Nordic nRF24L01+ library   
    Ok, so I ported the Enrf library over so that it works with both MSP430 and Stellaris.  Seems to work great.  I am watching the tx rx demo between msp430g2553 (on the RX side), and the StellarPad doing the TX.  I have included an example in the usual examples folder so you can see how the SPI is setup on the StellarPad. 
     
    Was not much at all to change.  Just added the BIT defs, messed around with the SPI settings and it was up and running.
     
    I am off to bed.
     
    JerodEnrf24ST.zip
  7. Like
    L293D got a reaction from spirilis in [Energia Library] Nordic nRF24L01+ library   
    Ok, so I ported the Enrf library over so that it works with both MSP430 and Stellaris.  Seems to work great.  I am watching the tx rx demo between msp430g2553 (on the RX side), and the StellarPad doing the TX.  I have included an example in the usual examples folder so you can see how the SPI is setup on the StellarPad. 
     
    Was not much at all to change.  Just added the BIT defs, messed around with the SPI settings and it was up and running.
     
    I am off to bed.
     
    JerodEnrf24ST.zip
  8. Like
    L293D got a reaction from OzGrant in [Energia Library] Nordic nRF24L01+ library   
    Ok, so I ported the Enrf library over so that it works with both MSP430 and Stellaris.  Seems to work great.  I am watching the tx rx demo between msp430g2553 (on the RX side), and the StellarPad doing the TX.  I have included an example in the usual examples folder so you can see how the SPI is setup on the StellarPad. 
     
    Was not much at all to change.  Just added the BIT defs, messed around with the SPI settings and it was up and running.
     
    I am off to bed.
     
    JerodEnrf24ST.zip
  9. Like
    L293D got a reaction from reaper7 in [Energia Library] Nordic nRF24L01+ library   
    Ok, so I ported the Enrf library over so that it works with both MSP430 and Stellaris.  Seems to work great.  I am watching the tx rx demo between msp430g2553 (on the RX side), and the StellarPad doing the TX.  I have included an example in the usual examples folder so you can see how the SPI is setup on the StellarPad. 
     
    Was not much at all to change.  Just added the BIT defs, messed around with the SPI settings and it was up and running.
     
    I am off to bed.
     
    JerodEnrf24ST.zip
  10. Like
    L293D reacted to jscrane in [Energia Library] Port of UTFT library   
    If I had to add support for this board, I would do something like:
     
    * make a new config for HY28A, duplicating ILI9320 (in tft_drivers dir)
    * add a case statement for it to UTFT::UTFT setting display_transfer_mode=1
    * add a new transfer mode for hardware SPI (have a look at Adafruit's ST7735 library, I think this does both hardware and software SPI).
     
    The first two steps should give you a working setup in any case.
     
    Cheers,
    Steve
  11. Like
    L293D reacted to jscrane in [Energia Library] Port of UTFT library   
    Hi,
    I have ported Henning Karlsen's UTFT library to Energia on Stellaris. You can find the code here:
     
    https://github.com/jscrane/UTFT-Energia
     
    This code shows how to do reasonably fast graphics using GPIOPinWrite() instead of digitalWrite().
     
    It is a fork of the fine work done by Andresv, described on the 43oh forum here: http://forum.43oh.com/topic/3633-utft-library-utouch-henning-karlsen/
     
    Cheers,
    Steve
  12. Like
    L293D reacted to andresv in UTFT Library - UTouch - Henning Karlsen   
    I also tried out UTouch and it was already working without modifications.
     
    Only thing that I changed were calibration constants that I got from running UTouch_Calibration.pde, which comes wit the lib.
    In order to fit into 16 KB (MSP430FR5739) I removed almost all TFT prints from that program, I just printed out calibration result.
     
    I am very happy with the results. UTFT and UTouch are very easy to use and they are well documented.
     
    Although I have just 4 KB left for my application bussiness logic I think it would fit.
  13. Like
    L293D reacted to andresv in UTFT Library - UTouch - Henning Karlsen   
    Using binary search I found out that calling rotateChar(*st++, x, y, i, deg); in void UTFT::print(char *st, int x, int y, int deg) used huge amount of memory. I added special flag DISABLE_CHAR_ROTATING to UTFT library to disable this feature:
    https://github.com/andresv/industrial-switcher/commit/36f59887b5189857f0bf6ae72ef4211c834fbf2a
     
    Now everything seems to be working correctly.
  14. Like
    L293D reacted to energia in IR library and PWM   
    IRremote lib uses monopolizes Timer1 and analogWrite() does the same for some pins. 
     
    For the MSP430G2553 pins 4, 14 and 19 use Timer0 and you could use 2 of those except that all these pins are on the same PWM channel and thus would result in e.g. the same PWM signal on pin 4 while doing an analogWrite() to pin 14.
     
    The only way around this would be to make IRremote use Timer0. This is pretty easy. Simply replace all occurrences of TA1xxx with TA0xxx in the file IRremoteInt.h.
  15. Like
    L293D reacted to grahamf72 in Sleep mode during a fixed duration ?   
    The standard Energia delay() function spends most of its time in LPM0.  If you want lower than that you need to set up a timer running off either the optional Crystal or the VLO clock. 
     
    As an example for long low power delays, you could do something like the following:
     
    #include <Energia.h> volatile unsigned long delaycounter; void StartTimer() { //To use the VLO, Use the following: BCSCTL1 &= ~DIVA_3; // ACLK without divider - nominally 12kHz BCSCTL3 = (LFXT1S_2); // Source ACLK from VLO TA1CCTL0 = CCIE; // CCR0 interupt activated TA1CCR0=11999; // 12000 ticks is nominally 1 second TA1CTL = TASSEL_1 | ID_0 | MC_1; // Clock for TIMER = ACLK, No division, up mode //Alternatively to use the Crystal for more accuracy use the Following /* P2SEL |= (BIT6 | BIT7); // Reset P2_6 & P2_7 BCSCTL1 &= ~DIVA_3; // ACLK without divider - 32768kHz BCSCTL3 = (LFXT1S_0 | XCAP_3);// Source ACLK from XTal TA1CCTL0 = CCIE; // CCR0 interupt activated TA1CCR0=4096-1; // we are dividing clock by 8, so 4096 ticks = 1 second TA1CTL = TASSEL_1 | ID_3 | MC_1; // Clock for TIMER = ACLK, By 8 division, up mode */ } void StopTimer() { TA1CTL|=TACLR; } //Set Up the Interrupt routine... __attribute__((interrupt(TIMER1_A0_VECTOR))) void timer_isr (void) { ++delaycounter; //increment our seconds counter __bic_status_register_on_exit(LPM3_bits); //exit at full power. } //And here is our delay function... //this will create delays of up to approx 136 years //with 1 second resolution. void longdelay(unsigned long delayseconds) { delaycounter=0; StartTimer(); //start our timer up while (delaycounter<delayseconds) //while we haven't reached our count... __bis_status_register(LPM3_bits+GIE); //switch back to LPM3. StopTimer(); //times up, stop our timers. }; void setup() { Serial.begin(9600); }; void loop() { Serial.println("10 seconds mostly in LPM0 with traditional delay..."); delay(10000); Serial.println("10 seconds in LPM3 with longdelay..."); longdelay(10); };  
    When I tested this, I was getting about 1300uA (1.3mA) during the traditional delay(). This dropped to about 25uA when it was in the longdelay function.
  16. Like
    L293D got a reaction from xv4y in [Energia Library] LadyAda's DHT Library Ported   
    Here is the zip that bluehash requested that I post.
     
    Tested with DHT11, output to an LCD.
     
    Here is the original post: http://forum.43oh.com/topic/2826-ladyadas-dht-library-lcd/
    AdaDHT11.zip
  17. Like
    L293D reacted to Rickta59 in Low power mode using WDT   
    I posted a similar example here:
     
    http://forum.43oh.com/topic/2759-problem-with-interrupts-on-p1-and-a-timer/#entry23367
     
    -rick
  18. Like
    L293D got a reaction from energia in [Energia Library] LadyAda's DHT Library Ported   
    Here is the zip that bluehash requested that I post.
     
    Tested with DHT11, output to an LCD.
     
    Here is the original post: http://forum.43oh.com/topic/2826-ladyadas-dht-library-lcd/
    AdaDHT11.zip
  19. Like
    L293D reacted to energia in Stellar Pad - PWM and analogWrite   
    All the PWM's can operate simultaneously.
     
    You can find the pins that support PWM (analogWrite) in the pin mapping on: https://github.com/energia/Energia/wiki/Hardware
    If you would like to know on what timers are on what pins then you can find that in hardware/lm4f/variants/stellarpad/pins_energia.h
     
    5Volt tolerance: From the data sheet section 10.1 Signal description: "All GPIO signals are 5-V tolerant when configured as inputs except for PB0 and PB1, which are limited to 3.6 V"
     
    http://www.ti.com/product/lm4f120h5qr
  20. Like
    L293D reacted to bluehash in Stellar Pad - PWM and analogWrite   
    This should be more suited at the Stellarisiti forum:
    http://forum.stellarisiti.com/forum/63-
  21. Like
    L293D reacted to Rickta59 in Is there a way in Energia to access the LPM's?   
    if you create a folder and place both files in there it should show up. To create new files you create a new "tab" so you can have more than one file in a sketch.
  22. Like
    L293D reacted to energia in Is there a way in Energia to access the LPM's?   
    Enabling easy access to LMP's has been on my list for a long time but just hadn't had the time..
    I have done some sketching to get a rough idea of what it would take. The below Sketch should help you to get on your way.
     

    void setup() { /* Watchdog runs in interval. * Disable it so we don't wake up at 6 am when our alarm is set for 10 am. * After this call delay(...) will not work */ disableWatchDog(); attachInterrupt(P1_3, awake, FALLING); } void loop() { __bis_status_register(LPM4_bits + GIE); /* Code after this will never be reached */ } void awake(){ /* You are in the ISR. * Do something useful while you are awake! * But don't call any functions that rely on interrupt */ }
     
    Note that after awake() is called, system will go back to LPM4. Clearing the LPM4 bits here will not work since the SR register is on the stack and will be popped off resetting the LPM bits. Only place you can do this right now is inside WInterrupt.c in the port interrupt ISR. You will have to call __bic_status_register_on_exit(LPM4_bits);
     
    Using the above you should see current consumption go down to the nA's :-)
     
    Robert
  23. Like
    L293D reacted to energia in Is there a way in Energia to access the LPM's?   
    I didn't answer your last question. Yes, the code is totally portable to Energia.
     

    void setup(void) { disableWatchDog(); P1DIR |= 0x01; // Set P1.0 to output direction P1IE |= BIT3; // P1.3 interrupt enabled P1IES |= BIT3; // P1.3 Hi/lo edge P1IFG &= ~BIT3; // P1.3 IFG cleared _BIS_SR(LPM4_bits + GIE); // Enter LPM4 w/interrupt } void loop() { } // Port 1 interrupt service routine #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { P1OUT ^= 0x01; // P1.0 = toggle P1IES ^= BIT3; P1IFG &= ~BIT3; // P1.3 IFG cleared }
  24. Like
    L293D got a reaction from bluehash in [Energia Library] LadyAda's DHT Library Ported   
    Is that what you meant? I just added a link to the original post where I was asking all of the questions.
  25. Like
    L293D got a reaction from bluehash in [Energia Library] LadyAda's DHT Library Ported   
    Here is the zip that bluehash requested that I post.
     
    Tested with DHT11, output to an LCD.
     
    Here is the original post: http://forum.43oh.com/topic/2826-ladyadas-dht-library-lcd/
    AdaDHT11.zip
×
×
  • Create New...