KEYBOARD USB HID

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

Moderator: Benj

Post Reply
Genilsonsa
Posts: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

KEYBOARD USB HID

Post by Genilsonsa »

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: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

WINDOWS does not detect the device.

Genilsonsa
Posts: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

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

kersing
Valued Contributor
Valued Contributor
Posts: 1936
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: KEYBOARD USB HID

Post by kersing »

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: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

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: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

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

Genilsonsa
Posts: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

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: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

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: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

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: 14835
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: KEYBOARD USB HID

Post by Benj »

Hello,

Perhaps these files would help.
HID Keyboard Scan Codes.xls
(37.5 KiB) Downloaded 403 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: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

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: 14835
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: KEYBOARD USB HID

Post by Benj »

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: 150
Joined: Mon Oct 15, 2012 5:19 pm
Contact:

Re: KEYBOARD USB HID

Post by Genilsonsa »

Hello thank Benj again for me reply.
:D

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Contact:

Re: KEYBOARD USB HID

Post by George_B »

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 130 times

User avatar
Benj
Matrix Staff
Posts: 14835
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: KEYBOARD USB HID

Post by Benj »

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
Contact:

Re: KEYBOARD USB HID

Post by George_B »

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: 14835
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: KEYBOARD USB HID

Post by Benj »

This should hopefully help.
USB_HID_Keyboard_Strings.fcfx
(24.48 KiB) Downloaded 192 times

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Contact:

Re: KEYBOARD USB HID

Post by George_B »

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

Post Reply