Jump to content
43oh

arheops

Members
  • Content Count

    16
  • Joined

  • Last visited

Posts posted by arheops

  1. lowpower sleep can be done by following:

     

    
    void mdelay(uint32_t milliseconds)
    {
        WDTCTL = WDT_ADLY_1_9;  // WDT triggered from ACLK after ~6ms, millis() will be skewed BTW
        uint32_t wakeTime = milliseconds/5;
            while(wakeTime>0){
                    
                    wakeTime--;
                    /* Wait for WDT interrupt in LMP3 */
                    __bis_status_register(LPM3_bits+GIE);
            }
       WDTCTL = WDT_MDLY_0_5; // WDT back to original Energia setting, SMCLK 0.5ms/IRQ
    }

    it not very accurate, but enought for most cases.

    watchdog interrupts supplied by energia ide.

    p.s code is tested and workign on launchpad.

  2. hi

    for CCS code is:

     

    
            ADC10CTL1 = INCH_11;                      // AVcc/2
            ADC10CTL0 = SREF_1 + ADC10SHT_2 + REFON + REF2_5V + ADC10ON + ADC10IE;
            ADC10CTL0 |= ENC + ADC10SC;             // Sampling and conversion start
            __bis_SR_register(CPUOFF + GIE);        // LPM0, ADC10_ISR will force exit
            ADC10CTL0=0x0;
                return ADC10MEM;

    Can anyone give me some direction of how to do same for energia?

  3. thank you very much for your suggestion. following replace of delay work ok:

     

     

    void mdelay(uint32_t milliseconds)
    {
        WDTCTL = WDT_ADLY_1_9;  // WDT triggered from ACLK after ~6ms, millis() will be skewed BTW
        uint32_t wakeTime = (milliseconds*10)/51;
            while(wakeTime>0){
                    /* Wait for WDT interrupt in LMP0 */
                    wakeTime--;
                    __bis_status_register(LPM3_bits+GIE);
            }
       WDTCTL = WDT_MDLY_0_5; // WDT back to original Energia setting, SMCLK 0.5ms/IRQ
    }

     


    it not very accurate, but ok.

     

    note, there are no need in timer interrupt, since energia already supply compatible one.

     

    i can't measure transmit power, it go from 0 to 0.06mA(i have no uA in my tool)

  4. no. that is nto bug i reported. i removes serial.

     

    okay. here is code:

     

    void setup() {
      //Serial.begin(9600);
      //Serial.println('1');
      SPI.begin();
      SPI.setDataMode(SPI_MODE0);
      SPI.setBitOrder(1); // MSB-first
      //Serial.println('2');
    
      radio.begin();  // Defaults 1Mbps, channel 0, max TX power
      Serial.println(radio.radioState());
      radio.setSpeed(1000000);
      radio.setTXaddress((void*)txaddr);
    
    }
    
    
    
    void loop() {
       radio.begin();
      radio.setTXaddress((void*)txaddr);
      radio.print(str_on);
      radio.flush();  // Force transmit (don't wait for any more data)
      radio.deepsleep();
      delay(1000);
      radio.begin();
      radio.setTXaddress((void*)txaddr);
      radio.print(str_off);
      radio.flush();  //
      radio.deepsleep();
      delay(1000);
    }
    
    

     

     

    this one is working.

    this one is NOT working

     

     

     

    void setup() {
      //Serial.begin(9600);
      //Serial.println('1');
      SPI.begin();
      SPI.setDataMode(SPI_MODE0);
      SPI.setBitOrder(1); // MSB-first
      //Serial.println('2');
    
      radio.begin();  // Defaults 1Mbps, channel 0, max TX power
      Serial.println(radio.radioState());
      radio.setSpeed(1000000);
      radio.setTXaddress((void*)txaddr);
    
    }
    
    
    void loop() {
      radio.print(str_on);
      radio.flush();  // Force transmit (don't wait for any more data)
      radio.deepsleep();
      delay(1000);
      radio.print(str_off);
      radio.flush();  //
      radio.deepsleep();
      delay(1000);
    }

     

    also if i switch to lpm3, after that nrf never start at all.

  5. There WAS problem in wakeup nrf after lm3 sleep when i tested it last time. looks like spi go off after that. same issue if go to 2mhz mode.

    but anyway even current power consumption is low enought, i will play with modes letter.

     

    my transiver use 18mA when in RX mode. but i am thinking about just start it to rx for 50ms after send packet. so on server side it do send instruction 20 ms after it get packet. working for 50ms/per every 10 second will give enought low power.

    yes, i understand that RX take power. but RX side will be connected to wifi,so it need power anyway. while tx part have allow 2 side communication(at least to turn/off connected sensors and change resolution) and will be powered by solar or battery/capacitor.

  6. Thank you, that allow detect issue.

    Here is color scheme of how to connect wires to balck nrf module(first phone it 2 side of nrf, second one is msp430)

    https://picasaweb.google.com/arheops/Nrf24L01

     

    looking forward for more options. Actualy best variant i am looking is: turn on to 16mhz,setup radio, send packet, change to read, read response from main node, go power saving radio, go 32khz,go LM3 mode, wait Xsec, radio wakeup&send packet(that can be used to create solar powered sensor network)

     

    But your current code already huge breakout in code complexity decrease.

     

    Checking sleep modes.

    This code:

     

    void loop() {
      radio.begin();
      radio.setTXaddress((void*)txaddr);
      radio.print(str_on);
      radio.flush();  // Force transmit (don't wait for any more data)
      delay(100);
      radio.deepsleep();
      delay(5000);
      radio.begin();
      radio.setTXaddress((void*)txaddr);
      radio.print(str_off);
      radio.flush();  //
      delay(100);
      radio.deepsleep();
      delay(5000);
    }

     

     

    take less then <10uA )) sorry,not able measure <10uA current.

     

     

    update: looks like i measure it wrong. consumption without lpm3 is 0.7-1.3ma depend of voltage.

    post-3-0-35261600-1359125484_thumb.jpg

    post-3-0-34227200-1359125485_thumb.jpg

×
×
  • Create New...