Author Topic: 18F2550 and USB  (Read 18269 times)

0 Members and 1 Guest are viewing this topic.

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
18F2550 and USB
« on: November 15, 2013, 11:16:57 pm »
Hi.

A couple a weeks ago a friend of mine came by and asked ma to program a 18F2550 for some project that he is working on. He gave me a hex file that he found on the web, and after a while we had it working just like it is supposed to work (using the pickit2, using the general propose programmer wont work for some reason). One week after, I found myself building another project, where I had issues with MPLABX, and that is when I started the other topic, but after reinstalling everything I eventually got it to compile some code. But when I would program the 18F2550 I would always get the unknown device info on Windows 7. Then I tried to find some hex files on the web of projects that actually work, and I programmed them into the 18f2550, but no change. Later I went to my friends house to get his rom file, but when he plugged his gizmo in the pc-usb it didn't work, and it never worked again. When I got home and plugged my gizmo i got nothing, not even the unknown device warning from windows. I tried downloading a bunch of various hex files from the web, but nothing happened.
I checked the mcu, it is directly powered from the usb, 20MHz crystal that does oscillate, a resistor for mclr, and two wires for usb data, and that is it.
But nothing works, I tried changing the chip itself, but nothing changes.
I checked all of the connections with the multimeter, the usb cable, the usb port itself, but all seems to be fine!

What can I try to do?
I ran out of ideas!
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: 18F2550 and USB
« Reply #1 on: November 16, 2013, 12:47:33 am »
gave me a hex file that he found on the web
And no idea what the config fuses are set at?

Quote
I eventually got it to compile some code. But when I would program the 18F2550 I would always get the unknown device info on Windows 7. Then I tried to find some hex files on the web of projects that actually work, and I programmed them into the 18f2550, but no change.
Without knowing anything else, circuit diagrams, or anything, 'cause the description of this thread sounds more like "my car won't start...it's red...what's wrong?", it sounds like MPLAB is probably setting the config fuses to some default value rather than what the circuit, more importantly, the PIC's USB module, actually needs.
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline trackman44

  • Regular Contributor
  • *
  • Posts: 67
  • Country: ca
Re: 18F2550 and USB
« Reply #2 on: November 16, 2013, 01:00:35 am »
It's stuck in LVP mode, here's a fix :-

http://www.microchip.com/forums/m640643.aspx

Hope it helps.

Will
How 'bout them Maple Leafs?
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: 18F2550 and USB
« Reply #3 on: November 16, 2013, 01:05:13 am »
One problem I've had with 18F2550s is that there must be a capacitor between Vusb and ground, 0.47 uF will work as I recall.

This fact at least used to be a footnote in the data sheet and at least one Microchip demo board (MC9800 temperature sensor) doesn't have this cap and was un-recognized until I installed it.
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #4 on: November 17, 2013, 12:26:56 am »
I've tried with this configuration:
http://wiki.pinguino.cc/index.php/File:PIC18F2550_diagram.png
And also this:
http://dangerousprototypes.com/2012/06/15/open-source-usb-demo-ported-to-the-pic18f2550-breakout-board/
With a 12MHz crystal as well, but nothing!
Its like I've been programming a brick tor the last two weeks.

Btw, the rom and fuse settings are from the hex files of those sample projects.

Is there a very simple usb demo that is known 100% that it works with a schematic, hex files and fuse settings?
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: 18F2550 and USB
« Reply #5 on: November 17, 2013, 12:43:50 am »
Read the PIC back and compare the ACTUAL config fuse settings in the .hex file.
In the past, I've found that MPLAB and/or the programmer itself will override config fuses, even without you knowing it.
So, write down what you think those config fuse settings should be, do a full read back of the PIC, and compare the two.
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: 18F2550 and USB
« Reply #6 on: November 17, 2013, 01:41:37 am »
Quote
Is there a very simple usb demo that is known 100% that it works with a schematic, hex files and fuse settings?

Not sure if it is sufficiently simple for you but I do seem to recall that Microchip publishes a very well known USB device based on 18F2550, with schematic and hex files on its website.

Simpler versions (and associated schematic) can be found on the web as well.
================================
https://dannyelectronics.wordpress.com/
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #7 on: November 17, 2013, 04:57:43 am »
I've downloaded an entire package of demo stuff from microchip, but that won't work either.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8275
Re: 18F2550 and USB
« Reply #8 on: November 17, 2013, 12:14:11 pm »
Is it only the USB that's not working, or is it the whole MCU?

Keep in mind that USB (although this is FS, not HS) is sensitive to length and noise on the data pair. Connections should be short and matched length, and the pair should be twisted together a far as possible until they enter the PCB.

