Help With Project

Discussion on projects that are created by users and posted on mikroElektronika website.
Post Reply
Author
Message
epicfatigue
Posts: 3
Joined: 17 Mar 2013 06:34

Help With Project

#1 Post by epicfatigue » 17 Mar 2013 08:17

Hello everyone, i am new here just wanted to say hello and introduce myself.


I recently purchased

PIC Microcontrollers - Programming in C (Book)
MikroC PRO for PIC (Software)

And i was just looking for a little guidance i might be in the wrong section.


I have a PIC12F509 as well as a GQ-4x USB programer.

Goal
I would like to have a PIC12F509 (or a other suitable chip) sit inline with a USB Keybaord, i want all commands to pass through the PIC to the computer and if the chip detects a hex value (key 5 or 6) i want it to trigger a LED to flash and also pass the command through to the computer.


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


IS this doable ?
So far i have read that there is a PS2 library and i have seen on the forums
Is there a simulation program i can download and test code on?
Where can i locate some good reading material ?

Thanks all

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: Help With Project

#2 Post by dejan.odabasic » 18 Mar 2013 19:02

Hello,

I have answered on your topic with similar question:
http://www.mikroe.com/forum/viewtopic.p ... 70#p209370

Best regards.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Help With Project

#3 Post by Dany » 18 Mar 2013 23:11

epicfatigue wrote:Hello everyone, i am new here just wanted to say hello and introduce myself.


I recently purchased

PIC Microcontrollers - Programming in C (Book)
MikroC PRO for PIC (Software)

And i was just looking for a little guidance i might be in the wrong section.


I have a PIC12F509 as well as a GQ-4x USB programer.

Goal
I would like to have a PIC12F509 (or a other suitable chip) sit inline with a USB Keybaord, i want all commands to pass through the PIC to the computer and if the chip detects a hex value (key 5 or 6) i want it to trigger a LED to flash and also pass the command through to the computer.


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


IS this doable ?
So far i have read that there is a PS2 library and i have seen on the forums
Is there a simulation program i can download and test code on?
Where can i locate some good reading material ?

Thanks all
Hi, to start with USB you perhaps should look at: http://www.mikroe.com/forum/viewtopic.p ... d+keyboard, this step will allow you to make the PIC appear as an USB keyboard to the PC and simulate keyboard clicks, visible on the PC. This is already a very big step to make this work. :shock:

The next step could then be to connect a real PS2 keyboard to the PIC, read it and send its (translated) keypresses via USB to the PC. Also a very big step. :shock:

If you are new to PIC's and mikroElektronika compilers then it would perhaps be wiser to start with some simpler projects? :?
I remember all too well the difficulties I had myself... :oops:

With the mikroElektronika compilers a lot of examples are delivered to show the basic usage of the lbraries. I think you should look at them first. :shock:
Furthermore: try to find as much information on this forum, other people had surely the same questions and difficulties you will have.
This may perhaps also help you: http://www.rosseeld.be/DRO/PIC/Pitfalls.htm, about issues that make projects not work (written for mikroPascal, but also mostly valid for mikroC).

By the way: the PIC12F509 will not do if you want the PIC to act as an usb device (e.g. a keyboard), you will need at least some P18F... type with USB device capabilities, see the datasheets of the PIC's.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

epicfatigue
Posts: 3
Joined: 17 Mar 2013 06:34

Re: Help With Project

#4 Post by epicfatigue » 19 Mar 2013 04:40

Thank you all for your help, sorry about my double post i clicked it and it didn't appear after 2 days so i re submitted i didn't notice there was an approval process.

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.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Help With Project

#5 Post by Dany » 19 Mar 2013 12:24

epicfatigue wrote: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.
The P15F2550 -- must be P18F2550 of course -- (or similar) is an excellent choice.


**Admin: Dany probably meant to write PIC16F2550

Thanks admin, I meant P18F2550. Dany
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “User Projects”