Timing issues with the LCD EB005

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Electron
Posts: 18
Joined: Wed Apr 20, 2011 10:05 am
Has thanked: 4 times

Timing issues with the LCD EB005

Post by Electron »

I'm trying to write data to the EB005 LCD board within a tight time window of 10mS. The data sheet for the EB005 quotes 'Cursor Shift' & 'Write Data to Ram' execution times as 39uS and 43uS, but I'm finding it takes 2.2mS for a cursor shift and 1.3mS for a write data (for 3 characters, it gets longer for more characters). A 'Clear Display' takes 7mS (data sheet says 1.53mS). Is there something in the Flowcode coding that lengthens the time taken. If so, is there a way around this, to speed things up?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Timing issues with the LCD EB005

Post by Benj »

Hello,

Yes there are additional delays in the Flowcode component. You can select the LCD component on the panel and then click the custom code button to edit the functions.

In the Cursor function you could try removing this line.
Wdt_Delay_Ms(2);

You can remove a line by commenting it out using two / characters and this way its nice and easy to pop back in if it breaks anything.
//Wdt_Delay_Ms(2);

The clear function also has similar delays.

The send data function uses the %s_DELAY delay which is defined in the definitions macro. You could try lowering the delay and see if this helps to speed up outputting data.

#ifdef _BOOSTC
#define %s_DELAY delay_10us(10)
#endif

eg

#ifdef _BOOSTC
#define %s_DELAY delay_us(50) //Half of original delay
#endif

Electron
Posts: 18
Joined: Wed Apr 20, 2011 10:05 am
Has thanked: 4 times

Re: Timing issues with the LCD EB005

Post by Electron »

Thanks for the speedy reply Benj. I will try your suggestions later. A couple of questions:

1. Does both 'print number' & 'print string' use the 'send data function', so if I amend

#ifdef _BOOSTC
#define %s_DELAY delay_10us(10)
#endif

in the definitions macro, does that affect writing numbers and strings?

2. If I amend the custom codes of the LCD for one project, does that affect the LCD properties for future use, or will I get the default settings again?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Timing issues with the LCD EB005

Post by Benj »

Hello,

1) Yes both strings and numbers will be effected by this change.

2) New projects will have the original default settings but you can export your customized component via the main custom code window and then import the customizations when you have a program which needs your updated faster routines.

Electron
Posts: 18
Joined: Wed Apr 20, 2011 10:05 am
Has thanked: 4 times

Re: Timing issues with the LCD EB005

Post by Electron »

That worked a treat!

I only had issues with the LCD if I set '#define %s_DELAY delay_us' down to (10). I'll leave it a (50), and with that setting and taking out the 'Wdt_Delay_Ms(2)' I can position the cursor & write a whole line of 20 characters/numbers in about 5mS.

Cheers :D

Post Reply