Try blinking an LED first...
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: 18F2550 and USB
« Reply #9 on: November 17, 2013, 02:02:42 pm »
Quote
Try blinking an LED first...

That's always the first step, usually skipped by people starting on mcus - they usually want to the fancy stuff right away.
================================
https://dannyelectronics.wordpress.com/
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: 18F2550 and USB
« Reply #10 on: November 17, 2013, 04:47:14 pm »
Blink an LED and check that the period is correct.  For example, blink it on for half a second, off for half a second and verify this time while watching a clock.  This verifies the oscillator is set up correctly to yield the correct frequency.

Commandments for Using PICs is a collection of common errors that lead to problems with PICs but it's pretty much applicable to any micro circuit.
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Re: 18F2550 and USB
« Reply #11 on: November 17, 2013, 08:37:07 pm »
Blink an LED and check that the period is correct.  For example, blink it on for half a second, off for half a second and verify this time while watching a clock.  This verifies the oscillator is set up correctly to yield the correct frequency.

I've been programming micros for over 15 years and I still start with the blinking LED test with each new micro family/brand I use.  It is a perfectly reasonable sanity check.   :)
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: 18F2550 and USB
« Reply #12 on: November 17, 2013, 09:03:39 pm »
I see a pattern:

seasoned programmer: blink the leds;
newbie: work on usb or avr-based Ethernet traffic controller, or other equally challenging projects.

:)
================================
https://dannyelectronics.wordpress.com/
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #13 on: November 18, 2013, 07:44:45 am »
Ok, I usually try that as well, but since I have to use MPLABX I wanted to avoid ti all together. Usually I use Proton IDE, and I never had such issues before with mcu-s. And I already checked the clock on the crystal, and it works just fine.
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: 18F2550 and USB
« Reply #14 on: November 18, 2013, 01:29:01 pm »
Ok, I usually try that as well, but since I have to use MPLABX I wanted to avoid ti all together. Usually I use Proton IDE, and I never had such issues before with mcu-s. And I already checked the clock on the crystal, and it works just fine.
Clock on the crystal and blinking LEDs, sure...that may work just fine and(or) dandy...but the USB module module runs off a different divider than does the rest of the PIC.
How about posting the config fuse settings...or do we get to keep guessing at your particular configuration?
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #15 on: November 18, 2013, 07:13:44 pm »
I wrote a blinky program in both Proton IDE and MPLAB X, and they both work fine, and I get pulses on portb, where it is supposed to "blink".
For that programs I got the fuses set like this:
CF3F 1F3F 8700 005E C00F E00F 400F

For the USB programs I tried so many different fuse configurations that I don't keep track of what it was supposed to be anymore...
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: 18F2550 and USB
« Reply #16 on: November 18, 2013, 07:48:13 pm »
And if you take those config fuse numbers, cross reference those with the PIC's datasheet, you should be able to figure out if you're crystal is getting divided correctly to give the USB module the right frequency to run off of...
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline DavidDLC

  • Frequent Contributor
  • **
  • Posts: 755
  • Country: us
Re: 18F2550 and USB
« Reply #17 on: November 18, 2013, 08:03:00 pm »
I have project that works with USB and PIC18F2455.

My configuration will see the device as a HID, so you also need to have the correct application on your computer because this is not a Virtual COM device and the PC application has to detect the USB device in a different way.

You need to have the right oscillator settings for the 96 MHZ PLL in order to have USB working, the 96 MHz PLL needs a 4 MHz input. VUSB capacitor and some configurations to tell the system about your device, like VID and PID, if your device is powered or non-powered ( for this you need software settings and a resistor), and some other things I don't have straight on my mind.

I'm at work right now I can check when I get home at 5:30 pm pacific time.


David.

 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #18 on: November 19, 2013, 02:36:11 am »
The demo programs that I downloaded used a 20MHz and a 12MHz crystal oscillator, so I tried switching between the two. Not all demo programs use the same clock frequency, so the fuse bits are going to be different.

That is why I asked for a example where I can just load the hex file, and input the fuse bits, eliminating any work from my side, since obviously I am doing something wrong.

For now I don't care what type of hid it is, I just want that windows can recognize it as something, but my final goal is to get it working as a hid mouse.
 

Offline trackman44

  • Regular Contributor
  • *
  • Posts: 67
  • Country: ca
Re: 18F2550 and USB
« Reply #19 on: November 19, 2013, 04:46:04 am »
Maybe it would be helpful if you posted your circuit diagram, links to the hid programs you downloaded, post some photos of your setup. I would recommend Pinguino :-

http://www.pinguino.cc/

