Avatar for asez73

asez73

Member since Oct 2014 • Last active Sep 2018
  • 6 conversations
  • 138 comments

I have an Espruino board 1v4 and a Kickstarter Pico board...

Most recent activity

  • in Porting to new Devices
    Avatar for asez73

    Hi, 1bitsy is not so far from:
    Espruino wifi or Espruini pico!
    They are officially supported and do get a long term support...

  • in Puck.js, Pixl.js and MDBT42
    Avatar for asez73

    Hi,
    So I did get values around 192 uA - 230 uA while beeing connected, after an NRF.setLowPowerConnection(true) command , display ON and nothing beeing advertising except the Pixl's name.
    The fluctuation is probably due to not averaging a long time enough.
    Also, I got 50 uA with ldc off with some random reboots on other tries later.
    That said it's very comparable to your figures.
    So far NRF.setConnectionInterval(200) is not recognised on v1.99...

    So the good news is that we will have a very efficient way to save power on the next release.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for asez73

    Hi again,

    Edit: some partial conclusions:
    While beeing unable to measure some uA situations, I can infer from the figures below that:
    a- the "normal" power consumption when no code is beeing executed and display is ON is rather like 300 - 350 uA.
    b- switching off the display does save around 70 uA or 20 % from normal power consumption,
    c- going to deep sleep saves may be 130 - 140 uA or 40 % from normal power consumption,
    d- the Idd from the 32L476DISCOVERY is totally unappropriated to measure varying uAs as it switches from on range to another and interrupts power supply precisely at the amperages in normal power consumption mode with LCD OFF.

    Original post:
    So my measures are as follow:

    Display BLE uart Measure Comment
    ===== ======= ======= ========

    ON connected 570 uA figures are fluctuating ??? BLE UART influence ?
    OFF connected 500 uA figures are fluctuating ??? BLE UART influence ?
    deep sleep connected 430 uA figures are fluctuating ??? BLE UART influence ? Lower than OFF
    back ON connected 570 uA same as ON connected
    ON not connected 220 uA jumping between 200 and 590 possibly advertising effects, peaks at 890 uA
    OFF not connected 39 uA But reboots with no obvious reason!!! Self ranging ampmeter not switching correctly ????????
    deep sleep not connected 37 uA But reboots with no obvious reason!!! Self ranging ampmeter not switching correctly ????????
    back ON not connected ? uA Never clear display

    Interestingly, reconnecting the ble uart (web ide) OR booting from an usb power bank, does stop all reboots and gives back the same behaviour and figures... So it really seems that the multi meter approach of the 32L476DISCOVERY is in default with those power variations. Unfortunately, the code of this part of the board is not open source: you can not know how measures are by the integrated coprocessor.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for asez73

    I am limited by the Idd functionnality integrated in the 32l476discovery board which is, interestingly, a kind of self ranging ampmeter limited to 50nA - 50 mA at a rather slow rate (1-3 Hz)...
    It has already proven to be too averaging to be satisfying in short bursts of power and not replacing correctly an oscilloscope.

    About the deep sleep, I didn't cared to add the g.setRotate and g.flip(true) but it does work functionally!

    My motivation was to increase the 17 days of autonomy, with a no-name coin cell, by switching off the lcd on a time of day base!

    That brings me to some need about an RTC function surviving to resets and code uploads: The IDE offers the time and date automatic setup at code upload but that doesn't survive a reset() which is "illogical" as time never-ever flows back :)

  • in Puck.js, Pixl.js and MDBT42
    Avatar for asez73

    Hi,
    As a complement, I used the following code on the Pixl.js.
    It allows to switch On/Off the display thus saving the few uA it consumes.
    Unfortunatelly, I do not have an oscilloscope and can't measure the real reduction of power consumption, nor any short peak of power when switched on back from deep sleep.

    It is a very quick C++ to espruino translation and still contains unused constants... I was about to add this to the standard ST7565 module, when I understood that, indeed, the Pixl.js is using an integrated version probably in C++.

    The source github repo is mentionned in the comments.

    // handle lcd on/off deep sleep
    // extracted from 
    // https://github.com/boseji/Rpi-ST7565-SPI­-LCD/blob/master/lcdST7565.c#L729
    
    /***************************************­*********************************/
    /* Commands    */
    /***************************************­*********************************/
    /*
    BLACK 1
    WHITE 0
    */
    
    var ST7565_LCD_CMD_DISPLAY_OFF = 0xAE;
    var ST7565_LCD_CMD_DISPLAY_ON = 0xAF;
    var ST7565_LCD_PARAM_BRIGHTNESS = 0x0;
    
    /* Unused constants from github
    ST7565_LCD_CMD_SET_DISP_START_LINE   0x40
    ST7565_LCD_CMD_SET_PAGE  0xB0
    
    ST7565_LCD_CMD_SET_COLUMN_UPPER   0x10
    ST7565_LCD_CMD_SET_COLUMN_LOWER   0x00
    
    ST7565_LCD_CMD_SET_ADC_NORMAL  0xA0
    ST7565_LCD_CMD_SET_ADC_REVERSE 0xA1
    
    ST7565_LCD_CMD_SET_DISP_NORMAL 0xA6
    ST7565_LCD_CMD_SET_DISP_REVERSE   0xA7
    */
    
    var ST7565_LCD_CMD_SET_ALLPTS_NORMAL = 0xA4;
    
    var ST7565_LCD_CMD_SET_ALLPTS_ON = 0xA5;
    
    /* Unused constants from github
    ST7565_LCD_CMD_SET_BIAS_9   0xA2
    ST7565_LCD_CMD_SET_BIAS_7   0xA3
    
    ST7565_LCD_CMD_RMW    0xE0
    ST7565_LCD_CMD_RMW_CLEAR 0xEE
    */
    
    var ST7565_LCD_CMD_INTERNAL_RESET = 0xE2;
    
    /* Unused constants from github
    ST7565_LCD_CMD_SET_COM_NORMAL  0xC0
    ST7565_LCD_CMD_SET_COM_REVERSE 0xC8
    ST7565_LCD_CMD_SET_POWER_CONTROL  0x28
    ST7565_LCD_CMD_SET_RESISTOR_RATIO 0x20
    */
    
    var ST7565_LCD_CMD_SET_VOLUME_FIRST = 0x81;
    var ST7565_LCD_CMD_SET_VOLUME_SECOND = 0x0;
    
    var ST7565_LCD_CMD_SET_STATIC_OFF = 0xAC;
    
    var ST7565_LCD_CMD_SET_STATIC_ON = 0xAD;
    
    var ST7565_LCD_CMD_SET_STATIC_REG = 0x0;
    
    /* Unused constants from github
    ST7565_LCD_CMD_SET_BOOSTER_FIRST  0xF8
    ST7565_LCD_CMD_SET_BOOSTER_234 0
    ST7565_LCD_CMD_SET_BOOSTER_5   1
    ST7565_LCD_CMD_SET_BOOSTER_6   3
    ST7565_LCD_CMD_NOP    0xE3
    ST7565_LCD_CMD_TEST   0xF0
    */
    
    /**
     *  Function to control the Contrast and brightness ratio
     *  - This is generally a fixed value for a given LCD.
     */
    function lcd_bright ( bValue ) {
      retcode = 0;
      retcode = Pixl.lcdw(ST7565_LCD_CMD_SET_VOLUME_FIRS­T);
      if(retcode !== 0) return retcode;
      return Pixl.lcdw(ST7565_LCD_CMD_SET_VOLUME_SECO­ND | (bValue & 0x3f));
    }
    
    /**
     * @brief Function to Put the LCD into Deep Sleep mode
     * 
     */
    function lcd_sleep ( ){
      // * WORKS displays is wiped, so you have to g.flip() afterward
      Pixl.lcdw(ST7565_LCD_CMD_SET_STATIC_OFF)­;
      Pixl.lcdw(ST7565_LCD_CMD_DISPLAY_OFF);
      Pixl.lcdw(ST7565_LCD_CMD_SET_ALLPTS_ON);­
    }
    
    /**
     * @brief Function to bring back the LCD from Deep Sleep mode
     * All display contents are cleared and need to reinitalize
     * 
     * WARNING SO FAR DISPLAY IS SET UPSIDE DOWN
     */
    function lcd_wakeup ( ) {
      Pixl.lcdw(ST7565_LCD_CMD_INTERNAL_RESET)­;
      lcd_bright(ST7565_LCD_PARAM_BRIGHTNESS);­
      Pixl.lcdw(ST7565_LCD_CMD_SET_ALLPTS_NORM­AL);
      Pixl.lcdw(ST7565_LCD_CMD_DISPLAY_ON);
      Pixl.lcdw(ST7565_LCD_CMD_SET_STATIC_ON);­
      Pixl.lcdw(ST7565_LCD_CMD_SET_STATIC_REG | 0x03);
    }
    
    /**
     * @brief Function to Put and wakup the LCD in Standby mode
     *   In this mode the display contents are not lost
     *   its only not visible
     * @param bWakeUp Used to decide that if we need to enter or exit standby
     *  0 - Enters into the Standby mode
     *  1 - Exits the Standby mode
     */
    function lcd_standby ( bWakeUp ) {
      if (bWakeUp === 0) { /* Enter standby mode */
        Pixl.lcdw(ST7565_LCD_CMD_SET_STATIC_ON);­
        Pixl.lcdw(ST7565_LCD_CMD_SET_STATIC_REG | 0x03);
        Pixl.lcdw(ST7565_LCD_CMD_DISPLAY_OFF);
        Pixl.lcdw(ST7565_LCD_CMD_SET_ALLPTS_ON);­
      }
      else { /* Wake from standby */
        Pixl.lcdw(ST7565_LCD_CMD_SET_ALLPTS_NORM­AL);
        Pixl.lcdw(ST7565_LCD_CMD_DISPLAY_ON);
      }
    }
    
    var lcdstatus = 0;
    
    function lcdonoff() {
      lcd_standby(lcdstatus);
      if (lcdstatus === 0) lcdstatus = 1;
      else lcdstatus = 0;
    }
    
    setWatch(lcdonoff,BTN1,{edge:"rising", debounce:50, repeat:true});
    
    
  • in Puck.js, Pixl.js and MDBT42
    Avatar for asez73

    Hi,
    Could you consider adding Lora and Sigfox shields?
    Albeit long range they are rather energy savvy.

  • in General
    Avatar for asez73

    Good, so, i'll disconnect / reconnect after any change in the settings.
    Thanks again for your follow up.

  • in General
    Avatar for asez73

    Ok, I reflashed with the new cable and it seems to work now...
    Sorry for the disturbance!

    So I closed the discussion and can't add more posts....
    Things are tricking:
    Turning off minimification and offline mode imposed me to disconnect and reconnect the board in order to have success. Otherwise, the errors went back as described above.

    Then, setting back offline mode does impose the same disconnection/reconnection once only and the problem seems not to reappear: Non errors nor warnings and correct result of 21.

    Then turning minimification back to Espruima offline on, did imposed also disconecting/reconnecting once only the board.

    Then turning minimification back to Closure online (whitespace only) on, did imposed also disconecting/reconnecting once only the board.

    So it could be a problem of stored configuration in the web ide finaly???

  • in General
    Avatar for asez73

    You are very reactive and some of our posts got unsynced.
    Thank you for that.
    Anyway, everythings is shown above.
    I don't think it is related to the webide itself, or at least not the last version.
    It seems, just an opinion, to be related to serial buffering as I mentionned some cases, which did not appeared here, showed some strings not displayed on the left pane of the webide until I pressed the Enter key.

Actions