lcd.c show different characters

More
12 Apr 2018 10:00 #108872 by fupeama
Hi,
I try to make cnc pendant with LCD on stm32f407 through sserial protokol.
Everything is ok, sserial, keyboard, encoder, LED etc, but lcd show different characters.
Normal text is ok, but I need to show percents.

I send characters from LINUXCNC by lcd (Stream HAL data to an LCD screen) to STM, but there is something strange.
I try LCNC 2.8.0 pre1 (cca 1.1.2018) absolutly not usable. than I find This link and upgrade LCNC to last update.
Now it is better. but not ok.
I try old LCNC 2.7.12. There is another problem.


example:
loadrt lcd fmt_strings="A\nA\n\2A\n%%A\n\25A\n"
and here is output from LCNC lcd
2.8.0-pre1		2.7.12			
					
				
					
27		24			
61		30			
32					
32					
65		65		A	
24		24		CAN	
10		10		LF	
13		13		CR	
65		65		A	
24		24		CAN	
10		10		LF	
13		13		CR	
42		0		*	\2A
		10		LF	
		13		CR	
24		24		CAN	
10		10		LF	
13		13		CR	
37		37		%	%%
10		10		LF	
13		13		CR	
65		65		A	
24		24		CAN	
10		10		LF	
13		13		CR	
37		0		%	\25
		10		LF	
		13		CR	
65		65		A	
24		24		CAN	
10		10		LF	
13		13		CR	
2.8.0-pre1 output is
27 61 32 32 65 (header)
ESC = space space A and then is ok
2.7.12 output
24 30 65
CAN RS A . It is ok, but body is strange. see table. %% is send as 37 10 13 and \25 (% by hex code) send 0 10 13

What should the correct output look like?
I try quotation marks and double quotation marks because manual say
loadrt lcd fmt_strings=""Plain Text %4.4f\nAnd So on|Second Page, Next Inst"" without succes.

Thanks Martin
excuse my english
Attachments:

Please Log in or Create an account to join the conversation.

More
13 Apr 2018 06:43 #108932 by fupeama
Today I try another experiment.
Easy string "ABC\nabc\n"
there are differences between uspace and rtai. both LCNC 2.8.0-pre1


Linux cnc 3.4-9-rtai-686-pae #1 SMP PREEMPT Debian 3.4.55-4linuxcnc i686 GNU/Linux



Linux cnc 3.2.0-5-rt-686-pae #1 SMP PREEMPT RT Debian 3.2.96-3 i686 GNU/Linux




I need uspace for my 7i76e and compile with
./configure --with-realtime=uspace
Martin
Attachments:

Please Log in or Create an account to join the conversation.

More
24 Apr 2018 11:40 #109541 by andypugh
Where does the STM32 fit into this system?
The lcd HAL component is rather aimed at the Mesa 7i73 and that emulates an old serial terminal.

Please Log in or Create an account to join the conversation.

More
24 Apr 2018 13:40 #109544 by fupeama
Nowhere.
I wrote support for sserial, ili9341, encoder keypad, leds etc for stm32f407 and now I play with this.
I want to make pendant and panel connected on sserial. But I have different output from lcd on 2.7.x and 2.8.x
you wrote forum.linuxcnc.org/27-driver-boards/3385...ows-rubisch?start=30 this
The LCD HAL component just outputs the format string one character at a time every 1mS. When it gets to the end of the format string it sends a control sequence and starts again.
if (inst->f_ptr > inst->pages[*inst->page_num].length){
        *inst->out = 0x18; // clear line
        inst->buff[0] = 0x1E; // home
        inst->buff[1] = 0; //end
        inst->c_ptr = 0;
        inst->f_ptr = 0;
        inst->a_ptr = 0;
        return;
    }
it looks like this part sends diferent characters in 2.7.x and 2.8.x.
in 2.8.x is this
if (inst->f_ptr >= inst->pages[*inst->page_num].length){
        *inst->out = 0x1B; // ESC
        inst->buff[0] = 0x3D; // =
        inst->buff[1] = 0x20; // Line 0
        inst->buff[2] = 0x20; // Column 0
        inst->buff[3] = 0; // end
        inst->c_ptr = 0;
        inst->f_ptr = 0;
        inst->a_ptr = 0;
        return;
}

M

Please Log in or Create an account to join the conversation.

More
24 Apr 2018 14:38 #109546 by andypugh
Yes, I found that moving to line 0 column 0 was more reliable than the single-byte home command.
But this was a potentially incompatible change, so went into the development version rather than the main release.

The behaviour _should_ be the same.

There is an existing smart-serial component for STM32 which is part of the STMBL servo driver, by the way.

Please Log in or Create an account to join the conversation.

More
26 Apr 2018 13:04 #109652 by fupeama
HI,
thanks for reply.
I know stmbl, I found this, but a few days after I spent a lot of time analyzing comunication 7i76e-7i73 with Logic analyzer. and reading documentation for 7i73 :cheer:
Is there somewhere firmware for 7i73 in readable format?
I change single-byte home command to line 0 column 0 in my code and now is all ok.

Thanks Martin

PS: I found another inconsistency in the documentation.....
lcd is connected to 7i73 in LCD MODE
manual says
(For a literal % use "%%")
\NN inserts the character defined by the hexadecimal code NN.
asci for % is 0x25
this is pic of fmt_string "Line=%5d%% abc\nproc\25"

and this is for fmt_string "Line=%5d\25 abc\nproc\25"

I have lcd 16x4 not 20x4, but I think it does not matter.
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Apr 2018 14:02 #109654 by andypugh
github.com/LinuxCNC/linuxcnc/blob/2.7/sr...omponents/lcd.c#L344
calls
github.com/LinuxCNC/linuxcnc/blob/2.7/sr...omponents/lcd.c#L389
So it looks like it ought to work. I will have a play around.

\% would probably have made more sense.

Please Log in or Create an account to join the conversation.

Time to create page: 0.385 seconds
Powered by Kunena Forum