Question about keyboard for cnc build

More
12 Mar 2021 16:46 - 12 Mar 2021 16:51 #201990 by Aciera
Pinout is for serial RS-232, which as far as I remember would live in user-space. If you want to use the 7i73 you would connect that instead of the motorola microcontroller that is used on your board.
Last edit: 12 Mar 2021 16:51 by Aciera.
The following user(s) said Thank You: robertspark

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

More
12 Mar 2021 17:03 #201992 by robertspark
I am going for the RS-232 interface at present and not the 7i73. As I have a load (6x RS-232) comms ports on my PC

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

More
12 Mar 2021 22:01 #202017 by robertspark
Having a close look at the PCB, it has a 2x10 PIN IDC ribbon cable connector that is connected to a DB 25pin ribbon connector.

Most pins are NC (not connected) to anything from the 2x10PIN IDC.

However, pin 2 is connected to RX of a MAX220CPE (PIN 8 [rs232 input])
pin 3 is connected to TX of a MAX220CPE (PIN7 [rs232 output])

pin 2 is also connected to the anode of a diode.
pin 4 (RTS) is connected to the anode of a diode
pin 7 (GND) provides the GND for the microcontroller etc
pin 20 (DTR) is connected to the anode of a diode.

Hence the (+) pulses from RX, RTS and DTR all provide a positive (5V) supply for the keypad / pcb / microcontroller.

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

More
12 Mar 2021 23:36 - 15 Mar 2021 12:10 #202034 by robertspark
Hex codes as extracted this evening.

Note, one hex code is transmitted when a button is depressed and another is transmitted when a button is released.

It is possible to press two buttons and corresponding hex codes are transmitted when the buttons are pressed in sequence, and again when they are released.

Attachments:
Last edit: 15 Mar 2021 12:10 by robertspark.

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

More
13 Mar 2021 01:22 #202050 by andypugh
You could connect the serial port to a Mesa UART. That would keep the data in the realtime layer.

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

More
13 Mar 2021 07:06 #202065 by robertspark

You could connect the serial port to a Mesa UART. That would keep the data in the realtime layer.


that sounds interesting, how would I go about doing that?

I ask because I am using 1x7i76e for a mill, router and plasma cutter all using different profiles, and a 7i92h+7i76 for a lathe. (I had plans for the lathe to use Pathpilot but at the moment I am very happy with Gmoccapy as a front end and NativeCAM, in case someone was wondering why I took an expensive route to a second 7i76e....)

it there a way I could use the keyboard across all machines with different profiles on 1 Mesa UART?

the 7i73 did not seem to have the capability to read an 8x14 matrix keyboard using 22 input pins (they also seem to be on backorder at the moment, which is fine I can wait for the right solution but thought I'd explore whilst waiting)

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

More
13 Mar 2021 07:37 #202067 by robertspark
I have a spare idc port on the 7i92h which is just setup as I/o at present..... (1x7i76 card bit file uploaded) however is it possible to connect to both a 7i76e and 7i92 at the same time?

they both have their own IP addresses and are both on their own ethernet ports as the pc has 2x ethernet ports and 6x rs232 UART ports (all disabled in the bios but I can liven one up as they made no difference to latency), which was plan B....... plan a was to use a usb to rs232 db25M converter as plan A

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

More
14 Mar 2021 00:20 #202174 by andypugh

You could connect the serial port to a Mesa UART. That would keep the data in the realtime layer.


that sounds interesting, how would I go about doing that?

I ask because I am using 1x7i76e


I think that there is probably a firmware that sets up the 7i76E smart-serial port as a UART.

You would then need your Arduino, or similar, to scan the matrix and output scan-codes (key-up and key-down) which would be read by the UART, twiddled by a simple driver .comp and output on a HAL pin for use by sendkeys or matrix_kb.

You are right, by the way, the 7i73 handles a max matrix size of 8 x 8. You could (possibly) handle an 8x14 with _two_ 7i73s, but that gets expensive.
It is getting a bit much for an Arduino, even. You would need to use a Mega to have enough pins.
The following user(s) said Thank You: robertspark

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

More
14 Mar 2021 08:31 #202196 by robertspark
there is also the keywarrior

www.codemercs.com/en/io/28-keywarrior

which provides software to programs each of the inputs

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

More
14 Mar 2021 22:37 - 15 Mar 2021 12:12 #202273 by robertspark
python script to read the keyboard codes and convert to integers {probably better for switch case later}

save as foo.py

and run in terminal as
python foo.py
import serial

ser = serial.Serial(
    port='/dev/ttyS2',\
    baudrate=9600,\
    parity=serial.PARITY_NONE,\
    stopbits=serial.STOPBITS_ONE,\
    bytesize=serial.EIGHTBITS,\
        timeout=0)

while True:
    for line in ser.read():

		print(ord(line) )

ser.close()

(I know little about python.... but am learning slowly)

keyboard codes start bottom LHS as 0x00 (keypress) and 0x80 (release) and
end top RHS as 0x6F (keypress) and 0xEF (release)

.... ie... go from 00 >> 111 for key press (as DEC / INT) and
from128 >>> 239 for release


note: you would need to change your port to whatever you have it plugged in as (I am using good old serial ports, but it is possible to use a USB adapter too)
sudo dmesg | grep tty
Last edit: 15 Mar 2021 12:12 by robertspark.

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

Time to create page: 0.204 seconds
Powered by Kunena Forum