ARDUINO PROJECT: LCD shield
Posted by kll on February 21 2013 22:56:21
got the chance to play with more goodies,
here the DFRobot (DFR0009) LCD Shield for ARDUINO.





my friend buy it at THAIDUINO for THB568.29
and i want compare it to my SPI LCD from same company.



main difference is it has alread pushbuttons,
has no cable, direct plug on ARDUINO as shield.

after copy library ( LCD4Bit_mod )
to /arduino-0022/libraries/
and load the example LCD4Bit_modExample
it worked.
note: i can see 2 black spots on background / behind LCD / on the backlight?
and the pushbuttons are very hard, not with click, with KNACK.

check on software ( library ) and hardware ( circuit drawing )
used LCD: TC1602

and usage of many ARDUINO pins:
Dout 4
Dout 5
Dout 6
Dout 7 are the 4 bit communication lines
Dout 8 RS
Dout 9 Enable
R/W wired to GND ( library Dout11 not used )
Dout10 backlitcontrol ( not used in library or example but wired )
( its a pwm pin, should test it for tune back light? )
Ain0 from a voltage devider by 5 PB and 5 resistors.
by analyzing this voltage a singlepressed PB can be detected. ( very nice idea!)
a reset button
example software use Dout13 arduino led, blinks on PB,
but is not really visible because of the LCD shield.
a poti to adjust the contrast.

facit:
so, if you want to use that shield as a add on
OPERATOR PANEL
to your ARDUINO project, there is only
D2, D3, A1 .. A5 as I/O for your project left.


and in the mechanic dimensions
i also see a problem in using that shield
the poti it wrong type, too high for any housing,


the PB's are too low for a housing unless you would be able to build a housing
with plastic keys ( operating that low PB's)

also the header pins are little bit to short, the ext Vin plug of ARDUINO
hits some pushbutton soldering,
but the area above the USB plug is free and it would not cause shorts.

i wanted to test if a menu structure on a 2 line LCD is possible,
and ended up with
-- a menu 3 times 3 lines ( and a menue header line for LCD line 1)
-- with menutexts in FLASH to save SRAM
-- with single job and conti job structure
-- with a integer setpoint indication and [select]
used for the backlight adjustment by Dout10 PWM dimmer
-- and sinusramp for setpoint show ( as PWM dimmer and LCD integer indication )


for the indication of a integer i had to go a very long way,
would be good to see a smarter version, pls try

MENU concept
the 2 line LCD show in line 1 a menu headerline,
in line 2 a menu entry line,
by PB UP / DOWN this menu entry line is scrolled
( prepared 1 of 3 )

by PB right the menu entry is selected
and come to submenu or job call.

by PB left go up in menu structure

PB select ( very left PB ) is not used in menu operation
only in setpoint input example


the multitasking job structure, like used for the setpoint ramp
is prepared for all menu entries.
so, each menu entry ends in a submenu or finally in a job call.
( job 11,12,13; 21,22,23; 31,32,33; are prepared )
each job has 3 sections:
-- show on LCD a JOB start screen
-- a code section for you to be executed only that one time the job is selected by menu
-- a conti job bit setting, if TRUE a other code section is enabled.
-- in the conti job code section you can use code what should be executed
repetitive ( in its own timeslice)
pls do not use DELAY(msec); in that section,
how often that conti job is executed can be adjusted by a
loopcounter limit for each conti job.

as the jobs are ( mostly ) empty
and only the setpoint sinus ( as basic conti job )
and the PB check runs,
the program can do 1.000.000 cycles in 2min20.
without the PB check need only 11sec.
that big difference is because of the analog read for the PB.
in 0.2 version the PB check run with a lower priority.
only every 2000 loops, about 40 times per second.
the whole program needs now about 12 s/Mcycles

here all the code V 0.2 incl. library