Getting display working for SN80 #6858
Replies: 1 comment
-
Posted at 2021-11-02 by Robin 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.
Posted at 2021-11-02 by @gfwilliams 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? Posted at 2021-11-02 by yngv126399 work great as a sundial! So, sure... it's "fine!" Posted at 2021-11-02 by @fanoush init commands are here Posted at 2021-11-02 by yngv126399 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. @gfwilliams 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. Posted at 2021-11-02 by yngv126399 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. Posted at 2021-11-03 by Robin
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!! Posted at 2021-11-03 by yngv126399 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 @gfwilliams 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). @gfwilliams, 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... Posted at 2021-11-04 by @gfwilliams 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. Posted at 2021-11-04 by Raik
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? Posted at 2021-11-04 by @fanoush Umm, well, if you you check board files or git history , there is one board file with gc9a01 controller. Posted at 2021-11-04 by yngv126399 You reverse engineered @gfwilliams'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.... Posted at 2021-11-15 by @gfwilliams 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 Posted at 2021-11-25 by yngv126399 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.
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... Posted at 2021-11-25 by jeffmer Are you using the command function built into my version of Posted at 2021-11-25 by yngv126399 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! Posted at 2021-12-14 by yngv126399 @jeffmer Thanks, that was it of course... however I'm running into some more weirdness now.. I have a test pattern I'm writing to screen (bitmap font, vector font, lines, filled/unfilled shapes and an image. When I use the JS-only method to drive the display, everything displays, albeit very slowly. Posted at 2021-12-14 by yngv126399 Pure JS:
lcd_spi_unbuf version:
Posted at 2021-12-15 by jeffmer lcd_spi_unbuf implements both a setPixel and a fillRect function. From what you describe, it is the setPixel that is not working correctly. I would suggest that if you have double buffering set in the BOARD file you try unsetting it and vice-versa as only setPixel makes use of double buffering. Posted at 2021-12-15 by yngv126399 well, it's definitely the setPixel f().. I wrote a super simple one (chunk-less) and the screen now displays fine. No idea why the chunk_buffer is not working for me (it works on this code base with the P8). I'll investigate further, for now, I have a working screen. Thanks to all! Posted at 2021-12-29 by jeffmer @yngv126399 I got hold of an SN80 recently to play with circular displays and I have now fixed the lcd_spi_unbuf driver. The problem was that for some reason, no pixels are displayed if the address window you set up is not completely filled. This means that double buffering does not work, so I have fixed the problem for single buffering - just remove the -DLCD_SPI_DOUBLEBUF=1 declaration in the board file. I have left a firmware build with the revised driver here . I have got most of the P8 bangle emulation environment to run on the SN80 including accelerometer, touch screen and heart rate sensor- see picture below. I have made the widgets moveable, so you can specify the location of the widget panel. The clock face above moves the panel top or bottom to minimse it being obscure by the hour hand. The only remaining problem is the physical button which should be on D13 or D17, however, I have tried these and other unallocated pins with no success. I would be interested to know if you have got the button to work as I suspect that I may have a hardware fault. I am currently using long touch to replace the button - which works OK. Posted at 2021-12-29 by yngv126399 That's great! I actually am running with my own driver for the moment... not as good, but for setPixel, I just set the color and go.. I don't buffer even the one line; so it's slower but I got it to work. I tried taking out double buffering but it didn't work for me... but I'll try your version for sure. As for the button, I did get it to work.. According to atc1441's notes, btn1 is D9, and that works as long as you pull D17 high. I'm sure there's a less hacky way, but I defined two buttons, the second one being D17, and pull it high:
Posted at 2021-12-30 by jeffmer Thanks - that's about the only pin combination that I did not try:-( I have updated the firmware in the WatchApps repository with your BTN1 hack. Really like the SN80 as it has a nice bright large screen - the 1.3 inch spec for the lcd is deceptive as it is equivalent to a 1.8 inch square lcd. Posted at 2021-12-30 by yngv126399 It really is a nice screen isn't it? and yes, much bigger looking than its spec. I just bought another SN80 recently, with DaFit firmware from AE, and just ran through the full process:
I used my own driver set for now, but all works perfectly. Nice work, @jeffmer! A caution for anyone wanting to get an SN80 though.. my "new" one has a slightly misaligned LCD ( a vertical line from 12:00 to 6:00 is tilted a few degrees). Nothing tragic, but unfortunate as analog watches won't align to the tick marks on the bezel! Could be selling off QA rejections? Posted at 2022-01-03 by jeffmer More traditional watch faces look great on the SN80. Here are some new ones. @yngv126399 I started on the SN80 using a version of your LCD driver and I noticed that it uses a lot of memory. I think the problem is that the memory used for the initialisation data Posted at 2022-01-03 by yngv126399 Fantastic job on the faces! Agreed that the display is not the speediest and a reminder to anyone wanting more speed to look into @fanoush's work for the P8 to have a buffered solution (with fewer colours perhaps, but capable of refreshing a sweeping second hand). And thank you for pushing the driver forward.. it was just to get it off the ground and I haven't put more time into it since. Glad you freed up the memory (BTW: what are you using to profile the driver? I'm really not well versed in optimization, and I really need to be!) and cleaned up those timeouts. I think I'll just grab your baseline from here.. Posted at 2022-01-03 by jeffmer I simply invoke A sweeping second hand would need to update the screen every 166ms and use a screen buffer as you say to avoid excessive flicker. I tried it as an experiment using a full screen 2 bit image buffer and it took 300ms for each update. It might work with @fanoush 's buffered driver.... Posted at 2022-01-06 by yngv126399 Maybe 'sweeping' was a poor choice... just a second hand would do. (Perhaps an 52840 could handle the former?...) what I've noticed is that the YFit firmware (for the SN80-Y) has a few watch faces with a second hand that updates pretty darn well -- likely uses an optimized algorithm to determine what part of the screen to update. Posted at 2022-01-06 by jeffmer The red hand on the watch faces in the pictures are second hands which the NRF52832 handles fine with barely noticeable flicker. The problem with faster than one second is that the flicker caused by unbuffered update becomes very obvious which is why you need buffering. I tried it on the ROCK and because it has the double buffered |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-11-02 by yngv126399
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.zip) 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!
Beta Was this translation helpful? Give feedback.
All reactions