Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help with PIC and Circuit

Status
Not open for further replies.

gth629e

New Member
Hello Again Everyone,

First of all thanks a ton to all of you who have help me so far, I am learning a ton.

So here is what I need to do.

I would like to use a PIC to emulate keyboard key presses. Like sending ASCII strings to the pc. I would like to interface this to the computer via the ps/2 port.

The programs that will be using this need to believe the codes are coming from the keyboard or it will get angry lol. So the keyboard just needs to pass though.

The power source would of course be the 5 volt rail from the ps2 port.

Here are my requirements:

1. I need at least 20 I/O ports

2. I need to be able to program multi-key combos on one I/O (ex Ctrl-a or Alt-j)

3. I need key presses to be repeating (like an arrow key or joystick)

4. Preferable be able to program LED's but this is not a must.

5. I would prefer to be able to reprogram the PIC but again this is not necessary

6. Cost of the PIC needs to be less than $30.00 for this to still be feasable



SO here is what I am asking and be fore I continue, I would gladly pay someone if you would be willing to help me with the circuit. Or I own several CNC machines so if you need control panels etc cut, just let me know.

Also, I will be have my own PCB boards produced so there is no limitation there.


1. Is this possible?

2. How complicated would this be?

3. What parts would I need to insure no damage to the PC ps/2 port?

4. How would you interface the I/O's to the PIC etc.?

5. Which PIC would you recomend if this would work?


I know there are pre-made encoders out there such as keywiz and and the ultimarc I-pac etc.

However, I do not want to have to arrange the I/O's in any sort of matrix because then key ghosting becomes and issue. Like the Keywiz.

The I-pac boards look like a simple pic with some resistors and diodes and is reprogram amble, but I think I could go cheaper than $30.00 since I will have my own PCB anyway.


THANKS for all you help and I eagerly await you responses.

You may contact me here, respond to thread, or directly at


I forgot to mention that I do have experience programing in BASIC so if there is a pic that could use BASIC programing that would be a plus.
 
Last edited:
The Ultimarc controller which does everything I want or more really than I need looks like this.

**broken link removed**

The chip it uses is the Cypress CY7C63413C, the link takes you to the data sheet.

**broken link removed**

Again, I don't have to use this chip, any PIC that will work I'll use. I was just throwing it out there, by the way, it only cost $3.00 usd so thats good.

Thanks!!

Below is an up close pic of the I-PAC2 encoder board with that chip installed.
 

Attachments

  • ipac2_top.jpg
    ipac2_top.jpg
    82.4 KB · Views: 214
That was my plan but I am trying to get my production costs down. Keep in mind I will be making at least 100 and probably more.

It doesn't seem that is would be that hard to just program a PIC to do the same thing.

If I use the Ipac I have a few problems. First it would not fit in the case hand held case with the rest of the electronics so I would have to put it at the pc end. So I would need another box enclosure.

That would then require at least a 21 conductor cable between the hand held box and the box containing the ipac board.

Also there is no way to professionally mount the board so the the PS/2 ports are clean and flush against the case.

There are other issues as well that I can get around if need be but because of the added parts and time it would take to setup it really pushes towards using a PIC mounted directly on the PCB in the hand held device.

Not to mention IPAC does not allow there boards to be using in any device that will be redistributed.

Thanks though, I agree and thats what got me started in this whole thing was finding the IPAC lol. However, I know it could be done with a PIC I just don't know how to go about doing it.


I forgot to mention that I will have to have a PCB board made regardless. The handheld device will contain a joystick and many tactile type switches that must be attached to a board for stability.
 
I just confirmed with the software developer that is is possible to use USB interface with a new upcoming update.

So that means that I could use USB directly if and would not need a pass through for the keyboard. The code would still need to be ASCII so that is would just appear as a USB keyboard.

That might make things easier.
 
Some comments.

Neither USB nor PS/2 keyboards send ASCII. PS/2 keyboards send make-break codes, also known as scan codes. The scan codes can be multi-byte. If I recall correctly, USB keyboards send a packet of key codes of all keys being depressed. They send a new packet (on request) when the configuration changes.

How many switches are there? You will need to debounce all of them at the same time.

A PS/2 keyboard uses open-collector outputs, so you can hook in with similar outputs. As for needing a software upgrade for USB, I assume the software developer has not been developing for Windows 98 or later? Or are they writing firmware?

The PIC 16C745 is old and inconvenient, as there is no Flash version. There are a number of USB PIC's in the 18F series. Any PIC that has enough code space will do for PS/2.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top