Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:57 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Issue with "DEVICE LCD CMD" and "DEVICE LCD DATA"

Author Message
stef123
Newbie

Joined: 25/09/2024
Location: United Kingdom
Posts: 23
Posted: 11:44pm 03 Nov 2024
Copy link to clipboard 
Print this post

Hi,

i´m trying to implement a custom Charset for my HD44780-Display, but found a problem.

According to my Logic Analyzer, after "DEVICE LCD CMD", issuing "DEVICE LCD DATA", the RS Line is still being held low (CMD), but it has to be high (DATA).

Tested V5.08, aswell V6.00.

My fault, or a bug?

Best regards
Stef
Edited 2024-11-04 09:45 by stef123
 
stef123
Newbie

Joined: 25/09/2024
Location: United Kingdom
Posts: 23
Posted: 03:14am 04 Nov 2024
Copy link to clipboard 
Print this post

Working Solution: External.c, line 2322.

"    LCD_Byte(j, toupper(*cmdline) == 'D', 0);"

to

"    LCD_Byte(j, toupper(*p) == 'A', 0);"

Idk if *cmdline or 'D' was the issue. toupper(*cmdline) =='A' didn´t resolve the problem either. But since i suspect that tupper has to be true (1) in case of "DATA", because it controls eventually the RS Line and 'D' can be found several times in the command string (eg "DEVICE LCD CMD"), i´ve chosen 'A' (=if found, RS=1, if not, RS=0)

Maybe not perfect, but i have not much knowledge about C++ behaviour at all. At least it works.
Edited 2024-11-04 13:15 by stef123
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 896
Posted: 04:53am 04 Nov 2024
Copy link to clipboard 
Print this post

I think the line should be

LCD_Byte(j, toupper(*lcd) == 'D', 0);


lcd is set to point to the first character of DATA or CMD a couple of line above
i.e.

} else if((p = checkstring(lcd, (unsigned char *)"CMD")) || (p = checkstring(lcd, (unsigned char *)"DATA"))) { // send a command or data

Latest F4 Latest H7
 
stef123
Newbie

Joined: 25/09/2024
Location: United Kingdom
Posts: 23
Posted: 01:15pm 04 Nov 2024
Copy link to clipboard 
Print this post

Thanks !

So correct me if i´m wrong - i´m not into C++ programming at all, i do more Assembler and Basic - if you deliver *cmdline to toupper (idk if it contains the entire command string, i think so), you will always run into a toupper-Flag that is set because it finds the "D" of "Device". That would mean that the Flag/RS line would be always high, but that isn´t the case.



But if *cmdline contains the string "LCD" without "DEVICE" , toupper runs into a Flag that is not being set (=RS-Line low) (wrong: Flag=1, RS=High) and doesn´t care about the following "CMD" or "DATA", because it already found the first occurance of "D" in "LCD".

What i don´t understand is why *cmdline wouldn´t work together (better: doesn´t give the correct result) for example with toupper "A", but *p with "A". If "DATA" is the key to set the Flag, toupper would find in  *cmdline the occurance "A" in "Data" which would be flag=1 = RS=1.

Thats the reason why i have chosen "A" (could have been "T" aswell), because "D" occurs in "CMD" aswell in "DATA".

As said, idk the contents of *cmdline.
Edited 2024-11-04 23:37 by stef123
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9101
Posted: 01:27pm 04 Nov 2024
Copy link to clipboard 
Print this post

Please try V6.00.00RC14 and let me know if it works. NB: in RC14 you can use the LCD command without the DEVICE prefix
 
stef123
Newbie

Joined: 25/09/2024
Location: United Kingdom
Posts: 23
Posted: 01:47pm 04 Nov 2024
Copy link to clipboard 
Print this post

Hi Peter,

yup, RC14 works as expected.

Thank you!
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3800
Posted: 01:56pm 04 Nov 2024
Copy link to clipboard 
Print this post

deleted - fixed by Peter et al I think

John
Edited 2024-11-04 23:56 by JohnS
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024