LCD GPIOs
31 Mar 2016 09:46 #72447
by Laendle
Hi there,
I’m not sure if this the right place or best way to post my question. Can someone help me with the LCD function of Linuxcnc. So far I understand that the function is written for the MESA 7i73. My plan is to use LCD this with my beagle bone black running with Machinekit (so basically Linuxcnc) installed on. I still have a couple of GPIO which I like to hook up with an LCD screen for a mpg pendant. My problem now is the pin definition for the LCD command, I found out so far the PINouts are defined by e.g. net lcd-out => hm2_5i25.0.7i73.0.1.display32 for a MESA 5i25 and 7i73 combination, but I could not find out how I can define single pins without hostmot2 for the RS, E,D4, D5,D6, and D7 pins I need to run a generic LCD display. Is that even possible? Is there another way to define a LCD display with GPIOs in the hal file?
Thanks for your help.
I’m not sure if this the right place or best way to post my question. Can someone help me with the LCD function of Linuxcnc. So far I understand that the function is written for the MESA 7i73. My plan is to use LCD this with my beagle bone black running with Machinekit (so basically Linuxcnc) installed on. I still have a couple of GPIO which I like to hook up with an LCD screen for a mpg pendant. My problem now is the pin definition for the LCD command, I found out so far the PINouts are defined by e.g. net lcd-out => hm2_5i25.0.7i73.0.1.display32 for a MESA 5i25 and 7i73 combination, but I could not find out how I can define single pins without hostmot2 for the RS, E,D4, D5,D6, and D7 pins I need to run a generic LCD display. Is that even possible? Is there another way to define a LCD display with GPIOs in the hal file?
Thanks for your help.
Please Log in or Create an account to join the conversation.
31 Mar 2016 11:18 #72451
by andypugh
The "lcd" HAL component supplies a byte-stream for the 7i73 LCD driver. The 7i73 itself splits that data into 4-bit lumps and twiddles the clock lines. The function of the component is really just text formatting.
It would, in theory, be possible to modify the lcd component to provide RS. E, D4 etc pin drives directly, or a separate HAL component (probably running in a faster thread) could be written to do the job.
Looking at the code: github.com/LinuxCNC/linuxcnc/blob/master...omponents/lcd.c#L258
I think that the former option might not be very much work. Currently the characters are put into a buffer and output one by one. To drive bits directly that if / write / return would have to check the operating mode (7i73 or raw GPIO) and send the 4-bit data and twiddle the clock directly, only incrementing the c_ptr every 4th(?) time through. I would need to look at the low-level implementation of the LCD screens to be sure.
It would, in theory, be possible to modify the lcd component to provide RS. E, D4 etc pin drives directly, or a separate HAL component (probably running in a faster thread) could be written to do the job.
Looking at the code: github.com/LinuxCNC/linuxcnc/blob/master...omponents/lcd.c#L258
I think that the former option might not be very much work. Currently the characters are put into a buffer and output one by one. To drive bits directly that if / write / return would have to check the operating mode (7i73 or raw GPIO) and send the 4-bit data and twiddle the clock directly, only incrementing the c_ptr every 4th(?) time through. I would need to look at the low-level implementation of the LCD screens to be sure.
Please Log in or Create an account to join the conversation.
31 Mar 2016 13:39 #72466
by andypugh
*inst->out is a pointer to the HAL pin in shared memory..
I couldn’t even figure out where in the code, the byte-stream is sent to the 7i73 LCD driver....
*inst->out = inst->buff[inst->c_ptr++];
*inst->out is a pointer to the HAL pin in shared memory..
Please Log in or Create an account to join the conversation.
Time to create page: 0.193 seconds