Timing issues with the LCD EB005
Moderator: Benj
Timing issues with the LCD EB005
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?
- 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
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Timing issues with the LCD EB005
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?
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?
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Timing issues with the LCD EB005
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
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