It's a PIC18F2550 alternative to the Arduino Uno. It's worth a shot.

Will
How 'bout them Maple Leafs?
 

Offline DavidDLC

  • Frequent Contributor
  • **
  • Posts: 755
  • Country: us
Re: 18F2550 and USB
« Reply #20 on: November 19, 2013, 05:52:14 am »
I don't have a hex file, I have the entire project:

This is the configuration for 20 MHz clock:
#pragma config PLLDIV   = 5                       //20MHz / 5 = 4 MHz, input for the 96 MHz PLL
#pragma config CPUDIV   = OSC1_PLL2       //CPU Clock = 96 MHz/2 = 48 MHz
#pragma config USBDIV   = 2                      //96MHz PLL/2 = 48 MHz for USB clock
#pragma config FOSC     = HSPLL_HS         //Osc type: High Speed Crystal/Resonator with PLL enabled

But again, you may need to have voltage sense resistors to report to the host if you are a powered or non-powered device, if the hex file has this function enabled and you don't have the sense resistors connected, you can have the same problem you have.

From the USB stack:
static void InitializeSystem(void)
{
   
//   If the host PC sends a GetStatus (device) request, the firmware must respond
//   and let the host know if the USB peripheral device is currently bus powered
//   or self powered.If the peripheral device is capable of being both
//   self and bus powered, it should not return a hard coded value for this request.
//   Instead, firmware should check if it is currently self or bus powered, and
//   respond accordingly. If using this feature, make sure "USE_SELF_POWER_SENSE_IO"
//   has been defined in HardwareProfile.h, and that an appropriate I/O pin has been mapped
//   to it in HardwareProfile.h.
    #if defined(USE_SELF_POWER_SENSE_IO)
    tris_self_power = INPUT_PIN;   // See HardwareProfile.h
    #endif

}//end InitializeSystem

In one of my projects I didn't put the sense resistor, and the circuit was not recognized, I was having the same problem as you.

David.



 

Offline sata

  • Newbie
  • Posts: 8
Re: 18F2550 and USB
« Reply #21 on: December 21, 2013, 01:13:07 pm »
What do you mean config fuse numbers? Are you mentioning the Configuration bits?
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: 18F2550 and USB
« Reply #22 on: December 21, 2013, 06:14:10 pm »
What do you mean config fuse numbers? Are you mentioning the Configuration bits?
Yes, and the number that those bits represent...
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #23 on: February 16, 2014, 11:33:57 pm »
After a longer brake from this mess, I finally obtained a development board for the 18F2550, it is the RKPK28.
Guess what!
None of the examples work, and the site of that dev board is dead!

The pickit2 programs the board, but nothing happens, widows don't give any signs of activity, not even an unknown device. Nothing, as if I plugged the usb cable in a brick.

I am out of ideas here, what else can I try to get ANY usb example to work.
 

Offline daveshah

  • Supporter
  • ****
  • Posts: 356
  • Country: at
    • Projects
Re: 18F2550 and USB
« Reply #24 on: February 17, 2014, 11:06:56 am »
After a longer brake from this mess, I finally obtained a development board for the 18F2550, it is the RKPK28.
Guess what!
None of the examples work, and the site of that dev board is dead!

The pickit2 programs the board, but nothing happens, widows don't give any signs of activity, not even an unknown device. Nothing, as if I plugged the usb cable in a brick.

I am out of ideas here, what else can I try to get ANY usb example to work.
It looks like the site might be back up - www.rkeducation.co.uk/RKPK28.php - and a schematic is available at http://rkeducation.co.uk/images/Schematics/rkpk28schematicsheet1.jpg.

As for the USB - have you connected D+/D- to RC5/RC4?
 

Offline JTR

  • Regular Contributor
  • *
  • Posts: 107
  • Country: au
Re: 18F2550 and USB
« Reply #25 on: February 17, 2014, 12:45:59 pm »
and a schematic is available at http://rkeducation.co.uk/images/Schematics/rkpk28schematicsheet1.jpg.

What an awful circuit. 3.3V regulator taps off the 12V output and not the 5V output. No diode across the 7805 to protect against USB power > input terminal. No cap on Vusb, wrong crystal speed (for USB) on circuit diagram.

OK, I'm going to stop now.
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: 18F2550 and USB
« Reply #26 on: February 17, 2014, 12:59:39 pm »
After a longer brake from this mess, I finally obtained a development board for the 18F2550, it is the RKPK28.
Guess what!
None of the examples work, and the site of that dev board is dead!

The pickit2 programs the board, but nothing happens, widows don't give any signs of activity, not even an unknown device. Nothing, as if I plugged the usb cable in a brick.

