18F46J50 - USB HID NOT WORK!! (RESOLVED)
Moderators: David Barker, Jerry Messina
18F46J50 - USB HID NOT WORK!! (RESOLVED)
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!
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
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
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.
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.
Last edited by dman776 on Sat Jan 15, 2011 3:04 am, edited 1 time in total.
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.
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
Australian distributor for the Swordfish Compiler
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
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
RESOLVED!!
Ok!. i have resolved!
be80be, thank you very much for your advice!
I will publish the code ASAP!!
be80be, thank you very much for your advice!
I will publish the code ASAP!!
MDB