Page 1 of 1
Question - Pic 18F25K50 - HID Keyboard 4X5
Posted: Fri Sep 08, 2017 9:49 am
by seokgi
I would like to use the PIC 18F25K50 to create a keyboard that works like a computer keyboard (4X5). So I made a keyboard and read key values. However, I did not succeed in connecting the HID USB Keyboard to my computer. Perhaps it is because the 18F25K50 's Config is wrongly selected and the HID Component is not used well. I hope some of you guys will help me out. Please help me.
Re: Question - Pic 18F25K50 - HID Keyboard 4X5
Posted: Fri Sep 08, 2017 10:01 am
by Benj
Hello,
I'm assuming you're using a 16MHz crystal. If so then this should hopefully work correctly for you.
Re: Question - Pic 18F25K50 - HID Keyboard 4X5
Posted: Thu Sep 14, 2017 11:44 am
by seokgi
I did what you sent me and it was recognized as HID K / B. However, no matter how I try, I can not send keyboard values. It works well with HID Serial. I do not know what I did wrong. For example, the format of the data or another. Teach me a little more. Give me a hint if you get tough. I have to worry about doing this quickly. Please, please.
Re: Question - Pic 18F25K50 - HID Keyboard 4X5
Posted: Thu Sep 14, 2017 2:04 pm
by Benj
Hello,
Your variable Data_HID should be changed to 8 bytes instead of 10.
To then add the key press you want you need to correctly assign the data to the Data_HID variable.
A complete list of scan codes for a US keyboard can be found here.
https://gist.github.com/MightyPork/6da2 ... 55fdc73db2
To send a '*' character you would assign the data like this.
Data_HID[2] = 0x55
Send the data and then clear the buffer to reset the key press.
Data_HID[2] = 0
Here are some more key values from your program
F1 -> Data_HID[2] = 0x3A
F2 -> Data_HID[2] = 0x3B
'1' -> Data_HID[2] = 0x1E
'2' -> Data_HID[2] = 0x1F
'3' -> Data_HID[2] = 0x20
UP Cursor ->Data_HID[2] = 0x52
Here's a modified version of your program.
Re: Question - Pic 18F25K50 - HID Keyboard 4X5
Posted: Thu Sep 14, 2017 3:35 pm
by seokgi
Thank you very much for your help.
HID KB does not work even if you modify it as taught. In Device Manager, it is well recognized as HID KB. But the KB is still not working. And I do not know the meaning of Key UP Icon and Hid_Data [??]. Let me know where it is described and I will study. I do not speak English well so my meaning is well communicated. If you do not help me, I probably will not be using FC. Probably in Korea, I seem to be using my own.
Thank you.
Re: Question - Pic 18F25K50 - HID Keyboard 4X5
Posted: Thu Sep 14, 2017 5:31 pm
by seokgi
I'm just finished that.
USB HID component error. I copyed new component. That solved.
Thank you.