Jump to content
Sign in to follow this  
Justin

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?).

 

Tried

#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

usb_handle_reset()
{
...
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!

 

regards

Justin

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.

 

regards

Justin

 

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. :-(

//_CPUDIV_OSC4_PLL6_1L

/*for 20 Mhz crystal */

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

#pragma DATA _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H

#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 _CONFIG3H, _CCP2MX_OFF_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _MCLRE_ON_3H

#pragma DATA _CONFIG4L, _STVREN_OFF_4L & _LVP_OFF_4L & _DEBUG_ON_4L & _XINST_OFF_4L

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

#pragma DATA _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H

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

#pragma DATA _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H

#pragma DATA _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L

#pragma DATA _CONFIG7H, _EBTRB_OFF_7H

 

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

 

Regards,

Darshan

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.

Guest
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.

Loading...
Sign in to follow this  

×
×
  • Create New...