Avatar for Dorantor

Dorantor

Member since Feb 2014 • Last active Feb 2015
  • 1 conversations
  • 12 comments

Most recent activity

  • in General
    Avatar for Dorantor

    It is unreliable even on USB when I press RST. After RST I see backlight blink almost immediately, while it should be after few seconds. And screen is not starting up after RST. Only time when it was working properly with RST is when I used setTime(getTime()). But only until power is turned off.

    I'll check for Reset pin.

    Backlight is turned on only for a moment.

  • in General
    Avatar for Dorantor

    @Gordon, deep sleep if for the future, when I have stable/predictable behaviour with screen.

    My voltmeter shows constant 3.3V(+/- 0.02V). Between output of my "power module" and Espruino there is an electrolytic 1500uF capacitor. It's there for two reasons. First - remove possible pulsations from buck converter(step up module). Second - provide backup power storage for Espruino+screen startup. 1.5mF is a lot, but I currently doesn't have smaller :)

    Approx 1 of 5 times when I connect Espruino to "power module", screen is working. And when I can see it's working it can last for about 1hr with fully charged supercap. I hope that with deep sleep it can be improved.

    There is an
    A4.write(1); // turn screen light on
    to make sure code is running properly. Actually, I don't see any other points that I could check with LEDs.
    I shall receive my mooshimeter soon, it should help to check if board is "browned out".

    While board connected to USB everything is working properly.

    Anyway, thanks for the help. I'll try to do some more investigations on my own and post my findings later.

  • in General
    Avatar for Dorantor

    @Gordon, power comes near A1 in through GND and 3.3 on the side. Screen is connected also near A1 at the BTN1(GND and 3.3). See attached image. This way it still goes through voltage regulator?

    Until I have clear understanding how things works I usually try to avoid complications, so mine v72 came from Web IDE. Currently it's the simplest way to work with Espruino :)

  • in General
    Avatar for Dorantor

    Wiring is almost the same as for "direct soldering screen to Espruino", except mine screen is powered from GND and 3.3. Espruino itself powered with step-up from U1V10F3 from Pololu (solar => supercapacitor => stepup). So, in theory, I have always 3.3 for Espruino and screen.

    I'm using KS version(1.3?) with v72 firmware.

    require("Font6x8").add(Graphics);
    
    SPI1.setup({ baud: 2000000, sck:A5, mosi:A7 });
    
    var interval = 10;
    
    var g;
    var time;
    var voltage;
    
    function onInit() {
      time = 0;
      
      
      setTimeout(
        function() {
          g = require("PCD8544").connect(SPI1,A6,B1,B0­, function() {
    
            //g.clear();
            //g.drawString("Init complete.", 0, 1);
            //g.flip();
    
            A4.write(1);
            A4.write(0);
    
            setInterval(onTimer, interval * 1000);
            //g.setContrast(0.5);
            g.setFont6x8();
          });
        },
        5000
      );
    
    }
    
    function onTimer() {
      voltage = analogRead(A3) * E.getAnalogVRef();
      time += interval;
    
      g.clear();
      g.drawString("Seconds: " + time, 0, 0);
      g.drawString("Volts: " + Math.round(voltage*100)/100, 0, 8);
      g.drawString("Reference: " + Math.round(E.getAnalogVRef()*100)/100, 0, 16);
    
      g.flip();
    }
    
  • in General
    Avatar for Dorantor

    Well. Now it's really weird :)

    It seems that I have unstable result with just plug/unplug my "espruino with screen" to power. And sometimes I can see everything on my screen just perfectly, sometimes.. well.. nothing. And sometimes very-very light. I'll continue to investigate, but it seems that roots of this problem is somewhere with SPI and screen itself. And it's completely new field for me, first time playing with SPI and screen :)
    And even delay with screen init, while quite obvious, didn't came to my mind :)

    I can post my code, but it's very similar to the one that you can see on the top. The only difference I see is where SPI1.setup() located. Mine - outside of onInit().

  • in General
    Avatar for Dorantor

    Well, actually I'm stuck exactly at the where topicstarter did. While connected to USB screen behaves as expected. But when I switch to battery - I barely can see what is written on my screen.
    I increased initial timeout to 5 seconds, but it didn't help.
    Espruino is working, according to LED indication, but screen - doesn't.

    In the end cleaned up my code, reflashed Espruino numerous times and at some point it started working. For me, it seems that "saved state" was causing some of my problems.
    With my Arduino background I sometimes get not what I expected. Is it possible to load to Espruino exact copy of what I wrote, w/o any "artifacts" whatever origin they might be?

  • in General
    Avatar for Dorantor

    @DrAzzy, solution with delay helped a lot. Actually, only with it I was able to move forward. So, big thanks here.

    But, still, it's interesting why adding this line still(!) help. And why it stops working after hard(power) reset. With setTime it will properly restart after RST, w/o it - doesn't.

    Maybe I'm just doing something very wrong? :)

  • in General
    Avatar for Dorantor

    @Gordon, what should setTime(getTime()) do?
    Because when I add this lines it starting to behave as I expect, but only until power is disconnected. After that, the the only way I could revive my Espruino(1.3) is to reflash it. I'm using v72.

Actions