[USB] HID does not work for me
Moderators: David Barker, Jerry Messina
[USB] HID does not work for me
I tested the HID example, it does not worked for me. I tested it on my EasyPic3 with 18LF4550 and a 20Mhz cristal. I tested an old program I had written in C and it worked, so my hardware is out of problem. I reloaded the example of SFBasic, and checked the config and it's the same.
It does not work! In the hardware manager, it detected and uncknown USB hardware, and in a software I had writen that let me manage HID devices, send reports to them and read reports from them (an USB terminal like) I do not ever detect my hardware.
I'll try to check the example, and may be write a simpler example to see what happens.
Best regards
It does not work! In the hardware manager, it detected and uncknown USB hardware, and in a software I had writen that let me manage HID devices, send reports to them and read reports from them (an USB terminal like) I do not ever detect my hardware.
I'll try to check the example, and may be write a simpler example to see what happens.
Best regards
- David Barker
- Swordfish Developer
- Posts: 1216
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
Try this
This disables interrupts and polls manually. All it will do is enumerate and maintain the connection. Let me know what happens...// device and clock...
device = 18F4550
clock = 48
// 20Mhz crystal, 48Mhz internal (FS USB)
config
PLLDIV = 5,
CPUDIV = OSC1_PLL2,
USBDIV = 2,
FOSC = HSPLL_HS,
VREGEN = ON
// import modules...
#option USB_SERVICE = false
include "usbhid.bas"
while true
Service
wend

Is the colck calculated correctly by the compiler ?
I have found in the help file
in the precalculated values we can not see 48Mhz... so I think that the compiler takes 40 instead. What do you think ?This can be extremely useful when used in conjunction with the pre-processor to generate different timing code. However, it is important to note that the built in routines will only currently generate the correct timings for a certain range of clock frequencies. These include: 3.58, 4 to 13, 14.32, 15 to 40 and 64MHz. Any frequencies falling outside of this range will be matched to the nearest supported value.
I'm going to analyse the code of the HID lib and compare it to Microchip HID firmware ... and I'll have a deep look in USB Complete of J.Axelson ...
I'll take you informed.
Regards
Hi Octal
I just discover and test CDC samples.
When I compare two ASM files from same config but different 'clock' values (48 and 40) I find different values for Timer1 reloading (209 vs 216).
So we can assume that 48 is a new value not yet documented.
Regards
I just discover and test CDC samples.
When I compare two ASM files from same config but different 'clock' values (48 and 40) I find different values for Timer1 reloading (209 vs 216).
So we can assume that 48 is a new value not yet documented.
Regards
Last edited by Alfch on Fri Jan 26, 2007 9:51 pm, edited 1 time in total.
- David Barker
- Swordfish Developer
- Posts: 1216
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
I'm afraid it appears to be a problem with the SE version, which doesn't have bank switching enabled. I thought I had managed to get around this problem for the USB libraries (which use dual port RAM located at $400) but it's not working correctly. My sincere apologies and shame on me.
It looks like I will have to pull the libraries from the SE version for an indefinite time.
BETA testing was performed on a number of boards (including EasyPIC3) with great success. Of course, myself and all other BETA testers are using the full version of Swordfish which does not have this limitation - so no problems running the USB modules.
Apologies to all SE users.
It looks like I will have to pull the libraries from the SE version for an indefinite time.
BETA testing was performed on a number of boards (including EasyPIC3) with great success. Of course, myself and all other BETA testers are using the full version of Swordfish which does not have this limitation - so no problems running the USB modules.
Apologies to all SE users.