Avatar for jeffmer

jeffmer

Member since Apr 2020 • Last active Aug 2022
  • 10 conversations
  • 131 comments

Most recent activity

  • in Bangle.js
    Avatar for jeffmer

    The firmware referenced above should work on the PineTime, however, I have not tried it. There are some pin out differences which you can find listed by @atc1441 here https://github.com/atc1441/ATCwatch/blob­/master/ATCwatch/pinout.h. These can easily be dealt with by editing the Espruino device driver modules. There are quite a few different versions of the P8 with different accelerometers which can again be dealt with in Espruino code.

    There are I think some posts from @fanoush on this topic (or comments on his Github repository).

  • in Projects
    Avatar for jeffmer

    Having a lot of fun with this. The latest version implements RDS and stores an unlimited number of station presets. The code is a lot simpler than the Arduino equivalent.

    https://youtu.be/Yk6XuBNn9mA

  • in Projects
    Avatar for jeffmer

    Yes, some of those options might help, however, the code below proved the simplest most reliable driver.

    
    function createEncoder(pinA,pinB){
      pinMode(pinA,"input_pullup");
      pinMode(pinB,"input_pullup"); 
      var a0=pinA.read(), c0=pinB.read(), incr0 =0, second=false;
      var OBJ = {};
    
     function handler () {
       var a = pinA.read();
       var b = pinB.read();
       if (a != a0) {              // A changed
         a0 = a;
         if (b != c0) {
           c0 = b;
           var incr = (a == b)?-1:1;
           if (incr!=incr0 || !second) OBJ.emit("change",incr);
           incr0=incr; second = !second;
         }
       }
     }
     setWatch(handler,pinA,{repeat:true,edge:­"both"});
     return OBJ;
    }
    
    
  • in Projects
    Avatar for jeffmer

    These all-band (FM,LW,MW,SW with SSB) radios (see picture below) are available on AliExpress and Ebay. They consist of an SI4732-A10 chip which provides the radio functions driven via I2C by an ESP32 WROOM module which implements the display interface. This is an ILI9341 (with XPT2046 touch ) 320x240 pixel display.

    There is an extensive well documented Arduino library for the SI4732 and a sketch which implements the firmware running on the pictured radio. The firmware can easily be updated from Arduino via the USB-C port at the rear of the radio. However, the combined library and sketch is over 10,000 lines of C++ which makes it cumbersome to change so I had a go at an Espruino version. So far I have implemented the FM only radio shown in the video:

    https://youtu.be/1rce91vy35w

    There were a few technical challenges in getting this to work. Firstly, the display and touch controller share the SPI bus and while the screen SPI runs at 20MHz, touch only works with SPI at around 2MHz so you have to re setup SPI each time there is a touch interrupt. This generates a new SPI reference which needs to be passed back to the lcd_spi_unbuf driver. I implemented a simple additional function in this driver to pass back the SPI reference.
    @Gordon have you met this issue before with the ILI9431 and XPT2046? - it's a very common display.

    Secondly, the rotary controller does two increments every click which is not ideal and the module in the Espruino library seems to generate a lot of spurious increments. I implemented a new driver based on an elegant idea outlined here.

    Lastly, the rotary controller knob press switch is connected to D33 which cannot be used in setWatch in the current ESP32 Espruino. Indeed it did not work as a digital input at all so I implemented a simple polled routine which used analogRead to detect the press event.

    I plan to extend the implementation with LW, MW and SW with SSB - the current Espruino S/W and Firmware can be found here.

  • in Porting to new Devices
    Avatar for jeffmer

    The “p undefined” means that there is no graphics instance. Boot creates a dummy one which is overridden when you load “main”. As @fanoush mentioned if the lcd driver is not in the firmware then that would explain the error.

  • in Bangle.js
    Avatar for jeffmer

    I think its fine if you want to synchronise with the iPhone once a day, however, at the moment, as it seems to involve disconnection/reconnection, it would not be advisable to do it at a much greater frequency.

  • in Porting to new Devices
    Avatar for jeffmer

    The driver is a mixture of lcd_spi_unbuf and lcd_spilcd. You can send a minimum of 4 pixels to the screen which is why you need a buffer although there may be the possibility of reading pixels directly from the screen framebuffer. Using 32MHz SPI, I think the absolute maximum for writing 454 x 454 8 bit pixels would be 50ms, so 75 ms is not bad. The driver code needs cleaned up w.r.t comments/generality etc but you can see it here.

  • in Porting to new Devices
    Avatar for jeffmer

    There is now a port of Espruino to this NRF52840 watch which has a 454x454 AMOLED display. The watch can be operated in an always on mode in which the display takes approx 4ma with about 20% of pixels lit and 50-60% of full brightness. The G5 has a 290maH battery.

    The current screen driver stores 4-bits per pixel (103Kbyte framebuffer) and takes around 75ms to do a full screen update with the screen set to 8 bits per pixel. The pictures below do not do justice to the display which is very sharp and bright.

    It is necessary to open the watch to flash Espruino via SWD pins. Fortunately, it is not too difficult to open as the back is held on by four screws - however it is also glued and needs to be heat softened.

    The G5 port is a team effort involving @fanoush and @yngv126399 with credit to atc1441 for discovering the watch and critical information like the location of the SWD pins.

Actions