USB 18F2550 Problem


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default USB 18F2550 Problem

    I went from the 4550 to the 2550 and have an interesting problem.
    Went back to the basics http://www.picbasic.co.uk/forum/showthread.php?t=5806 and I still do not see what I am doing wrong.

    In order for the device to connect I have to move the USBINIT below the FOR/NEXT loop...If USBINIT is in the "correct" place the device will not connet.
    Doing that the device connects and will send data but the data looks like this.
    ` ($#_H! c 8 X- &X6USB CONNECTED!
    The same happens on a 32 or 64 bit machine.
    I have a 1.0uF cap on VUSB and I am running the chip at 3.3 volts as I do with a 4550.
    The machine I am on tonight is running PBP 2.50
    The code.
    Code:
    'USB_2550 
    @ __CONFIG   _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L 
    @ __CONFIG   _CONFIG1H, _FOSC_HSPLL_HS_1H
    @ __CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H 
    @ __CONFIG    _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H
    @ __CONFIG    _CONFIG4L, _LVP_OFF_4L  
    DEFINE    OSC 48
    
    Buffer    VAR BYTE[16]
    Cnt       VAR BYTE
    B0        VAR BYTE
    B1        VAR BYTE
    
    ADCON1 = 15               ' Set all I/Os to Digital      
    CMCON = 7                 ' Disable Comparators
    Cnt = 16 
      
    for b0 = 0 to 15
        lookup b0,["USB CONNECTED!",10,13],B1 
        BUFFER(B0) = B1
        NEXT B0
     USBINIT 
    ' Main Program Loop
    Loop:
        USBService        ' Must service USB regularly
        USBOut 3, Buffer, Cnt, loop
        goto loop
    END
    Same code, same machine(s) with a 4550 works fine.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    644

    Default

    Quote Originally Posted by mackrackit View Post
    I have a 1.0uF cap on VUSB and I am running the chip at 3.3 volts as I do with a 4550.
    Hi,

    I don't think you need a cap on VUSB when Vcc=3.3V. I connected VUSB to 3.3V directly when using Vcc=3.3V, and it works great. Do you have the internal regulator disabled?

    Robert
    Name:  USB-Reg.GIF
Views: 912
Size:  24.2 KB
    Last edited by rsocor01; - 5th August 2010 at 21:29.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    If the regulator is not off by default then I guess not
    I hope to be someplace tonight where I can look into that.
    Thanks!
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Like I say, once a newbie always a newbie.

    Robert,
    Your suggestion made me go back and look at the configs.
    Here is my new set. That part that fixed it is in red. No other changes were made.
    Thank you!!
    Code:
    @ __CONFIG   _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    @ __CONFIG   _CONFIG1H, _FOSC_HSPLL_HS_1H
    @ __CONFIG   _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H  
    @ __CONFIG   _CONFIG2L, _PWRT_ON_2L & _VREGEN_ON_2L   
    @ __CONFIG   _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H  
    @ __CONFIG   _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    644

    Default

    Quote Originally Posted by mackrackit View Post
    Like I say, once a newbie always a newbie.
    I'm the newbie here . I still have to learn a lot from you guys .

    Did you fix the problem by disabling the internal regulator and by feeding 3.3V to VUSB? Did that fix the problems?

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    The problem was fixed by adding this to the configs
    _XINST_OFF_4L
    And I made sure the internal regulator is on to feed the internal USB pullups.

    Power wise I am running the chip at 3.3 so the only thing I have connected to VUSB is the capacitor to VSS.

    Now I do have some more reading to do as there is mention in the data sheet about VDD has to be higher than VUSB.
    But it is working for now. Long term ????

    Newbies---- IMHO Compared to two or three here we all are some newbie. But we can learn from anyone if we care to listen.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    644

    Default

    Well, I have a different setup. I disabled the internal regulator and fed 3.3V directly to VUSB. I assume the internal pullup resistors are enabled because my setup works fine. Otherwise, if they were disabled the USB interface wouldn't work because I believe the pullups are a requirement for USB.

    I think the internal regulator function is to convert Vcc=5V to 3.3V which is necessary by the USB module. But, since you already have the 3.3V, then why the need to use the internal regulator?


    Quote Originally Posted by mackrackit View Post
    Now I do have some more reading to do as there is mention in the data sheet about VDD has to be higher than VUSB.
    But it is working for now. Long term ????
    I have been through that pain already . Take a look at post# 4 in the following link.

    http://www.microchip.com/forums/tm.a...&high=rsocor01

    Please, let me know if you find out something else about this whole thing.

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts