Jump to content
Sign in to follow this  

Picpack Usb Enumeration Failure

Recommended Posts

Hello everyone,


I have a Sparkfun 18F2553 USB Bit Wacker (UBW) which has a bootloader loaded at 0x000000-0x0007ff.


I have stripped down the PicPack usb_joy_mouse demo to the basics which should enumerate on winxp. I have added the linker option -rb 0x000800 to place the code at the right place.

I have Sourceboost IDE 6.97, compiling and linking using BoostC++ (since I don't have a license for BoostC, and the lite ver runs out of ram i think...)

The device is programmed using the PICDEM FUSB tool. This works fine, using the boards current config data (ie the bootloaders config?). But after reset, winxp reports the device is "not recognized".


I thought it may be that Endpoint0 addresses may not be offset correctly (from 0x500 to 0xD00?).



#define USB_EP0_OUT_SIZE 8
#define USB_EP0_OUT_ADDR 0x0D00
#define USB_EP0_IN_SIZE 8
#define USB_EP0_IN_ADDR 0x0D08

#define USB_EP1_IN_SIZE		8
#define USB_EP1_IN_ADDR		0x0D10


Also, modifed in pic_usb.c

bd0out.addr = USB_EP0_OUT_ADDR;
bd0in.addr = USB_EP0_IN_ADDR;

as mentioned in another post elsewhere.


Still does not enumerate though. Any ideas anyone? Any help will be much appreciated!




Share this post

Link to post
Share on other sites

Ok, I found the problem...


The UBW board requires

set_bit(rcon, IPEN)

This enables the low priority interrupts (i think?)


And the Endpoint0 addresses must not be offset +0x000800, ie:

#define USB_EP0_OUT_SIZE 8
#define USB_EP0_OUT_ADDR 0x0500
#define USB_EP0_IN_SIZE 8
#define USB_EP0_IN_ADDR 0x0508

#define USB_EP1_IN_SIZE		8
#define USB_EP1_IN_ADDR		0x0510

is correct.


Device enumerates correctly. Now to writing some code to make it useful.





PS Big thanks to Ian Harris for your PicPack! Taken me about 3 days to get a device to enumerate... would've taken me 3 years. (I find the Microchip stack too generic (one size fits all) and therefore extremely difficult to step through and understand...)

Share this post

Link to post
Share on other sites

Hi i am also writing code for PIC18F2550 using picpack . i have designed my own board.


I am also not able to enumerate device i am having 20Mhz crystal and following settings could you please confrom your settings.


// Config for 20Mhz crystal, FS USB (half 96Mhz=48Mhz) CPU clock at 16Mhz (96Mhz/6)

// Only clock CPU at 16Mhz since this is about the maximum at 3v. :-(


/*for 20 Mhz crystal */

//#pragma DATA _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L


#pragma DATA _CONFIG2L, _PWRT_OFF_2L & _BOR_OFF_2L & _VREGEN_ON_2L // this must be ON with VUSB 0.1uf GND

#pragma DATA _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H



#pragma DATA _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L


#pragma DATA _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L





i am trying it for more than three days to enumerate device but no luck




Share this post

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...