Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Electronic Assembly (eadip204b-4nlw) HELP On setup

Discussion about LCD's and other related hardware

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo, Fast351, hydrolisk1792

Post Reply
vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Electronic Assembly (eadip204b-4nlw) HELP On setup

Post by vcorp »

Hi to all, i have just attached this lcd to my pc
but i get some strange error (sorry for my bad english) :oops:

when i start smarty and set the HD44780
LCD 4x20
Port 378 (currently connected in)
Driver boot delay 1
Timer Multiplier 1

the lcd work but ... don't works

the first 20 line seems to be ok
but for example if i write (on the first line in smarty screen setting):
ABCDEFGHILMNOPQRSTUV

on the display i get:
ABCDEFGHILMNOPQRSTUV
OPQRSTUV


if i write on the second line
ABCDEFGHILMNOPQRSTUV

on the display i get:
EMPTY
EMPTY
ABCDEFGHILMNOPQRSTUV
OPQRSTUV

if i write on the third line
ABCDEFGHILMNOPQRSTUV

on the display i get:
EMPTY
EMPTY ABCDEFGHILMN
EMPTY
EMPTY


for the fourth line:
EMPTY
EMPTY
EMPTY
EMPTY ABCDEFGHILMN

WHAT's Wrong ???
Help me please !!!
Many thanks

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

mmm...

i have checked the wire many many times all ok
i have tried EPP -> ECP -> EPP+ECP the problem is the same!!!

any suggestion???

I'm a delphi developer can i download the source code?

IFR
Plugin Author
Posts: 201
Joined: April 6th, 2005, 12:59 am
Location: Canada
Contact:

Post by IFR »

Yes I had exactly the same problem the first time I used LCSmartie. Just make sure you download the LATEST LCDSmartie version.

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

IFR wrote:Yes I had exactly the same problem the first time I used LCSmartie. Just make sure you download the LATEST LCDSmartie version.
Hi, many thanks for your reply!
I have downloaded the 5.3 and the 5.3.2 version
but the problem is the same!!!

Image
sorry for the bad quality

what can i do ???

CPU in the lcdsmartie setting is in the third line!!!
Image

I'm frustrated...

P.S.
can i add the SSL support in your source code to control gmail on 995 port!!!
or modified are proibited?

ReverseEngineered
Plugin Author
Posts: 192
Joined: January 18th, 2006, 11:09 pm
Location: Saskatoon, Saskatchewan, Canada

Post by ReverseEngineered »

Modifications are great. We were just discussing SSL support in another post. If you decide to modify your own copy, please send the changes to the project and they will be reviewed and (hopefully) added to the regular distribution.

As for your problem, it sounds like either: a) it's not being initialized properly, or b) the internal memory layout isn't entirely standard. As usual, the only thing I can recommend is triple-checking your wiring, including using a multimeter to ensure that you actually are getting the signal at the LCD. Aside from that, any kind of troubleshooting is very difficult to do online.

Do you have a datasheet for your module? A quick check would ensure that it is 100% HD44780 compatiable. Also, since you are a good programmer, you might try writing test programs to send various commands to the LCD and ensure that it responds as expected. In particular, try writing to different memory addresses. If the memory map is non-standard, it would be easy to adapt Smartie's code to handle your memory map.

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

ReverseEngineered wrote:Modifications are great. We were just discussing SSL support in another post. If you decide to modify your own copy, please send the changes to the project and they will be reviewed and (hopefully) added to the regular distribution.

As for your problem, it sounds like either: a) it's not being initialized properly, or b) the internal memory layout isn't entirely standard. As usual, the only thing I can recommend is triple-checking your wiring, including using a multimeter to ensure that you actually are getting the signal at the LCD. Aside from that, any kind of troubleshooting is very difficult to do online.

Do you have a datasheet for your module? A quick check would ensure that it is 100% HD44780 compatiable. Also, since you are a good programmer, you might try writing test programs to send various commands to the LCD and ensure that it responds as expected. In particular, try writing to different memory addresses. If the memory map is non-standard, it would be easy to adapt Smartie's code to handle your memory map.
Ok for applying the modify!!!

This is the pdf of my lcd:
http://www.vcorp.it/downloads/EADIP204B-4NLW.pdf
I have checked the wiring with my multimeter, and all are ok.

I have also triend another prog and the problem is the same!!!
Tomorrow i will try to make my self a little test program.

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

ok i have wtite myself a littl etest program using (zlportio.pas) for fast developing my test program...
:cry: :cry: :cry: :cry: :cry:

