PDA

View Full Version : [PATCH]: LCD clock in screensaver mode


bob.smith
2007-12-19, 11:54
Hi Guys, (spiff, jmarshall, et al),

I've been testing a patch (1843674: "Display an LCD clock in screensaver mode" raised: 2007-12-03) that was uploaded to sourceforge in response to a feature request i made (1672386 "LCD Clock" raised 2007-03-02).

I have tested the patch, against revision 10969 and posted my results on youtube http://www.youtube.com/watch?v=Nb3Zjon8nnA

you can also see earlier testing clips there too.

Can any of you guys with an LCD try it out, I know GeminServer has an LCD from previous contrast shenanigans.

Also what is the formal process for having a patch applied to CVS?


Many thanks,

BOB.SMITH aka HSIBOY

jmarshall
2007-12-20, 02:31
Basically it requires one of us taking time out of other stuff we're doing to review and add the patch.

I notice a bit of discussion on LCD type(s)? Is that an issue we have to worry about at all, or is the patch likely to work as-is for all LCD types?

Cheers,
Jonathan

Jezz_X
2007-12-20, 03:12
hehe looks trendy

bob.smith
2007-12-20, 12:51
Hi Jonathan,

between xtinus and myself we have tested it with SmartXX LT OPX, Smartxx V3 and Executer3 modchip, both on a HD44780 LCD and a EA-DIP24 (KS0073), so we have covered the main types of display driver, and as you can see from the extensive tracker comments (there isn't any defect management for patches on sourceforge) and video clips on youtube (search for xbmc clock) xtinus had to make some changes. There was also an anonymous tracker comment that said it was working, i would like that verified.

Obviously there will be people with a VFD and that has not been tested.

But software testing is about minimising the risk, and i believe the risk to XBMC to be low, but ultimately the call to apply the patch to the head is yours.

It is a cool feature though, give it a try.

BOB.SMITH

bob.smith
2007-12-28, 13:05
Anyone else had chance to check this patch out yet?

Ive tested it again last night on an X3 with the whole X-LCD front panel thing, it worked great on there.

BOB.SMITH

bob.smith
2007-12-30, 00:52
Thanks to jmarshall for adding the patch to SVN (rev 11117.)

BOB.SMITH

tinux
2008-01-07, 12:28
Hi,

I didn't have the time to response, due to the holidays and another project I'm currently working on, but thanks jmarshall for putting it into xbmc, and thanks bob.smith (hsiboy) for thoroughly testing over and over again :)
It was nice co-working (hope that is a valid verb) with you.

I will definately be back when I have enough time and inspiration to pick-up something new.

Cheers,

xtinus / tinux (author)

djdafreund
2008-01-12, 06:24
I'm really liking the added LCD screensaver time clock. But i wondered, if not already possible, is it possible to change the clock to be a little easier to read? Currently, the characters used to make it up are a little hard to read. Or is it just because the way it needs to be done to work?

bob.smith
2008-01-13, 19:24
Hi Dj,

xtinus borrowed the fonts from the LCDsmartie project. On my display its pretty readable from where i sit, but up close its less readable because the digits are split across the rows and columns of the display.

which config are you using, and what display and modchip have you got??

BOB.SMITH

annell
2008-01-15, 00:21
Itīs look very nice! Were can i download this program?

djdafreund
2008-01-15, 01:15
Thanks for responding. I am using an xbox 1.4 with 500gig drive, x3 chip and x3 lcd blue display. Not a whole amount of space in between charactors, it just looks harder to read because some of the digits don't quite look right, even for only using a few lines.

bob.smith
2008-01-19, 12:27
Hi djdafreund,

could you post a photo somewhere so we can see?

If i get chance later today, i'll take some hi res photos of my display here, but you can see it quite clearly on the videos i posted on youtube.

thank you,

with X3 and Smartxx being the most popular choice with LCD we need to make sure its right.

BOB.SMITH

bob.smith
2008-01-19, 12:31
Itīs look very nice! Were can i download this program?

annell this is available in the current t3ch release of XBMC this google link will help you on your way:

http://www.google.co.uk/search?hl=en&q=tech+binary+xbmc+release

BOB.SMITH

tinux
2008-01-26, 00:27
For the people who are interested in how the display works:
the HD44780 (compatible) displays only have room for 8 custom characters. To build 10 digits varying from 2 to 12 characters each, you have to be creative in some way.

As the original feature requester mentioned, LCDsmartie was a good example, and I have to admit: they did a pretty good job on that: simple, yet effective.

That's the reason why the clock looks like it does.

If there is someone creative enough to do a better job: I'll be delighted to implement that :)

Tinux.

(by the way: the clock code is fairly straightforwarded, but it uses several arrays, so a novice might get intimidated by the codes used)

Reab4
2008-01-29, 11:48
Hi,

I updated the XBMC recently and from a distance (3.5m) I thought there was an display (Xecuter3, blue display) error so I stood up and walked towards it and only then noticed the new feature.
Somewhere in 1996 during my highly-creative period I wrote code for a DCF77 clock, using a 16x4 or a 20x4 HD44780 display, driven by a 8051 controller. It shows the date in text and a rotating half-circle (125ms update). The half circle is the re-programmed 8-character CGRAM.
It also shows a big-time, which spans all 4 lines (yours spans 2 lines) and 16 characters wide. To do this, the half-rotating circle CGRAM is re-programmed.
One big-number-digit spans 4 lines and is 3 characters wide. I think between the 2 digits of the hour and the two of the minutes I displayed 2 small digits of the seconds.
It has been quite a while since I wrote the code and looking back it looks quite n00bish (no pointers), but hey it worked.
When I get home, I'll see if I can make some pictures of what it looks like.
Anyway, the data below should be helpful, at least for doing some experiments.

const char cgram_char[7][64] =
{{0x00, 0x0E, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, /* 0 rotating half */
0x00, 0x0E, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, /* circle */
0x00, 0x06, 0x07, 0x07, 0x07, 0x06, 0x00, 0x00,
0x00, 0x00, 0x03, 0x07, 0x0F, 0x0E, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1F, 0x1F, 0x0E, 0x00, 0x00,
0x00, 0x00, 0x18, 0x1C, 0x1E, 0x0E, 0x00, 0x00,
0x00, 0x0C, 0x1C, 0x1C, 0x1C, 0x0C, 0x00, 0x00,
0x00, 0x0E, 0x1E, 0x1C, 0x18, 0x00, 0x00, 0x00},

{0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, /* 1 all thick */
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, /* rounded corners */
0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x00,
0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x00,
0x1C, 0x1E, 0x1F, 0x1F, 0x0F, 0x0F, 0x0F, 0x00,
0x0F, 0x0F, 0x0F, 0x1F, 0x1F, 0x1E, 0x1C, 0x00,
0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x0F, 0x07, 0x00,
0x07, 0x0F, 0x1F, 0x1F, 0x1E, 0x1E, 0x1E, 0x00},

{0x1F, 0x1F, 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C,
0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1F, 0x0F, 0x07,
0x07, 0x0F, 0x1F, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C},

{0x1E, 0x01, 0x01, 0x09, 0x09, 0x09, 0x09, 0x1E, /* init characters, D */
0x0E, 0x01, 0x00, 0x10, 0x10, 0x10, 0x11, 0x0E, /* 5 C */
0x1F, 0x00, 0x00, 0x1E, 0x10, 0x10, 0x10, 0x10, /* F */
0x1F, 0x00, 0x00, 0x02, 0x02, 0x04, 0x04, 0x04, /* 7 */
0x00, 0x0E, 0x15, 0x17, 0x11, 0x0E, 0x00, 0x00, /* clock */
0x0F, 0x0F, 0x0F, 0x1F, 0x1F, 0x1E, 0x1C, 0x00, /* */
0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x0F, 0x07, 0x00, /* */
0x07, 0x0F, 0x1F, 0x1F, 0x1E, 0x1E, 0x1E, 0x00}, /* */

{0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, /* 6 inverted */
0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* */
0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x07, 0x03, 0x03,
0x03, 0x03, 0x07, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
0x18, 0x18, 0x1C, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1C, 0x18, 0x18}};


/*----------------------------------------------------------------------*/
const char bignumber[2][11][12]=
{{{0x07, 0x00, 0x04, 0x03, 0x20, 0x01, 0x03, 0x20, 0x01, 0x06, 0x02, 0x05},
{0x20, 0x04, 0x20, 0x20, 0x01, 0x20, 0x20, 0x01, 0x20, 0x20, 0x01, 0x20},
{0x00, 0x00, 0x04, 0x02, 0x02, 0x05, 0x03, 0x20, 0x20, 0x06, 0x02, 0x02},
{0x00, 0x00, 0x04, 0x20, 0x02, 0x05, 0x20, 0x20, 0x01, 0x02, 0x02, 0x05},
{0x03, 0x20, 0x01, 0x06, 0x02, 0x05, 0x20, 0x20, 0x01, 0x20, 0x20, 0x01},
{0x07, 0x00, 0x00, 0x06, 0x02, 0x02, 0x20, 0x20, 0x01, 0x02, 0x02, 0x05},
{0x07, 0x00, 0x00, 0x06, 0x02, 0x02, 0x03, 0x20, 0x01, 0x06, 0x02, 0x05},
{0x00, 0x00, 0x04, 0x20, 0x20, 0x01, 0x20, 0x20, 0x01, 0x20, 0x20, 0x01},
{0x07, 0x00, 0x04, 0x06, 0x02, 0x05, 0x03, 0x20, 0x01, 0x06, 0x02, 0x05},
{0x07, 0x00, 0x04, 0x06, 0x02, 0x05, 0x20, 0x20, 0x01, 0x02, 0x02, 0x05},
{0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20}},

{{0x07, 0x00, 0x04, 0x03, 0xFF, 0x01, 0x03, 0xFF, 0x01, 0x06, 0x02, 0x05},
{0xFF, 0x07, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0x06, 0xFF},
{0x07, 0x00, 0x04, 0x07, 0x00, 0x01, 0x03, 0xFF, 0xFF, 0x06, 0x02, 0x05},
{0x07, 0x00, 0x04, 0xFF, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x06, 0x02, 0x05},
{0x07, 0xFF, 0x04, 0x03, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0x05},
{0x07, 0x00, 0x04, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x01, 0x06, 0x02, 0x05},
{0x07, 0x00, 0x04, 0x03, 0x00, 0x04, 0x03, 0xFF, 0x01, 0x06, 0x02, 0x05},
{0x07, 0x00, 0x04, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0x05},
{0x07, 0x00, 0x04, 0x03, 0x00, 0x01, 0x03, 0xFF, 0x01, 0x06, 0x02, 0x05},
{0x07, 0x00, 0x04, 0x03, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x06, 0x02, 0x05},
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}};

/*----------------------------------------------------------------------*/
const char bigcharposition[12]={0,1,2,20,21,22,40,41,42,60,61,62};
/* based on a 20x4 display */


//

bob.smith
2008-01-29, 19:33
Cheers for this Reab4.

The clock can display across 4 lines as well as two lines, for anyone who has an LCD and wants to use this feature:

if your display is an KS0073 you can alter the default address for the display lines by adding a file 'AdvancedSettings.xml' in the
XBMC 'UserData\' directory and define some of the lcd properties:

AdvancedSettings.xml:

<lcd>
<rows>4</rows> # Number of rows to use for the LCD.
<columns>20</columns> # Number of columns to use for the LCD.
<address1>0</address1> # Memory address for row 1.
<address2>20</address2> # Memory address for row 2.
<address3>64</address3> # Memory address for row 3.
<address4>84</address4> # Memory address for row 4.
</lcd>

I found that without that lines 2 & 3 were swapped.


You can use the following $INFO[ ] labels to define the clock:

LCD.Time21 and LCD.Time22 for small 1x2 sized chars

<screensaver>
<line>$INFO[LCD.Time21]</line>
<line>$INFO[LCD.Time22]</line>
<line>$INFO[System.CurrentWindow]</line>
<line>Freemem: $INFO[System.FreeMemory]</line>
</screensaver>

LCD.TimeWide21 and LCD.TimeWide22 for medium 2x2 chars

<screensaver>
<line>$INFO[System.CurrentWindow]</line>
<line>$INFO[LCD.TimeWide21]</line>
<line>$INFO[LCD.TimeWide22]</line>
<line>Freemem: $INFO[System.FreeMemory]</line>
</screensaver>

LCD.Time41, LCD.Time42, LCD.Time43 and LCD.Time44 for large 3x4 chars

<screensaver>
<line>$INFO[LCD.Time41]</line>
<line>$INFO[LCD.Time42]</line>
<line>$INFO[LCD.Time43]</line>
<line>$INFO[LCD.Time44]</line>
</screensaver>

xtinus has some photos of the clocks here

http://www.matrixnet.ath.cx/mad/?page_id=23

BOB.SMITH

Reab4
2008-01-29, 19:52
As promised some (rather dark) photos.
http://85.146.213.173/homepage/_downloads/fotos/DCFclock/
http://85.146.213.173/homepage/_downloads/fotos/DCFclock/Date_Text.jpg
http://85.146.213.173/homepage/_downloads/fotos/DCFclock/Time_Big.jpg
http://85.146.213.173/homepage/_downloads/fotos/DCFclock/Time_Big_Inverted.jpg

djdafreund
2008-01-30, 07:45
Mine looks like the 2x2 currently, but a little worse. After looking at the pictures of 1x2 and 3x4, i'm now torn between which one. They both look decent on my box. One is 4 lines, easiest from a distance, one still is legible but with 2 lines showing (in my case Weather/Temp and Freemem). Wow, hard choice, both look great!!! Thanks for that big time!!!

djdafreund
2008-01-30, 08:01
I must be missing something, i added this in my AdvanceSettings.xml file, but it still shows default stuff when screensaver kicks in. What am i missing? I know correctly how to change info shown in general and in music/video playing, i got that working, but this isn't working for some reason.

<screensaver>
<line>$INFO[System.CurrentWindow]</line>
<line>$INFO[LCD.Time21]</line>
<line>$INFO[LCD.Time22]</line>
<line>$INFO[Weather.Conditions]</line>
</screensaver>

bob.smith
2008-01-30, 17:00
I must be missing something, i added this in my AdvanceSettings.xml file, but it still shows default stuff when screensaver kicks in. What am i missing? I know correctly how to change info shown in general and in music/video playing, i got that working, but this isn't working for some reason.

<screensaver>
<line>$INFO[System.CurrentWindow]</line>
<line>$INFO[LCD.Time21]</line>
<line>$INFO[LCD.Time22]</line>
<line>$INFO[Weather.Conditions]</line>
</screensaver>

ah, sorry djdafreund, my bad, i should have been clearer. You only need to edit AdvanceSettings.xml if you have switched lines with your display.

All of the lcd settings (this clock included) are held in

/userdata/LCD.xml

since Revision 11117 it has contained the default:

<screensaver>
<line>$INFO[System.CurrentWindow]</line>
<line>$INFO[LCD.TimeWide21]</line>
<line>$INFO[LCD.TimeWide22]</line>
<line>Freemem: $INFO[System.FreeMemory]</line>
</screensaver>

sorry for the confusion,

BOB.SMITH

bob.smith
2008-01-30, 17:04
As promised some (rather dark) photos.
http://85.146.213.173/homepage/_downloads/fotos/DCFclock/
http://85.146.213.173/homepage/_downloads/fotos/DCFclock/Date_Text.jpg
http://85.146.213.173/homepage/_downloads/fotos/DCFclock/Time_Big.jpg
http://85.146.213.173/homepage/_downloads/fotos/DCFclock/Time_Big_Inverted.jpg

Hi Reab4,

that is a nice font, with rounded corners.

It would be fairly easy to port your font across i think, just not sure about the seconds count.

HSIBOY

djdafreund
2008-01-31, 03:50
Gotcha, thanks for that tidbit. Works now. I ended choosing default actually for the style of clock info. I'd like to mess around with some font styles to see about a better looking 2 line still. I'll post anything of results if i find something better. Thanks a bunch for adding this. Very nice!!

Reab4
2008-02-01, 10:57
I think if you do the seconds in big-numbers it will be too crowded.
Anyway I would leave it out altogether - I noticed the seconds update
on the X3 LCD has a timing problem, which looks like the seconds update
doesn't come exactly every second.
The other fonts might also be of interest, although I don't have an example
picture of what it would look like in real life. They are a thinner and squarer
variant.