PIC12F509 Project (Please Help)

Thread Starter

epicfatigue

Joined Feb 22, 2013
38
Hello all,

Im very new here and i just wanted to get some help starting off on a project, and gain some insight as to where to start researching.

I have a PIC12F509 as well as a programer.

Goal
I would like to have a PIC12F509 that sits inline with a keybaord and have is listening for 2 types of Hex codes.

When it hears the code i want it to Flash an LED then go right back to listening mode.

Whats this for?
When the IR LED flashes it will trigger a Photo-transistor and increment a counter.


Is there a simulation program i can download and test code on?
Where can i locate some good reading material ?

Thanks all
 

thatoneguy

Joined Feb 19, 2009
6,359
What kind of keyboard?

Doing this with a USB keyboard will be a rather big task.

A PICAXE can interpret and send PS/2 signals, the 08M2 is an 8 pin. The editor has a simulator built in.

BoostC also has simulation/debugging, and supports most PIC mid-range uCs.

MikroC is another option that has simulation, but is limited and not as cheap as BoostC.
 

Thread Starter

epicfatigue

Joined Feb 22, 2013
38
Hey thanks for your reply,

It is an IPAC2 i think it can be USB or PS2
("The board automatically detects which interface it is connected to (USB or PS/2).") http://www.ultimarc.com/ipac2.html

So i guess going for PS2 would be the smarter thing to do?

Sorry i should have been a little more clear.

I want this PIC to be a man in the middle, it will sit there and pass on everything it hears to the PS2/USB port and if it detects a certain HEXcode lets say 5 or 6 it will flash a LED


I managed to snag a copy of MikroC for nothing so i am going to try and do some reading on it.

Do you believe is is possible to achieve what i want to do?
 

thatoneguy

Joined Feb 19, 2009
6,359
Do you believe is is possible to achieve what i want to do?
I know it is possible, however I cannot judge your coding ability or general electronics and signals knowledge and skill.

Something that might be of assistance in the howto and case (not firmware, though) is a similar keyboard device by ThinkGeek.com, take it apart, and see how it works. They have prank devices that insert random keys once in a while, move the mouse randomly, and other annoying features.

I don't know if they are entirely "transparent" or not, but I would think they are. By "Transparent", I mean when adding to a system, it doesn't show up as new hardware. Hardware keystroke loggers also work in this fashion, as sniffers/capture devices. You only need to make a "key sniffee" that doesn't log, bug sends an IR pulse when certain codes are seen. A single purpose decoding serial analyzer, if you will.
 

THE_RB

Joined Feb 11, 2008
5,438
It's easy enough to detect a particular keypress from a PS2 keyboard line.

As for compilers, MikroC compiler already has a PS2 keyboard receive library built in.
 

Thread Starter

epicfatigue

Joined Feb 22, 2013
38
It's easy enough to detect a particular keypress from a PS2 keyboard line.

As for compilers, MikroC compiler already has a PS2 keyboard receive library built in.
thanks mate, im going to have to have a sit down and try and work out the program, do you have any tips where i can get some good manuals for the program or a reference point where to start?
 

Thread Starter

epicfatigue

Joined Feb 22, 2013
38

Thank you i am reading through it now.

A quick rundown on what my capabilities as asked up the top.
I can solder no issue can do 300 leg ic SMD etc etc, very good with a meter.
I can etch and print circuits.
I understand logic gates.
I can write c and Java for computers.

But as for pics the most i have done is program chips with existing code and wire them in.

I am reading through the book as i write this.

My instruction set is located on page 57

http://ww1.microchip.com/downloads/en/devicedoc/41236e.pdf

my daughter is screaming so im going to have to deal with her.

All help thus far is greatly appreciated
 

Thread Starter

epicfatigue

Joined Feb 22, 2013
38
I have spent the last 2 days reading and learning about pics.

However i am awaiting all my new test equipment to come so i can start doing pracs.
(DC PSU) large breadboard etc etc DC-PSU i built myself out of an ATX PSU 0-24v aswell as 12v 7v 5v 3.3v -5 -12 with built in LCD for Current and voltage reading.

Was a lot cheaper then buying one that was for sure.


From the reading i have done i think PS2 is the way to be going,
I am just trying to find a suitable chip.

From what i understand i should be able to grab the data convert it to a string and throw an interrupt if the hex code matching what i am looking for.
I am just a little inexperience to know what would be the best choice of chips so that i could eliminate any delay in doing this.
 
Top