Sigh Sigh the problem remain!!!

i'm very very sorry for this inspiegable inconvenient!!!

_X7JAY7X_
Hardware Genie - Plugin Author
Posts: 374
Joined: February 16th, 2005, 10:24 pm
Location: Michigan

Post by _X7JAY7X_ »

Try your lcd on another computer. That will narrow it down to the computer or the lcd or wiring.

J

ReverseEngineered
Plugin Author
Posts: 192
Joined: January 18th, 2006, 11:09 pm
Location: Saskatoon, Saskatchewan, Canada

Post by ReverseEngineered »

I see your display also uses the KS0073 controller, as opposed to the HD44780. As far as I know these are almost compatiable--there are a few things which don't work. I'll look more into this later this evening and let you know what I find out.

ReverseEngineered
Plugin Author
Posts: 192
Joined: January 18th, 2006, 11:09 pm
Location: Saskatoon, Saskatchewan, Canada

Post by ReverseEngineered »

Ahah, sure enough, found the problem immediately. Try Googling for "KS0073 HD44780". One of the first links I found was a post to the "lcdproc" (Linux) forums, which listed the differences:
There are three differences between the KS0073 and the HD44780:
1. It uses a different addressing (hd44780.c)
2. The initialisation differs (hd44780-low.h, hd44780-winamp.c)
3. It uses a different charmap (hd44780-charmap.h)
The biggest problem is the addressing. The memory map of the KS0073 is:
0x00...0x13
0x20...0x33
0x40...0x53
0x60...0x73

However, an HD44780 uses:
0x00..0x13
0x40..0x53
0x14..0x27
0x54..0x67

What happens when you write a location in the memory of the KS0073 that isn't defined above? Hard to say. In your case, you see a replication of characters, which matches other reports I've seen.

The real answer is to write an extra module for LCDSmartie to handle the KS0073. This should be easy, given that it's only a small modification of the HD44780 code. Limbo, perhaps you could look into this?

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

ReverseEngineered wrote:I see your display also uses the KS0073 controller, as opposed to the HD44780. As far as I know these are almost compatiable--there are a few things which don't work. I'll look more into this later this evening and let you know what I find out.
ok many thanks!!! :lol:
I have see in the pdf the 100% HD44780 compatibility
but at this point... i don't know!!! :evil:

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

ReverseEngineered wrote:Ahah, sure enough, found the problem immediately. Try Googling for "KS0073 HD44780". One of the first links I found was a post to the "lcdproc" (Linux) forums, which listed the differences:
There are three differences between the KS0073 and the HD44780:
1. It uses a different addressing (hd44780.c)
2. The initialisation differs (hd44780-low.h, hd44780-winamp.c)
3. It uses a different charmap (hd44780-charmap.h)
The biggest problem is the addressing. The memory map of the KS0073 is:
0x00...0x13
0x20...0x33
0x40...0x53
0x60...0x73

However, an HD44780 uses:
0x00..0x13
0x40..0x53
0x14..0x27
0x54..0x67

What happens when you write a location in the memory of the KS0073 that isn't defined above? Hard to say. In your case, you see a replication of characters, which matches other reports I've seen.

The real answer is to write an extra module for LCDSmartie to handle the KS0073. This should be easy, given that it's only a small modification of the HD44780 code. Limbo, perhaps you could look into this?
Uhm... COOOL, and now ?
i have to change in the source the addressing?
or i have to change the wires ?

ReverseEngineered
Plugin Author
Posts: 192
Joined: January 18th, 2006, 11:09 pm
Location: Saskatoon, Saskatchewan, Canada

Post by ReverseEngineered »

Well, if you just changed the addressing in the code which moves to a certain line, it would work better, but there are other problems too which need to be fixed. The different character map should be okay; I don't think LCDSmartie uses any of the special characters automatically. Initialization will probably cause a problem though. There is a function set command which, for the HD44780, switches between 1 and 2 line displays. 4 line displays basically act like very wide 2 line displays. The KS0073 "fixes" this by having an extended function set command which selects between using the 1/2 of the regular function set, or switching for 4 lines. That's probably why you are getting that weird duplication effect; it's only set for 2 lines at the moment.

So not only will you have to fix the code for moving to a particular position to use the different addresses, you will also have to change the initialization code to send the extra extended function set command and set it to 4 lines.

These are both very simple fixes, but we should add an extra radio button in the configuration screen to select between HD44780 and KS0073 if we want a good solution. I'm busy finishing another project, but I will look into this and see how difficult it will be (I imagine it will be quite simple, but I'm familiar with C, not Delphi).

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

