Hi Everyone,
Have two questions
1 :
==
Can someone explaine
Device = 18F4550
Clock = 48
// 20Mhz crystal, 48Mhz internal (FS USB)
I'am using a 20 Mhz cristal with clock set at 48 ???
This is necessary for full speed USB use ??
2:
==
How to convert between "QERTY" codes and "AZERTY" codes
Wordpad.exe ==> becomes Zordpq:exe ??
Can substitute the Z = W and A = Q but can't find the code for the period.
Erik
USB Demo from Nathan Herbert
Moderators: David Barker, Jerry Messina
If you look at the datasheet for the 18F4550 USB peripheral then it will tell you that the clock source for full speed USB must be 48Mhz.1 :
==
Can someone explaine
Device = 18F4550
Clock = 48
// 20Mhz crystal, 48Mhz internal (FS USB)
I'am using a 20 Mhz cristal with clock set at 48 ???
This is necessary for full speed USB use ??
So we set "Clock = 48" in swordfish, this sets the clock speed for all the internal functions for swordfish.
We need to setup the oscillator (Clock) for the 18F4550 to run at the clock souce of 48Mhz, we do this by setting up the PPL oscillator mode and this is done by setting something like this:
PLLDIV = 5,
CPUDIV = OSC1_PLL2,
USBDIV = 2,
FOSC = HSPLL_HS
This will set the 18F4550 internal oscillator to 48Mhz when using an external 20Mhz crystal. I hope that answers your question.
Yes for the moment this answer is helping me out, thanks.
Hope that further reading on the subject will elucidate the difference between the compiler internals and the real pic cristal.
But i'am still in trouble where to specify in the usb-descriptor that i use an azerty keybord ?
Now I must substitute the a , q, w, z, m codes send and for a period i use
SendKey(54, LeftShift) where period in the demofile = SendKey(55, None) ?
Regards
Erik
Hope that further reading on the subject will elucidate the difference between the compiler internals and the real pic cristal.
But i'am still in trouble where to specify in the usb-descriptor that i use an azerty keybord ?
Now I must substitute the a , q, w, z, m codes send and for a period i use
SendKey(54, LeftShift) where period in the demofile = SendKey(55, None) ?
Regards
Erik
I dont think you can change the keyboard type - the module is setup for a Qwerty keyboard.
The only thing you could try is to make a copy of the KeyboardDefs.BAS and paste it into your User Library Folder and from there you can change/edit that file to suit your keyboard layout?.
Any files located in your User Library Folder should take priority over any Compiler File.
The only thing you could try is to make a copy of the KeyboardDefs.BAS and paste it into your User Library Folder and from there you can change/edit that file to suit your keyboard layout?.
Any files located in your User Library Folder should take priority over any Compiler File.
Hi Erik,
bitofgav is right i'm afraid. There is nowhere in the HID descriptor to specify what layout is in use. It's entirely up to the OS on how it handles the layout.
The software is really just saying which position is pushed (scan code), not what the button actually is (char code). We simply match up the chars to the scancode to make it easier.
As bitofgav said, you'll need to change the definitions in "KeyboardDefs.BAS" to match the characters to the hardware scan codes for Azerty. I did have a look for you but can't seem to find the USB Azerty scan codes. A non-english search may turn up more!
Regards,
Nathan
bitofgav is right i'm afraid. There is nowhere in the HID descriptor to specify what layout is in use. It's entirely up to the OS on how it handles the layout.
The software is really just saying which position is pushed (scan code), not what the button actually is (char code). We simply match up the chars to the scancode to make it easier.
As bitofgav said, you'll need to change the definitions in "KeyboardDefs.BAS" to match the characters to the hardware scan codes for Azerty. I did have a look for you but can't seem to find the USB Azerty scan codes. A non-english search may turn up more!
Regards,
Nathan