LCDproc development and user support list

Text archives Help


[Lcdproc] Some help with multiple heartbeat characters


Chronological Thread 
  • From: zv at ziva-vatra.com (ZV)
  • Subject: [Lcdproc] Some help with multiple heartbeat characters
  • Date: Wed, 6 Apr 2016 21:31:29 +0100

On 06/04/16 20:51, Ethan Dicks wrote:
> On Wed, Apr 6, 2016 at 2:37 PM, ZV <zv at ziva-vatra.com> wrote:
>> Hey All,
>>
>> I am in the process of writing an implementation of the pic-an-lcd
>> protocol for the Arduino (https://github.com/ZivaVatra/ArduLCD), and
>> have been testing with lcdproc.
>
> Wow... that's reaching back.
>
> I wrote the original pic-an-lcd driver, many, many years ago. I still
> have my hardware but I admit I haven't plugged it in in a long time
> (not since serial ports started disappearing from computers).

Heh, I never used it before, as there was always an abundance of
parallel ports on my machines. However now with parallel ports vanishing
as well, the only port I have is USB, and the Arduino appears as a
serial port to the PC, so seemed like the easiest thing to implement in
order to get something working.

Plus pic-an-lcd being so old, I figured most mainstream lcd software
should have support for it, and the bugs should be ironed out by now. If
I wrote my own interface I would have to write, debug and maintain a
driver for lcdproc too.


>
>> I have got a version working, however I seem to have the heartbeat
>> appearing multiple times. I don't think it is corruption because the
>> heartbeat glyph is always alternating with other full blocks, and there
>> are no other out of place characters, or
>> garbage on the display. This only happens on bar graphs, and places
>> where I would expect there to be full blocks.
>
> I don't know how well you know the HD44780, so please excuse me if I
> go over something that you already know.
>
> First, if this is with vbars, this is not unexpected behavior. If
> it's with hbars, then that's not expected.

It seems to happen with both. I will send you some pictures of it.

>
> There are 8 user-definable chars in the HD44780 (and compatible
> clones). Heartbeat uses one of them (0x07), and the bargraphs and
> bignums use a bunch. In particular, you can't have heartbeat and
> bignums or heartbeat and vbars at the same time because the HD44780
> doesn't have enough soft chars to do both at the same time
> (p->cellwidth is 5, p->cellheight is 8, so hbars use soft chars 0-4
> and vbars use soft chars 0-7, leaving none left for the heartbeat).
>
>> If I disable heartbeat, I get just the static hearts, however if I
>> enable heartbeat all the hearts beat in unison
>
> That's because the server code isn't changing the character value at
> the X,Y location of "the heartbeat" in "screen RAM" (it stays 0x07),
> it's updating the "character RAM" for a specific character (0x07) and
> anywhere that character happens to be on the X,Y display, the pixel
> rendering hardware in the HD44780 "updates" all of the "hearts"
> simultaneously.

Quite an elegant solution. Explains why I see the multiple heart beats
as well.

>
> Look at what HD44780_hbar() and HD44780_vbar() and HD44780_icon() are all
> doing.
>
> -ethan
>
> P.S. - after staring at code, it also looks like you shouldn't be able
> to have heartbeats on screen when using vbars, so perhaps something
> else is going on.
>

Yeah, it is really odd. I thought that perhaps there is an error in the
transfer of the custom characters to the HD44780's RAM, however the
driver for lcdproc does not use any of the advanced features of
pic-an-lcd. Based on what I can see, it just uses the escape codes for
"direct write" and "direct commend".

Essentially my Arduino code is acting as a serial to parallel
translator. I even have a tree called "lcdproc-only" which strips the
code down to the bare minimum to work with the lcdproc driver (in order
to make sure it isn't some other code interaction going on), and I still
get the misplaced hearts. I admit I may well be missing something, just
not sure what yet....









Archive powered by MHonArc 2.6.18.

Top of page