I am out of ideas here, what else can I try to get ANY usb example to work.

http://www.picbasic.co.uk/forum/showthread.php?t=5418
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #27 on: February 17, 2014, 04:29:56 pm »
As for the USB - have you connected D+/D- to RC5/RC4?

I did that now, when the website finally decided to come up again.
I got the thing without any instructions whatsoever.

Ok, I now soldered the two wires, and progress! Now I get an unrecognized usb device for every example!

Also, it came with a 16MHz ceramic filter, and not with a 10MHz crystal.

What an awful circuit. 3.3V regulator taps off the 12V output and not the 5V output. No diode across the 7805 to protect against USB power > input terminal. No cap on Vusb, wrong crystal speed (for USB) on circuit diagram.
OK, I'm going to stop now.
Indeed, if I want to turn the thing off, I have to unplug the usb.
No Vusb? So I have to add even that?

Is this a dev board or a figure it out yourself board?

Anyway, what is the right frequency for most of the examples? 20MHz, 4MHz?

Edit: That USB demo doesn't work on win 7.


Edit2: I fixed the thing, and tried this demo (20MHz osc, and added vusb cap):
http://projectproto.blogspot.com/2009/11/pic18f2550-usb-hid-mouse.html

Of course, I just get an unknown device...
« Last Edit: February 17, 2014, 05:00:47 pm by Dajgoro »
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Re: 18F2550 and USB
« Reply #28 on: February 17, 2014, 08:42:32 pm »
An "unknown device" error can be the D+ and D- wires swapped. or one of them shorted to 0V.  Might not be the case here, but worth checking.
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #29 on: February 17, 2014, 09:23:05 pm »
An "unknown device" error can be the D+ and D- wires swapped. or one of them shorted to 0V.  Might not be the case here, but worth checking.
I checked once again, it is ok.
 

Offline diyaudio

  • Frequent Contributor
  • **
  • !
  • Posts: 683
  • Country: za
Re: 18F2550 and USB
« Reply #30 on: February 17, 2014, 09:57:02 pm »
Quote from: Dajgoro
is there a very simple usb demo that is known 100% that it works with a schematic, hex files and fuse settings?

Hi,

Some time ago, about two years ago I successfully got a PIC-4550 to run the USB microchip stack see attachment (I developed a novel 4 channel multimeter (client written in C# .NET) to measure AAA batteries), I must say the USB stack was challenging to get working and it still is cause so much can go wrong and its very bloated (to run all the families using one build)

Here are some tips (things I did as to get my project working)

1) Use the demo supplied example code, unmodified, try out the CDC basic demo its a simple USB to SERIAL demo and it works ! (in fact I used that as a skeleton for my project as I was unable to move, USB library dependences to a custom directory, I used the demo, with all the correct includes )

2) Have you installed the microchip "mchpcdc.inf" driver ?? You must install this driver else no USB communication is established. it comes with the SDK read the demo setup documents.

3) Breadboard a test fixture, as the members already  probably described check your connections, I had issues with D-, D+ not making contact with the pins of the PIC resulting in communication issues, so check that out.

4) If you use the " CDC basic demo" you don't need to compile, the SDK comes supplied with the HEX file (pre-built), I would recommend you learn to recompile "tear it apart" and strip it down for one family, like a PIC 4550, 2550 so its bit bit cleaner. (I did this cause at the time I was learning that processor)
 
 

Consider this, it took two weeks to get this working and it was fun and $#e%$# at the same time. :)

Good luck.


   
« Last Edit: February 17, 2014, 10:10:49 pm by diyaudio »
 

Offline Anks

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: gb
    • www.krisanks.wordpress.com
Re: 18F2550 and USB
« Reply #31 on: February 17, 2014, 10:12:35 pm »
I got the microchip and the DP open source stack to work recently and even ported part of the code to another pic. I lost a hard drive and due to the pain I wont be doing it again.

Im just going to use a different micro for usb in future.
 

Offline diyaudio

  • Frequent Contributor
  • **
  • !
  • Posts: 683
  • Country: za
Re: 18F2550 and USB
« Reply #32 on: February 17, 2014, 10:19:46 pm »
I got the microchip and the DP open source stack to work recently and even ported part of the code to another pic. I lost a hard drive and due to the pain I wont be doing it again.

Im just going to use a different micro for usb in future.

Yeah I saw that one. never used the DP stack yet, The microchip forum is filled with people complaining about the usb bloat. 

I prefer now using a FTDI for serial stuff it just works. I have never used the USB protocol.
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #33 on: February 18, 2014, 12:16:04 am »
Aaaaaaaaaannnnnnnnnnddddddddd, nothing!  :-BROKE

I installed the sdk and demo pack a long time ago when I first tried poking with the thing.
I tried the CDC demo, once again, and nothing.
MPLAB X changed his mind, and now it won't recognize the libraries of the examples once again.
I managed to fix that a while ago, but Mplabx changed his mind once again.

About mchpcdc.inf, I've tried to install it once again, but how do I install that, installing via windows just gives me a big error.
 

Offline daveshah

  • Supporter
  • ****
  • Posts: 356
  • Country: at
    • Projects
Re: 18F2550 and USB
« Reply #34 on: February 18, 2014, 09:19:18 am »
Also, it came with a 16MHz ceramic filter, and not with a 10MHz crystal.
I seem to remember having a lot of trouble with a PIC-based USB device that used a ceramic resonator rather than a crystal not being recognised (not sure whether the problem was accuracy or stability), so if you have a 16MHz crystal available you could try replacing it.

I think I got the aforementioned device working in the end on an older laptop running Windows XP, so that might be another option.
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: 18F2550 and USB
« Reply #35 on: February 18, 2014, 10:26:05 am »
I would recommend this simple tool http://www.uwe-sieber.de/usbtreeview_e.html to separate bus level errors from OS/inf/driver problems - if you don't see your correct vid/pid/speed there, then no need to waste time on PC side, your device is unable to send device descriptor to be recognized
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #36 on: February 18, 2014, 04:00:12 pm »
I would recommend this simple tool http://www.uwe-sieber.de/usbtreeview_e.html to separate bus level errors from OS/inf/driver problems - if you don't see your correct vid/pid/speed there, then no need to waste time on PC side, your device is unable to send device descriptor to be recognized
I ran the program, and I got this:
Code: [Select]
    =========================== USB Port4 ===========================

Connection Status        : Device failed enumeration
Port Chain               : 6-4

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : Unknown Device
Device ID                : USB\VID_0000&PID_0000\5&4A9E079&0&4
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0060 (GUID_DEVCLASS_USB)
Legacy BusType           : PNPBus
Class                    : USB
Service                  :
Enumerator               : USB
Location Info            : Port_#0004.Hub_#0006
Manufacturer Info        : (Standard USB Host Controller)
Capabilities             : Removable, RawDeviceOK
Address                  : 4
Problem Code             : 43 (CM_PROB_FAILED_POST_START)
Power State              : D3 (supported: D0, D2, D3, wake from D0, wake from D2)

        ---------------- Connection Information ---------------
Connection Index         : 0x04
Connection Status        : 0x02 (DeviceFailedEnumeration)
Current Config Value     : 0x00
Device Address           : 0x00
Is Hub                   : 0x00 (no)
Number Of Open Pipes     : 0x00 (0)
Device Bus Speed         : 0x00 (Low-Speed)

        ------------------ Device Descriptor ------------------
bLength                  : 0x00 (0 bytes)

Edit: On the other hand, I am using a Pickit2 for programming the thing, and in there is the 18F2550, and the pickit works fine.

Edit2: As I already wrote, I replaced the filter with a 20MHz crystal to suit the demo.
I have a stack of crystals, so I can set it to any frequency, depending on the requirements.
« Last Edit: February 18, 2014, 04:06:48 pm by Dajgoro »
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: 18F2550 and USB
« Reply #37 on: February 18, 2014, 06:23:46 pm »
Enumeration failed, no communication at all (vid/pid/device desc size are all 0), so the problem is on device side. Your code is running (pullup gets activated, otherwise you'll not see any device attach at all), but some setup is wrong (clocking, D+/D- polarity - try swapping them just be sure, I've spent a day tweaking my first USB device being 100% sure that it has correct polarity, then swapped D+/D- desperately and it started to work :))
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: 18F2550 and USB
« Reply #38 on: February 18, 2014, 07:06:05 pm »
Enumeration failed, no communication at all (vid/pid/device desc size are all 0), so the problem is on device side. Your code is running (pullup gets activated, otherwise you'll not see any device attach at all), but some setup is wrong (clocking, D+/D- polarity - try swapping them just be sure, I've spent a day tweaking my first USB device being 100% sure that it has correct polarity, then swapped D+/D- desperately and it started to work :))
:rant: :rant: :rant:
 :palm:
...

Yup, the D+ D- marks on the pcb are reversed.
It works now.
At least the basic demo, still a long way to go to get a compiled code to work...
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Re: 18F2550 and USB
« Reply #39 on: February 18, 2014, 09:55:51 pm »
See, what did I say?  There's a reason I never assume anything.  Hopefully lesson leaned.   ::)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf