Avatar for allObjects

allObjects

Member since Jul 2014 • Last active Jul 2020

Espruino makes IoT as easy as 123!

Most recent activity

  • in Bangle.js
    Avatar for allObjects

    ...or adding an IP65..IP67 conform or directional shock controlled electro mechanical switch.

  • in Bangle.js
    Avatar for allObjects

    @d3nd3-o0, it all depends what resolved means... For Espruino JS, the arguments are 'resolved enough' - so to speak - because any code (JS interpreter implementation) - knows to handle a String object: 'talk to it' thru the its method, since it is object-oriented and one of the main goals i to hide the implementation. If the C code does the same as, for example the String method implementations of String.charAt(pos) and String.indexOf(needleString,[startPos]) and (under the cover/indirectly E.toString(aString)) do, it would be just fine. After all, the method/property accessor String.length can do it without reading the String into memory where C code similar as suggested could do the job. An indication that String in JS are obviously looked at differently - have a different implementation - than in standard C - otherwise the length would not have to be passed: a reference to an object in an object-oriented context is all it needs to handle the job.

    From what I get out of this 'exercise' is that an implementation for counting line feeds in JS may be almost as fast as doing it in C because the meat is not really in parsing the string but actually accessing the. bytes of the string. (@Gorden) I hope I can assume that something along the lines of

    var str = "xoxo" // as: = require("Storage").read("FileName");
      , cnt = 0, start=-1, pos; // count occurrences of "x"
    while ((pos = str.indexOf("x",start+1)) > start) { cnt++; start = pos; }
    

    does / could (?) work without String.indexOf() having to read the whole string in memory. On the other hand I know that streaming implementations are demanding and it may well be that it is not worth - or possible - to spend so much code and temp memory for it since the majority of string that are processed aren't that long that they would need a 'streaming' treatment.

    The statement 'almost equally as fast as C' ignores the parsing and interpreting of the JS source which Is though significant and the efficiency depends on how String.indexOf() with start pos is implemented for a String 'living' in the storage.

  • in Bangle.js
    Avatar for allObjects

    List of ICs - counter clock wise starting with nrf52932 (name/id details may slightly vary between individual watches / production batches):

    1. nrf52832 - N52832 QFAAE1 1929HO
    2. xtal - SJK 32.000
    3. xtal? - S845A
    4. gps - ublox M8130-KT B302FA 05077589 1837A3
    5. ? - 9Q
    6. ? - TW
    7. ? - 8044
    8. xtal? - BN26.0 D730
    9. accelerator - KX023 92495 3818
    10. portexpander - 672 01 02 uD831
    11. magnetometer - C3A 011
    12. ? - K42
    13. serial flash - A1Y2000 1934P
    14. ? - 9Q
    15. touch controller - H A2 A4
    16. battery charge controller - 65b924
    17. vibr motor - +99J
    18. dual (driver) transistors - K6N
    19. ? - L9

    nrf52832 pins (counter clock wise starting Left top in shot with pin 1, then Bottom, Right, Top) - GPIO (in/out) - usage (from bangle board .py file https://github.com/espruino/Espruino/blo­b/master/boards/BANGLEJS.py and inspecting watch / non-destructive tear-down):

    1. L -
    2. L - GPIO D0 (o) - display D0 - 8-bot parallel mode ST7789 controller
    3. L - GPIO D1 (0) - display D1
    4. L - GPIO D2 (0) - display D2
    5. L - GPIO D3 (0) - display D3
    6. L - GPIO D4 (0) - display D4
    7. L - GPIO D5 (0) - display D5
    8. L - GPIO D6 (0) - display D6
    9. L - GPIO D7 (0) - display D7
    10. L - GPIO D8 (o) - display D/C - display data/command
    11. L - GPIO D9 (o) - display SCK - display serial clock
    12. L - GPIO D10 (o) - display CS - display chip select
    13. B - VDD - + Vdd
    14. B - GPIO11 D (i) - BTN4 - Button 4 - touch left area from touch controller
    15. B - GPIO12 D (i) - cha - charge controller status (neg charging)
    16. B - GPIO D13 (o) - VIB - Vibration Motor via R and 1st transistor in dual array
    17. B - GPIO D14 (o) - i2c C - i2c clock (to accel, portexp, magn)
    18. B - GPIO D15 (i/o) - i2c D - i2c data (to/from accel, portexp, magn)
    19. B - GPIO D16 (i) - BTN5 - Button 5 - touch right area from touch controller
    20. B - GPIO D17 (o|i) - extMem rst - reset to external flash memory | qio: D3
    21. B - GPIO D18 (o) - SPKR - Speaker via R and 2nd transistor in dual array
    22. B - GPIO D19 (o) - extMem sc - sck serial clock to external flash memory
    23. B - GPIO D20 (i) - extMem mi - master-in/slave out from external flash memory | qio: D1
    24. B - GPIO D21 (o) - extMem cs - chip select to external flash memory
    25. R - SWDCLK (i) - SWDCLK -on pad on back of main board for pogo pin
    26. R -SWDIO (i/o) - SWDIO - on pad on back of main board for pogo pin
    27. R - GPIO D22 (i) - BTN2 - Button 2 - push button (middle when right facing)
    28. R - GPIO D23 (i) - BTN3 - Button 3 - push button (bottom when right facing)
    29. R - GPIO D24 (i) - BTN1 - Button 1- push button (top when right facing)
    30. R - Ant - Antenna BLE
    31. R -VSS - - Vss
    32. R -
    33. R -
    34. R -
    35. R -
    36. R - VDD - + Vdd
    37. T - GPIO D25 (o) - GPS TX - serial transmit to gps RX
    38. T - GPIO D26 (i) - GPS RX - serial receive from gps TX
    39. T - GPIO D27 (o|i) - extMem mosi - matser-out/slave-in to ext flash memory | qio: D0
    40. T - GPIO D28 (o) - IOXR - IO eXtender Reset - portextender reset
    41. T - GPIO D29 (i) - hrtr - heart rate (analog value) from heart rate monitor, analog input
    42. T - GPIO D30 (i) - volt - battery voltage from R voltage divider, analog input
    43. T - GPIO D31 (o|i) - wp - extMem wp - write protect to external flash memory | qio: D2
    44. T -
    45. T - VSS - - Vss
    46. T -
    47. T -
    48. T - VCC - + Vdd
  • in Bangle.js
    Avatar for allObjects

    Some information from inspection and discovery on non-destructive tear-down I did quite a while ago (on a watch with piezo speaker). Note that the chip marked with 'Mag?' in the main shot on https://www.espruino.com/Bangle.js+Techn­ical is the port expander. The Mag(netometer sensor) is the very small chip to its left with very few connections. Zoom into some of the pics, especially the one with the mirrored back, in which I marked some traces, mainly with + for Vcc, - for Ground, C for clock and D for data for the I2S. Port expander has still some unused extensions ;-) ... The first two pic shows IC identifications. The third one I used to follow the PCB traces on front and back. In any graphics editor take a line / dashed double arrow line and move it around to identify the same location on the front and back. I used that technique to follow the traces between the ICs as they go between front and back via the vias.

  • in Interfacing
    Avatar for allObjects

    Interesting post-'mortem': The signal sequence and timing of the initially introduced and ultimately working code is different from what the data sheet says:

    Code:

    1. apply data bits
    2. apply address bits
    3. pull write line down low
    4. pull write line back up high

    Datasheet (see attached diagram):

    1. apply data bits
    2. pull write line down low
    3. apply address bits
    4. pull write line back up high

    If I do as the data sheet say, I get characters doubled... bleeding into the previous address... I have no definite answer for that except that I do not have exactly the Siemens module which obviously does latch the data only on the rising edge...

  • in Interfacing
    Avatar for allObjects

    Here the code for the 4 character / single module setup and the 8 character / double module setup. Since there is no chip select, the neg-write signal line is used to write to the desired module. Siemens datasheet and clip of running text on single module attached.

    // DL1414T_4.js - D SP5-14
    
    // Espruino   DL1414T
    // PICO       D SP5-14
    // --------   --------
    //  1 GND   - GND 7 (black)
    //  3 3.3   - Vcc 6 (red)
    // 13 A0    - D0  8 LSB (green)
    // 14 A1    - D1  9
    // 15 A2    - D2 10
    // 16 A3    - D3 11
    // 17 A4    - D4  2
    // 18 A5    - D5  1
    // 17 A6    - D6 12 MSB
    // 10 B8    - A0  5 (blue)
    // 11 B9    - A1  4
    // 12 A10   - WR- 3
    
    var dPs = [A6,A5,A4,A3,A2,A1,A0] // data pins
      , aPs = [B9,B8] // address pins
      , wP  = A10
      , txt = "    ESPRUINO    "
      , dgs = 4   // digits
      , pos = -1
      , iTm = 250 // ms
      , iId = null
      ;
    
    function setup() {
      [wP].concat(dPs).concat(aPs).forEach(fun­ction(p){
          pinMode(p,"output"); });
      digitalWrite(dPs,0);
      digitalWrite(aPs,0);
      wP.set();
    }
    
    function out(c,a) { // char, address
      digitalWrite(dPs,c); // data bits
      digitalWrite(aPs,a); // addr bits
      wP.reset(); wP.set(); // write- line down and back up again
    }
    
    function dsp() {
      pos = (pos < txt.length - dgs - 1) ? pos+1 : 0;
      // console.log(pos,dgs,txt.substr(pos,dgs))­;
      var i = dgs;
      while (i-- > 0) out(txt.charCodeAt(pos+dgs-i-1),i);
    }
    
    function onInit() {
      setup();
      iId = setInterval(dsp,iTm);
    }
    
    setTimeout(onInit,999); // remove before upload for save()
    

    Double module w/ 8 characters using two (2) write lines:

    // DL1414T_8.js - D SP5-14
    
    // Espruino   DL1414T
    // PICO       D SP5-14
    // --------   --------
    //  1 GND   - GND 7 (black)
    //  3 3.3   - Vcc 6 (red)
    // 13 A0    - D0  8 LSB (green)
    // 14 A1    - D1  9
    // 15 A2    - D2 10
    // 16 A3    - D3 11
    // 17 A4    - D4  2
    // 18 A5    - D5  1
    // 17 A6    - D6 12 MSB
    // 10 B8    - A0  5 (blue)
    // 11 B9    - A1  4
    // 12 A10   - WR- 3 (MD)
    //  9 A8    - WR- 3 (LD)
    
    var dPs = [A6,A5,A4,A3,A2,A1,A0] // data pins
      , aPs = [B9,B8]  // address pins
      , wPs = [A10,A8] // write pins
      , txt = "          ESPRUINO          "
      , dgs = 8   // digits
      , pos = -1
      , iTm = 250 // ms
      , iId = null
      ;
    
    function setup() {
      wPs.concat(dPs).concat(aPs).forEach(func­tion(p){
          pinMode(p,"output"); });
      digitalWrite(dPs,0);
      digitalWrite(aPs,0);
      digitalWrite(wPs,3);
    }
    
    function out(c,a) { // char, address
      digitalWrite(dPs,c); // data bits
      digitalWrite(aPs,a); // addr bits
      digitalWrite(wPs,(a<4)?2:1); // write- down
      digitalWrite(wPs,3); // write- back up
    }
    
    function dsp() {
      pos = (pos < txt.length - dgs - 1) ? pos+1 : 0;
      // console.log(pos,dgs,txt.substr(pos,dgs))­;
      var i = dgs;
      while (i-- > 0) out(txt.charCodeAt(pos+dgs-i-1),i);
    }
    
    function onInit() {
      setup();
      txt = "";
      for (var i=32; i<96; i++) txt+=String.fromCharCode(i);
      txt="        *"+txt+"*        ";
      iId = setInterval(dsp,iTm);
    }
    
    setTimeout(onInit,999); // remove before upload for save()
    
  • in Interfacing
    Avatar for allObjects

    I just like displays... here a DL1414T / D SP5-14 .112" Red, 4-Character 16 Segment Plus Decimal Point Alphanumeric Intelligent (Bubble) Display With Memory / Decoder / Driver (and Character Generator for Space thru Underscore, ASCII 32 thru 96). There exist actually versions that have 5 more segments - totally 22 including decimal point and thousand marker, which also support lower case characters (see DL-3422 - 22 Segment Display, on youtube https://www.youtube.com/watch?v=D2cyZoCa­t_U

    ).

    Checkout the shots and clips. Notice the different brightness caused not just by the camera and ambient light setup but also due to powering the display with 3.3 and 5 Volts.

  • in Electronics
    Avatar for allObjects

    The XPT2046 is the same as the ADS7843. What's making your situation a bit more complicated is that they both use the same SPI bus pin and control which chip is selected by CS1 and CS2 and the available modules do not use the CS1 and CS2 pins. So you have to merge the two modules into one and include the CS# control. The hardware I used expose the bus for each individual chip separately (see conversation about Modular and extensible UI framework and ui elements).

  • in News
    Avatar for allObjects

    Willkommen im Team, Christine! Ausgezeichnete Erweiterung, @Gordon.

Actions