[USB] HID does not work for me

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

[USB] HID does not work for me

Post by octal » Fri Jan 26, 2007 8:09 pm

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

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Fri Jan 26, 2007 8:24 pm

Try this
// 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
This disables interrupts and polls manually. All it will do is enumerate and maintain the connection. Let me know what happens...

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Fri Jan 26, 2007 8:50 pm

:( does not work David. Sorry.

Is the colck calculated correctly by the compiler ?
I have found in the help file
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.
in the precalculated values we can not see 48Mhz... so I think that the compiler takes 40 instead. What do you think ?

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

Alfch
Posts: 4
Joined: Wed Nov 29, 2006 11:29 am
Location: Paris
Contact:

Post by Alfch » Fri Jan 26, 2007 9:49 pm

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
Last edited by Alfch on Fri Jan 26, 2007 9:51 pm, edited 1 time in total.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Fri Jan 26, 2007 9:50 pm

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.

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Fri Jan 26, 2007 10:04 pm

Ok David ... I understand ... :(
I'm using Microchip C18 for USB development and apparentelt I have to continue do that for some time.
I'm going to wait until I collect sufficient money and definitely buy a licence of SWBasic.

Best regards.

Octal.

Alfch
Posts: 4
Joined: Wed Nov 29, 2006 11:29 am
Location: Paris
Contact:

Post by Alfch » Fri Jan 26, 2007 10:04 pm

No problem David !

The good news is : SE users will be allowed to do some personal tests on HID and CDC libraries !!!

Some other compilers don't offer this chance !!
Waiting for your USB libraries I was not certain to make my own small tests.

Regards

Post Reply