KEYBOARD USB HID

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

KEYBOARD USB HID

Postby Genilsonsa » Tue Sep 29, 2015 10:33 pm

Good use Flowcode 6.Estou problem with the USB HID simulation in WINDOW 10. Do not recognize the window 10 of the following message. "FAULT DISPOSITIVO.Como DESCRIPTOR REQUEST do I solve? Thanks

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Tue Sep 29, 2015 10:35 pm

WINDOWS does not detect the device.

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Tue Sep 29, 2015 10:37 pm

Arquivo
Attachments
FLOWCODEHID6.fcfx
(5.36 KiB) Downloaded 287 times

kersing
Valued Contributor
Valued Contributor
Posts: 1873
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 530 times
Been thanked: 1040 times
Contact:

Re: KEYBOARD USB HID

Postby kersing » Wed Sep 30, 2015 12:04 am

Have you made sure your clock settings (OSC settings in configuration and clock speed in project options) match and are correct? The 20MHz clock speed looks suspicious when checking the configuration settings and the table on page 31 of the data sheet.

Also, what hardware are you using? Do you have a 220nF capacitor connected between Vusb pin (14 for PDIP/SOIC) and ground?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Wed Sep 30, 2015 1:57 am

Hello thank you for me responder.Eu made the settings the same as this example of BEN modified for forum.Alterei mate only the crystal to 20mhz.Utilizo breadboard.

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Wed Sep 30, 2015 2:00 am

Este é o programa teste que modifiquei para meu uso.
Attachments
ZX Spectrum.fcf
(13 KiB) Downloaded 382 times

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Fri Oct 02, 2015 1:16 am

Hello fortunately managed to make my funcionar.O error in hardware design was lack of capacitor 470 to terra.Muito thank you for answering me. KERSING

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Fri Oct 02, 2015 1:24 am

My question is now shipping a value in education "SENDDATADIRECT" which seems to be a DO STRING.Como to send word "A" .Escrevo eg SENDDATADIRECT "0x04" But in string format?

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Fri Oct 02, 2015 1:30 am

I write as STRING or HEX?

KeyPress Code KeyPress Code
A 0x04 X 0x1B
B 0x05 Y 0x1C
C 0x06 Z 0x1D
D 0x07 Carriage Return 0x28
E 0x08 Tab 0x2B
F 0x09 Caps Lock 0x39
G 0x0A Scroll Lock 0x47
H 0x0B Num Lock 0x53
I 0x0C / 0x54
J 0x0D * 0x55
K 0x0E - 0x56
L 0x0F + 0x57
M 0x10 1 0x59
N 0x11 2 0x5A
O 0x12 3 0x5B
P 0x13 4 0x5C
Q 0x14 5 0x5D
R 0x15 6 0x5E
S 0x16 7 0x5F
T 0x17 8 0x60
U 0x18 9 0x61
V 0x19 0 0x62
W 0x1A \ 0x64

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4150 times
Contact:

Re: KEYBOARD USB HID

Postby Benj » Mon Oct 05, 2015 4:56 pm

Hello,

Perhaps these files would help.

HID Keyboard Scan Codes.xls
(37.5 KiB) Downloaded 372 times


http://www.matrixtsl.com/wiki/index.php ... 7a31b97c2a

The keyboard is a bit strange you have 8 bytes from the micro to the PC for the key scan code (2 bytes for modifiers such as shift or control and 6 bytes for alphanumeric keys) and one byte from the PC to the micro for status LEDs caps lock etc.

The key scan code is send as 8 bytes to allow multiple key combinations to be pressed or held at once.

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Sat Oct 29, 2016 6:05 pm

Hello everyone I am raising this topic i know that it has all the features released,but i am wanting to emulate a keyboard HID and i need the ENTER key.Is it possible someone having the key value

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4150 times
Contact:

Re: KEYBOARD USB HID

Postby Benj » Mon Oct 31, 2016 1:19 pm

Hello,

This should give you an enter key.

Data[2] = 0x28

Taken from here, under the Keyboard section.
http://www.freebsddiary.org/APC/usb_hid_usages.php

It is listed in my Keyboard Scan Codes Excel document but is listed as Carriage Return so I missed it at first.

Genilsonsa
Posts: 148
Joined: Mon Oct 15, 2012 5:19 pm
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: KEYBOARD USB HID

Postby Genilsonsa » Mon Oct 31, 2016 2:23 pm

Hello thank Benj again for me reply.
:D
These users thanked the author Genilsonsa for the post:
Benj (Mon Oct 31, 2016 8:04 pm)
Rating: 5.26%
 

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: KEYBOARD USB HID

Postby George_B » Sun Nov 27, 2016 11:41 am

Hello,

i would like to modify the attached FC6 program so it will send ten lines of predefined (fixed) text to my computer.

The attached file is taken from the USB HID component examples. What it does is just to send a line of text every 5 seconds.

I tried to modify the program but i am missing something.

Any thoughts about it?

Thanks in advance
George
Attachments
USB_HID_Keyboard (2).fcfx
(23.39 KiB) Downloaded 121 times

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4150 times
Contact:

Re: KEYBOARD USB HID

Postby Benj » Mon Nov 28, 2016 12:57 pm

Hi George,

It looks to me like you're close though I haven't spotted anything incorrect yet. Are you getting anything out of it at the moment?

Maybe the CheckRx needs to be in the loop after the KeyUp macro?

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: KEYBOARD USB HID

Postby George_B » Thu Dec 01, 2016 10:00 am

Benj wrote:Hi George,

It looks to me like you're close though I haven't spotted anything incorrect yet. Are you getting anything out of it at the moment?

Maybe the CheckRx needs to be in the loop after the KeyUp macro?



Hi Benj,

At the moment i get only the "Hello From Your USB Keyboard Device! 12345\n" text every 5 seconds.

It looks like this:
Hello From Your USB Keyboard Device! 12345
Delay 5s
Hello From Your USB Keyboard Device! 12345
Delay 5s
Hello From Your USB Keyboard Device! 12345
Delay 5s
Hello From Your USB Keyboard Device! 12345
Delay 5s..

I would like to modify the program so i will take 10 different lines of text. For example:


Text for line 1
Delay 5s
Text for line 2
Delay 5s
Text for line 3
Delay 5s
Text for line 4
Delay 5s
Text for line 5
Delay 5s
Text for line 6
Delay 5s
Text for line 7
Delay 5s
Text for line 8
Delay 5s
Text for line 9
Delay 5s
Text for line 10
Delay 5s

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4150 times
Contact:

Re: KEYBOARD USB HID

Postby Benj » Thu Dec 01, 2016 6:19 pm

This should hopefully help.

USB_HID_Keyboard_Strings.fcfx
(24.49 KiB) Downloaded 176 times
These users thanked the author Benj for the post:
George_B (Sat Dec 03, 2016 4:59 pm)
Rating: 5.26%
 

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: KEYBOARD USB HID

Postby George_B » Sat Dec 03, 2016 5:00 pm

Benj wrote:This should hopefully help.

USB_HID_Keyboard_Strings.fcfx




Thank you very much Benj! That was exactly what i was looking for! :D


George
These users thanked the author George_B for the post:
Benj (Mon Dec 05, 2016 11:05 am)
Rating: 5.26%