Hi, i have just finish the hard work to adding ssl support!!!

this is what i have make:
-
of corse remove indy and install indy v10.1.5 (not simple for me but ok).
http://www.vcorp.it/downloads/indy10.1.5_d7.exe

-
chek the source and add the right new variable for save / load from ini the new value added. in (UConfig.pas and UData.pas).

########UConfig changes##################
TPopAccount = Record
server: String;
user: String;
pword: String;
port_ssl: String; <----------
end;


function TConfig.loadCCFG: Boolean;
var
initfile: textfile;
x, y: Integer;
configline: String;
configArray: Array[1..101] of String; <------
begin


pop[1].server := copy(configArray[95], 1, pos('?0', configArray[95])-1);
pop[1].user := copy(configArray[96], 1, pos('?0', configArray[96])-1);
pop[1].pword := copy(configArray[97], 1, pos('?0', configArray[97])-1);
pop[1].port_ssl := copy(configArray[101], 1, pos('?0', configArray[101])-1); <-----
etc...


// Pop accounts
for x := 0 to 9 do
begin
sPOPAccount := Format('%.2u', [x], localeFormat);
pop[x].server := initFile.ReadString('POP Accounts', 'Server' + sPOPAccount, '');
pop[x].user := initFile.ReadString('POP Accounts', 'User' + sPOPAccount, '');
pop[x].pword := initFile.ReadString('POP Accounts', 'Password' + sPOPAccount, '');
pop[x].port_ssl := initFile.ReadString('POP Accounts', 'Port_ssl' + sPOPAccount, '');
end; <------

// Pop accounts
for x := 0 to 9 do
begin
sPOPAccount := Format('%.2u', [x], localeFormat);
initFile.WriteString('POP Accounts', 'Server' + sPOPAccount, pop[x].server);
initFile.WriteString('POP Accounts', 'User' + sPOPAccount, '"' + pop[x].user + '"');
initFile.WriteString('POP Accounts', 'Password' + sPOPAccount, '"' + pop[x].pword + '"');
initFile.WriteString('POP Accounts', 'Port_ssl' + sPOPAccount, pop[x].port_ssl);
end; <-----
########END UConfig changes##################

-
increment form 100 to 101 in "UConfig.pas" configarray and add new entry fo ssl

-
add Edit20.tex and ssl label in "USetup.pas/form"

-
add 2 dll for indy10 ver in the same place of exe project:
ssleay32.dll
libeay32.dll
http://www.vcorp.it/downloads/indy_OpenSSL096m.zip

P.S.
with indy10 some little changes for incompatibility are necesary!!!
i have added in uses the ssl component in UData.pas

######UDATA CHANGES########
IdBaseComponent,
IdComponent, IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase,
IdMessageClient, IdPOP3, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack,
IdSSL, IdSSLOpenSSL


// Runs in data thread controllo email
procedure TData.emailUpdate;
var
mailz: Array[0..9] of Integer;
z, y, x: Integer;
screenline: String;
pop3: TIdPOP3;
//aggiunto per controllo ssl INDY v10.1.5
SSLHandler: TIdSSLIOHandlerSocketOpenSSL; <--------
msg: TIdMessage;
myGotEmail: Boolean;
messages: Integer;

begin
.....

if config.pop[y].server <> '' then
begin
pop3 := TIdPOP3.Create(nil);
// controllo ssl by vcorp aggiunto il 25/02/2006
SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
SSLHandler.MaxLineAction := maException;
SSLHandler.Host := config.pop[y].server;
SSLHandler.ConnectTimeout := 30000;
SSLHandler.SSLOptions.Method := sslvSSLv2;
SSLHandler.SSLOptions.Mode := sslmUnassigned;
SSLHandler.SSLOptions.VerifyMode := [];
SSLHandler.SSLOptions.VerifyDepth := 0;

msg := TIdMessage.Create(nil);
pop3.host := config.pop[y].server;
// pop3.MaxLineAction := maSplit;
pop3.ReadTimeout := 15000; //15 seconds
pop3.username := config.pop[y].user;
pop3.Password := config.pop[y].pword;

// controllo ssl by vcorp aggiunto il 25/02/2006
if config.pop[y].port_ssl <> ''
then begin
pop3.IOHandler := SSLHandler;
pop3.UseTLS := utUseImplicitTLS;
pop3.Port := StrToInt(config.pop[y].port_ssl);
SSLHandler.Port := StrToInt(config.pop[y].port_ssl);
SSLHandler.Host := config.pop[y].server;
SSLHandler.Destination := SSLHandler.Host+':'+IntToStr(SSLHandler.Port);
// SSLHandler.StartSSL;
end else
begin
pop3.IOHandler := nil;
pop3.UseTLS := utNoTLSSupport;
pop3.Port := 110;
end;
....

i have change this
// pop3.Connect(30000); // 30 seconds
with this
pop3.ConnectTimeout := 30000;

....


finally
httpCs.Enter();
pop3Copy := nil;
httpCs.Leave();
pop3.Disconnect;
pop3.Free;
SSLHandler.Free; <---------
msg.Free;
end;

--------------------
and just for test when the KS0073 code are ready
make some change in "USetup"

Image

Wow now i can see how mail i have for each account!!!

SORRY FOR MY BAD ENGLISH

jonny
Posts: 48
Joined: December 18th, 2005, 5:50 am

Post by jonny »

That's great vcorp!! Is there any way to get this compiled so we don't have to go through the programming? I would love to use SSL, but I dont have delphi or know how to use delphi.

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

jonny wrote:That's great vcorp!! Is there any way to get this compiled so we don't have to go through the programming? I would love to use SSL, but I dont have delphi or know how to use delphi.
I'm waiting for the latest source code of smartie!
when it are ready i can add and compile the ssl support!!!

for now i have compiled the 5.3 source!


EDIT:take a look here to test the version i have compiled!!!

http://www.lansley.co.uk/forum/phpBB2/v ... php?p=2092

ReverseEngineered
Plugin Author
Posts: 192
Joined: January 18th, 2006, 11:09 pm
Location: Saskatoon, Saskatchewan, Canada

Post by ReverseEngineered »

Well,I have made all of the changes which I think are necessary to support the KS0073 (initialization and addressing, no character map stuff). However, as I fought with Delphi's GUI (I'm not a major fan of it), I think I changed something very important with the OK button of the Setup screen. Hitting OK will apply the changes (since it calls ApplyButton.click()), but it doesn't actually close the screen. I'm not sure if I deleted a line of code by accident or what, because CVS is giving me issues (it wants a "diff" command to use the CVS diff, and I supplied one, but it's command-line only, and I'm having trouble getting TortoiseCVS to run from the command-line, ARG!).

Of course, I've been very busy these last few days and haven't actually given it a fair chance. I'm finally coming up to my two not-as-busy days of the week, so I should be able to figure it all out.

To make my life easier though, is there any way to stop Delphi from halting the program every time an Exception is raised? The RSS plugin is CONSTANTLY throwing "socket error" exceptions and it's very frustrating during debugging. I'm sure I could find it in the Help file, but as I said, I've been very busy.

I should have it in CVS tomorrow (once I fix this button thing), and then vcorp, if you could test it for me, we'll see what needs to be done to get it working before we call it complete.

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

ReverseEngineered wrote:Well,I have made all of the changes which I think are necessary to support the KS0073 (initialization and addressing, no character map stuff). However, as I fought with Delphi's GUI (I'm not a major fan of it), I think I changed something very important with the OK button of the Setup screen. Hitting OK will apply the changes (since it calls ApplyButton.click()), but it doesn't actually close the screen. I'm not sure if I deleted a line of code by accident or what, because CVS is giving me issues (it wants a "diff" command to use the CVS diff, and I supplied one, but it's command-line only, and I'm having trouble getting TortoiseCVS to run from the command-line, ARG!).

Of course, I've been very busy these last few days and haven't actually given it a fair chance. I'm finally coming up to my two not-as-busy days of the week, so I should be able to figure it all out.

To make my life easier though, is there any way to stop Delphi from halting the program every time an Exception is raised? The RSS plugin is CONSTANTLY throwing "socket error" exceptions and it's very frustrating during debugging. I'm sure I could find it in the Help file, but as I said, I've been very busy.

I should have it in CVS tomorrow (once I fix this button thing), and then vcorp, if you could test it for me, we'll see what needs to be done to get it working before we call it complete.
Can u give me the KS0073 code ?

vcorp
Developer
Posts: 52
Joined: February 22nd, 2006, 11:44 am
Location: Dietro di te!
Contact:

Post by vcorp »

Ok i have write for my personal build of LCDSmarty
one new module (ULCD_KS.pas) and added some variables to use it!

I have found the sourcecode of "ks0073output.dll" in VB language
and adapted to delphi!!!

Now, My KS0073 LCD 20x4 Blue, Function Very Well!!!

Post Reply