Feedback required about LCDs people use or have known

30 vues
Accéder directement au premier message non lu

Paul Carpenter

non lue,
10 févr. 2016, 10:44:3310/02/2016
à Developers

Currently I have a pull request on github for improvements to LiquidCrystal library to reduce its blocking nature.
See https://github.com/arduino/Arduino/pull/4550

Currently it waits by blocking for 100 us after every write (4 or 8 bit), instead of checking when it last wrote and delaying for up to 100 us. What I  have termed as Write Delay in pull request. This does NOT affect other long timings for initialisation and the like as they have extra delays elsewhere.

By changing the method and reducing the write delay to 80 us I have seen up  to 33% speed improvement, in other words a  print of 20 characters blocks for 33% LESS time.

Now comes the crunch the HD44780 has a base delay for writes of >37 us, I would prefer to update pull request to set the write delay time to 40 us. However I do not have a wide selection of LCDs here so does anyone have experience and  pointers to datasheets for LCDs with longer than 40 us write delays.

Currently an 8 bit mode setcursor then print 20 chars to LCD takes 2.67 ms, my new  method drops this to 1.70 ms.

Dropping the write delay to 40 us reduces the 20 character print further to 892 us (less than 1 ms). See below for scope screenshot tested on a Due and Mega
Obviously 4 bit mode is longer but has noticeable time savings of similar ratios.

This sort of improvement will help 3D printers and other such applications with continuous LCD update and no doubt multiple tasks running.

So anyone know of any displays that will fail with shorter write delay of 40 us?


Gabriel Staples

non lue,
11 févr. 2016, 14:06:2411/02/2016
à devel...@arduino.cc

Why don't you just make the delay time an input parameter? setDelayTime ()--in case LCDs do exist where this is bad.

Sincerely,

Gabriel Staples
www.ElectricRCAircraftGuy.com

(sent from my Android)

--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.

Andrew Kroll

non lue,
11 févr. 2016, 14:07:5111/02/2016
à devel...@arduino.cc

Finally someone with a great idea, and their head properly perched on their shoulders! Settings are always a great option.

Paul Carpenter

non lue,
11 févr. 2016, 14:49:4811/02/2016
à Developers
Was trying to avoid extending the API but good suggestion

Currently the fix when tested on Due and Mega greatly reduces time to write especially for 4 bit mode as found a bug there as well

I will add a method to set delay between minimum and probably 200 micro seconds to avoid silly values being set


On Thursday, 11 February 2016 19:06:24 UTC, Gabriel Staples wrote:

Why don't you just make the delay time an input parameter? setDelayTime ()--in case LCDs do exist where this is bad.

Sincerely,

Gabriel Staples
www.ElectricRCAircraftGuy.com

(sent from my Android)

Paul Carpenter

non lue,
11 févr. 2016, 16:09:0111/02/2016
à Developers
Personally customisation of library defaults for this and things like serial buffer sizes would be better performed by a custom.h include file in sketch directory that was included by IDE before Arduino.h for building library, which seems to be every compile time.


On Thursday, 11 February 2016 19:07:51 UTC, Andrew Kroll wrote:

Finally someone with a great idea, and their head properly perched on their shoulders! Settings are always a great option.

On Feb 11, 2016 2:06 PM, "Gabriel Staples" <panth...@gmail.com> wrote:

Why don't you just make the delay time an input parameter? setDelayTime ()--in case LCDs do exist where this is bad.

Sincerely,

Gabriel Staples

Álvaro Lopes

non lue,
11 févr. 2016, 16:15:5711/02/2016
à devel...@arduino.cc,Paul Carpenter
I'm using a similar approach with ZPUino, which is to have "Arduino.h" to include a "config.h" file, for which an empty version is provided in the hardware folder.

Placing your own "config.h" in the sketch directory will effect your sketch immediatly (due to implicit "Arduino.h" inclusion), as well as most libraries, since
they also do include the main Arduino header early in the preprocessing path.

Just set up the include path properly (compiler rules) to ensure your sketchdir comes in first.

Alvie

On 11/02/16 21:09, Paul Carpenter wrote:
> Personally customisation of library defaults for this and things like serial buffer sizes would be better performed by a custom.h include file in sketch
> directory that was included by IDE before Arduino.h for building library, which seems to be every compile time.
>
> On Thursday, 11 February 2016 19:07:51 UTC, Andrew Kroll wrote:
>
> Finally someone with a great idea, and their head properly perched on their shoulders! Settings are always a great option.
>
> On Feb 11, 2016 2:06 PM, "Gabriel Staples" <panth...@gmail.com <javascript:>> wrote:
>
> Why don't you just make the delay time an input parameter? setDelayTime ()--in case LCDs do exist where this is bad.
>
> Sincerely,
>
> Gabriel Staples
> send an email to developers+...@arduino.cc <javascript:>.
>
> --
> You received this message because you are subscribed to the Google Groups "Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc <mailto:developers+...@arduino.cc>.

Andrew Kroll

non lue,
11 févr. 2016, 18:59:5511/02/2016
à devel...@arduino.cc

UHS 3.0 just uses all inline code in headers, instead of c/c++, and thus becomes part of the sketch. All I do is define setting at the top, then #include, and the rest just happens.
That's how I managed to solve config issues.

To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.

Paul Carpenter

non lue,
11 févr. 2016, 19:04:1111/02/2016
à devel...@arduino.cc
Like over-riding Arduino Serial buffer size so 4 ports get set up with

0 128/128
1 512/512
2 512/0
3 0/0

Andrew Kroll wrote:
> UHS 3.0 just uses all inline code in headers, instead of c/c++, and thus
> becomes part of the sketch. All I do is define setting at the top, then
> #include, and the rest just happens.
> That's how I managed to solve config issues.
>
> On Feb 11, 2016 4:15 PM, "Álvaro Lopes" <alvi...@alvie.com
> <mailto:alvi...@alvie.com>> wrote:
>
> I'm using a similar approach with ZPUino, which is to have
> "Arduino.h" to include a "config.h" file, for which an empty version
> is provided in the hardware folder.
>
> Placing your own "config.h" in the sketch directory will effect your
> sketch immediatly (due to implicit "Arduino.h" inclusion), as well
> as most libraries, since
> they also do include the main Arduino header early in the
> preprocessing path.
>
> Just set up the include path properly (compiler rules) to ensure
> your sketchdir comes in first.
>
> Alvie
>
> On 11/02/16 21:09, Paul Carpenter wrote:
> > Personally customisation of library defaults for this and things
> like serial buffer sizes would be better performed by a custom.h
> include file in sketch
> > directory that was included by IDE before Arduino.h for building
> library, which seems to be every compile time.
> >
> > On Thursday, 11 February 2016 19:07:51 UTC, Andrew Kroll wrote:
> >
> > Finally someone with a great idea, and their head properly
> perched on their shoulders! Settings are always a great option.
> >
> > On Feb 11, 2016 2:06 PM, "Gabriel Staples"
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message