Getting display working for SN80

Posted on
  • I guess this is really for @fanoush, but I'll welcome any input.

    I've flashed Espruino to an SN80 (nrf52832, DaFit, 240x240 round ST7899). The pinouts are identical to the P8, so I used a prebuilt P8 (fanoush's espruino_2v08.5_p8_SDK12_SD30_SPIFLASH.z­ip) I used ATC's init code, replacing the default in the ST7789 Espruino module. I'm getting odd results. In the video, I start at reset(), then load the driver (sets up SPI, runs the init) then draw "Espruino" after 2 secs, then a white rectangle (full screen) after 2 seconds. you can see the draws happening, but everything is a vertical line. And more, in the still picture, you can see what happens after a minute, the screen dims in a doughnut shape! I have the ST7789V datasheet, so I'm prepared to do some homework, but any direction would be greatly appeciated!

    (I checked in with ATC and he doesn't remember what he did exactly... there are two versions of the hardware so he's not sure if he's mixed them up. I also tried his code in ATCwatch and get the same result).

    thanks to anyone for any help!

  • Those from the USA will (should) get this with all the nonsense going on. Comment on video:

    As our politicians would like you to believe, 'Everything is fine and you are content with what you have'

    I couldn't help myself after viewing the video @yngv126399 I feel you pain after investing all the hours you have.

    'I guess this is really for fanoush, but I'll welcome any input.'   holds true

  • The circular dimming thing looks a lot like the LCD itself is not updating the screen.

    That could be a configuration thing, but it's also possible that in the hardware there's a specific pin which provides power to the LCD driver. If that wasn't enabled then maybe the LCD is powered parasitically from the IO pins, which would give it some power but maybe not enough to update the screen correctly?

  • work great as a sundial! So, sure... it's "fine!"

  • init commands are here­d5d5b7986c8848a823914599
    original code­d62a5be1b56ee3e48e35264d
    if these do not work then you are out of luck. You can guess but without having original firmware matching your watch chances are low.

  • That's what I tried (both Arduino & Espruino) with similar results. I was hoping the effect may have been something that looked familiar to you, to help me look in the right spot. I was assuming that this code WAS from the original firmware, but ATC mentioned he wasn't certain as there are two versions of the watch.

    It was a long shot... thanks anyway.

    @Gordon Thank you for that input.. that makes sense. I've tried toggling all the undocumented pins with no luck; it may be a setting in the init as well.

    If I get it, I'll share.

  • Thank you @Robin! I've only invested a little time so far, as I assumed that sample code I had would work! I have Espruino running fine: buzzer and button work (probably touch panel and accel too!) since it's a pinout identical to P8! So close....

    The real work now begins... digesting the nuances of the ST7789.

  • 'Thank you @Robin! I've only invested a little time so far, I assumed that sample code I had would work!'

    While I won't let the thanks of gratitude inflate my ego, shouldn't the credit go to fanoush instead?

    P.S. the sundial response was a hoot!!

  • I'll gladly thank @fanoush for all his work in this project, and have many times. I wear his code on my wrist every day (currently an F07)! I was thanking YOU @Robin for your empathy in my situation. I am currently chatting with ATC1441 to see if anything can be done further, or if I simply have a $35 beacon now. It's difficult to get this far and have to give up.

    And a very huge THANK YOU to @Gordon and all other contributors here... I haven't had this much fun in tech in a long time (yes, a bit of pain and frustration too... all part of the process).

    @Gordon, have you had anyone else express desire for a ROUND watch Espruino (I mean truly round, not Bangle 1: square in a round frame)? I could (easily) be in the minority, but having a more dressy Espruino has appeal. Just curious...

  • Yes, there definitely has been some interest in a circular watch. In fact I've got someone (annoyingly I can't say who) that's shipping thousands of proper round watches running Espruino.

    It does mean that you've got to rewrite pretty much all your apps though, and IMO maybe it makes more sense on nRF52840 hardware where you can have an offscreen buffer so can do some more fancy things.

  • In fact I've got someone (annoyingly I can't say who) that's shipping thousands of proper round watches running Espruino

    wait... what? I guess something related to a NDA? Would a regular person be able to purchase such watch if he ever found out who is selling them?

  • Umm, well, if you you check board files or git history , there is one board file with gc9a01 controller.

  • You reverse engineered @Gordon's remark! Brilliant!! That board looks VERY interesting indeed. It's resisting my attempts to Google more info though... and we don't want to get Gordon in any trouble, so I'll shut up now. But intriguing....

  • Yes, it will be available to buy - although maybe only in a year's time as it releases alongside something else... And sadly, yes - NDA.

    Hopefully I'll actually be able to say more nearer the time

  • Well I'm looking forward to that! Glad to hear it won't be secret for long...

    Another Q... this SN80 is an interesting beast; it seems to be nearly identical to the P8s in the wild (same pinouts, samed shared SPI for display / ext flash). I'm using @jeffmer 's code for the shared SPI (basically his P8 build untouched except for the name), and I'm getting an SPI error during display initialization.

    Uncaught InternalError: Timeout on SPI0-lock
     at line 19 col 28
                spi.write(c, ce);
    in function "cmd" called from line 32 col 9
    cmd(0x11); //SLPOUT
    in function called from system

    When I was running the firmware without shared SPI (no ext flash) I didn't get this. I assumed that this code would be safe regardless if it's shared or not (it errs on the side of caution by pausing the other device). My impression is that this is saying "SPI is in use or not ready". Am i interpreting that correctly? (BTW: the external flash works, I'm able to save files and read them back.. but this started as soon as I began working with both display AND spi flash).

    Any insights or thoughts welcome...

  • Are you using the command function built into my version of lcd_spi_unbuf
    as in var cmd = lcd_spi_unbuf.command? If you are using SPI write directly as it looks like you might be you would get this error. Another thing to try is to not set double buffering on in the board file.

  • that is likely it... thank you. I'll try shortly, but that sounds right. I'm glad it's me being absent minded and not something really wrong with the watch!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Getting display working for SN80

Posted by Avatar for yngv126399 @yngv126399