18F46J50 - USB HID NOT WORK!! (RESOLVED)

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
mdb80
Registered User
Registered User
Posts: 9
Joined: Tue Dec 21, 2010 11:40 am
Location: Milan

18F46J50 - USB HID NOT WORK!! (RESOLVED)

Post by mdb80 » Fri Jan 14, 2011 1:59 pm

Does anyone know why?

Device = 18F46J50
Clock = 48
Config OSC = HSPLL
Config PLLDIV = 3 'divido il pll da 96Mhz x 3

#define USB_DESCRIPTOR = "usbdesc.bas" // name of descriptor file
#option org_reset = $1000 // for hid bootloader

Include "leds.bas"
Include "usbhid.bas"

OSCTUNE.6 = 1 'PLLEN=1 -> PLL ENABLED

'TRIS I/O SETTINGS
TRISA= %11001111
TRISB= %10010111
TRISC= %10110011
TRISD= %10111011
TRISE= %00000000

Repeat
DelayMS(100)
Leds.AllRed()
DelayMS(100)
Leds.Off()
Until HID.Attached

// main program loop...
While true
If DataAvailable Then
Leds.Off()
DelayMS(100)
Led.AllGreen()
DelayMS(100)
EndIf
Wend

End

'leds blink always red and usb not work!

thank's in advance!
Last edited by mdb80 on Mon Jan 17, 2011 12:56 pm, edited 1 time in total.
MDB

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 14, 2011 3:59 pm

There is no current support for that device. The original USB HID module was written and tested for the 18F2455, 18F2550, 18F4455 and 18F4550 devices.

RKP did some great work on getting USB HID to work on the 18F13K50 and 18F14K50 parts. I've personally used the USB HID on the 18F14K50 and it works great.

mdb80
Registered User
Registered User
Posts: 9
Joined: Tue Dec 21, 2010 11:40 am
Location: Milan

Post by mdb80 » Fri Jan 14, 2011 6:01 pm

I spent much money for a compiler that does not work!

swordfish ..... congratulations ....unfortunately, though, I've got a crab!


Thank you David
MDB

dman776
Posts: 115
Joined: Mon May 28, 2007 3:59 pm
Location: Texas

Post by dman776 » Fri Jan 14, 2011 9:16 pm

Last edited by dman776 on Sat Jan 15, 2011 3:04 am, edited 1 time in total.

gramo
Registered User
Registered User
Posts: 200
Joined: Tue Mar 20, 2007 6:55 am
Location: Australia
Contact:

Post by gramo » Sat Jan 15, 2011 1:03 am

You could always order some free samples from microchip..

Make sure you check what packages you are ordering as I'm sure they wouldn't appreciate such a response due to someone else's failure to read.
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

Australian distributor for the Swordfish Compiler

W4GNS
Registered User
Registered User
Posts: 29
Joined: Wed Nov 03, 2010 7:18 pm
Location: Occupied South (Virginia)

Post by W4GNS » Sat Jan 15, 2011 3:56 am

Go see your family doctor, he can take care of that crab
mdb80 wrote: I've got a crab!
Gary W4GNS

be80be
Registered User
Registered User
Posts: 90
Joined: Mon Feb 23, 2009 2:15 am
Location: tn

Post by be80be » Sat Jan 15, 2011 7:38 am

Some one name nigle said he got it to work with the OP chip.
Swordfish is great No one said it would be a piece of cake You have to work with it same as any complier


It wouldn't be that hard to get the 18f46J50 to work

RKP
Registered User
Registered User
Posts: 82
Joined: Mon Oct 22, 2007 3:14 pm
Location: Maryland

Post by RKP » Sat Jan 15, 2011 6:53 pm

mdb80,

This PIC may work as a USB device with Swordfish but a few of the library files need to be edited (Modified).

This is what make Swordfish excellent compare to other basic compilers. All the libraries are open soucre so they can be modified to allow users to make newer PIC's function just as the older ones do.

If you look at my post on the 18F14K50 it will give ideas as to which library files need to be modified. The 18F46J50 includes and bas files do not need to be modified just the library files, if you used the system covert executeable.

David has release his system convert executeable so new devices that Microchip releases can be supported by Swordfish by creating the part includes and .bas file used by Swordfish.

If you need some help please ask. Don't just complain about the compiler.

RKP

be80be
Registered User
Registered User
Posts: 90
Joined: Mon Feb 23, 2009 2:15 am
Location: tn

Post by be80be » Sat Jan 15, 2011 7:22 pm

If you compare the 18f4550 and 18f46j50 inc and the bas files The register's
are named the same . And i looked at the usb files there not to chip related

Going to dig in to day and get my 18f14k50 using usb thanks RKP for your post

mdb80
Registered User
Registered User
Posts: 9
Joined: Tue Dec 21, 2010 11:40 am
Location: Milan

RESOLVED!!

Post by mdb80 » Mon Jan 17, 2011 12:55 pm

Ok!. i have resolved!

be80be, thank you very much for your advice!

I will publish the code ASAP!!

:)
MDB

RKP
Registered User
Registered User
Posts: 82
Joined: Mon Oct 22, 2007 3:14 pm
Location: Maryland

Post by RKP » Mon Jan 17, 2011 1:39 pm

mdb80,

Great that it is working for you.

I modified three libraries and I was going to post those changes tonight.
But since I do not have that chip I cannot verify that it works.

I'll post my changes later on when I get home.

Please post your changes so we can compare.

Post Reply