Discussion group dedicated to the Philips LPC2000 family of ARM MCUs
LPC2148 Olimex 2x16 LCD Code - Jason - Oct 19 21:04:18 2009
Hey guys i will be trying to help out and post code snippets now and then. Here is my code
for controlling a 2x16 LCD, 4-Bit mode using a LPC2148:
http://atomsofttech.info/code/LCD.rar
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: LPC2148 Olimex 2x16 LCD Code - redwire85 - Oct 19 21:56:15 2009
Not bad. Why don't you set up your delay to be a timer instead of for loop? So I give
you a B+. :)
--- In l...@yahoogroups.com, "Jason"
wrote:
>
> Hey guys i will be trying to help out and post code snippets now and then. Here is my
code for controlling a 2x16 LCD, 4-Bit mode using a LPC2148:
>
> http://atomsofttech.info/code/LCD.rar
>
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )Re: LPC2148 Olimex 2x16 LCD Code - Jason - Oct 20 6:33:52 2009
heh, will do! I just moved some PIC code i made to ARM. I Will create the code for timer
delays later on today.
--- In l...@yahoogroups.com, "redwire85"
wrote:
>
> Not bad. Why don't you set up your delay to be a timer instead of for loop? So I give
you a B+. :)
>
> --- In l...@yahoogroups.com, "Jason" wrote:
> >
> > Hey guys i will be trying to help out and post code snippets now and then. Here is my
code for controlling a 2x16 LCD, 4-Bit mode using a LPC2148:
> >
> > http://atomsofttech.info/code/LCD.rar
>
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )Re: Re: LPC2148 Olimex 2x16 LCD Code - Mukund Deshmukh - Oct 21 0:47:25 2009
> Not bad. Why don't you set up your delay to be a timer instead of for
> loop? So I give you a B+. :)
B+ is not Good. I too prefer loop delay, when micro has little to do in
between. And more over LCD delay are mostly a few microsecs only.
Warm Regards,
Mukund Deshmukh,
Beta Computronics Pvt Ltd,
10/1 IT Park, Parsodi,
Nagpur -440022.
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: Re: LPC2148 Olimex 2x16 LCD Code - Peter Vidler - Oct 21 3:53:14 2009
On 21 Oct 2009, at 05:19, Mukund Deshmukh wrote:
> B+ is not Good. I too prefer loop delay, when micro has little to do
> in
> between. And more over LCD delay are mostly a few microsecs only.
Do you work alone, by any chance? Trying to debug the kind of random
error you get when you change clock frequencies or compiler settings
with spinning delays is a nightmare. Especially when you weren't
aware of the loop!
It also needlessly complicates porting to a different architecture,
requiring a whole new set of measurements to be made. Even something
as trivial as a new point-release of the compiler will probably screw
up your code.
Pete
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: Re: LPC2148 Olimex 2x16 LCD Code - Mukund Deshmukh - Oct 21 5:39:17 2009
> Do you work alone, by any chance?
You guessed it right!!
> error you get when you change clock frequencies or compiler settings
> with spinning delays is a nightmare. Especially when you weren't
> aware of the loop!
Changing frequency will screw up timers too.
>
> It also needlessly complicates porting to a different architecture,
> requiring a whole new set of measurements to be made. Even something
> as trivial as a new point-release of the compiler will probably screw
> up your code.
My refrence was to character LCD code only and Larger delays definately
need timers.
Warm Regards,
Mukund Deshmukh,
Beta Computronics Pvt Ltd,
10/1 IT Park, Parsodi,
Nagpur -440022.
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.
(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: Re: LPC2148 Olimex 2x16 LCD Code - GB - Oct 21 9:10:15 2009
And most people create timers just to spin-wait on the result! I see this
on ADC's too! If you're not going away to do something else -- then coming
back later -- using a timer is a waste. In any event, you can service
interrupts during the LCD delay. My preferred method is generally to write
to a virtual LCD buffer and then send that to the LCD as a low priority
task.
GB
>> Not bad. Why don't you set up your delay to be a timer instead of for
>> loop? So I give you a B+. :)
>
> B+ is not Good. I too prefer loop delay, when micro has little to do in
> between. And more over LCD delay are mostly a few microsecs only.
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: LPC2148 Olimex 2x16 LCD Code - Jason - Oct 21 19:01:31 2009
Thanks to all for the comments. I do feel like the loops are easiest to do but timers are
more accurate and as stated on can accomplish something while they wait. But also like
someone else said... if im not doing anything while waiting then why use a timer. So my
answer is... no timer for me :D
Ill be sure to use a timer for something else once i fully learn it all.. (well as much as
i can.)
I am a hobbyist. I do this for fun and learning and self awareness of electronics.
I plan on creating a full home automation system one day. When i move from my current
residence :D
ARM will definitely be my choice. .. . once i start making my own boards tho :D
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: LPC2148 Olimex 2x16 LCD Code - cfbsoftware1 - Oct 21 19:34:38 2009
--- In l...@yahoogroups.com, "Jason"
wrote:
> But also like someone else said... if im
> not doing anything while waiting then why use a timer. So my answer
> is... no timer for me :D
>
The greatest danger of NOT using a timer when implementing delays with most C development
systems is that optimisation settings are volatile. They can often be changed without even
changing the source code! It is not just a case of accuracy - your delay could be
optimised away to nothing without you realising it.
> Ill be sure to use a timer for something else once i fully learn it all.. (well as much
as i can.)
>
That's OK, but think twice about any examples that you publish before you have some
confidence that you have 'fully learnt it'. There is always more than one way of doing
things and rarely is one way clearly the best. A good approach is to implement a solution
to a problem in three different ways and then identify the advantages and disadvantages of
each.
--
Chris Burrows
CFB Software
Armaide: LPC2xxx Oberon-07 Development System
http://www.cfbsoftware.com/armaide
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )