USB 18F4550 in High or full speed???


Closed Thread
Results 1 to 9 of 9
  1. #1
    Jonathan Orrego's Avatar
    Jonathan Orrego Guest

    Question USB 18F4550 in High or full speed???

    Hi!
    I want to make a hobby pc osciloscope using the 18F4550.

    I downloaded the EasyHID, tested and works right (i commented the receive routine because i will only transfer data to the pc).

    But its too slow....
    I implemented a counter in the vb application, the result is that the pbp application generated with easyusb takes 8 secs. to transfer 1000 packets of 8 bytes each.
    The stange thing is that if i use easyhid again, but this time i specify 64 bytes per packet, it takes exactly the same ammount of time to transfer 1000 packets of 64 bytes.

    1) Is there some PBP code that shows how to configure and use the full or high speed (not HID)?
    2) Does the PicBasic instructions USBIn and USBOut works with full or high speed?

    Thanks a lot

    Jonathan Orrego
    Buenos Aires, Argentina

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185

    Default

    Hi Jonathan ,

    Did you search the forum for USB?

    Enter "USBIN" into the search box and see the results.
    Enter "USBOUT" into the search box and see the results.

    You will have plenty of examples & ideas.

    Check this first.

    http://www.picbasic.co.uk/forum/show...ighlight=USBIN
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Jun 2005
    Posts
    29

    Default

    Have a look at this page

    http://www.semifluid.com/?p=24

    He also made a Graphic LCD version. This is not in PicBasic but it will show you the limitation of the internal A/D inside the PIC.

  4. #4
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by Jonathan Orrego
    Hi!
    I want to make a hobby pc osciloscope using the 18F4550.

    I downloaded the EasyHID, tested and works right (i commented the receive routine because i will only transfer data to the pc).

    But its too slow....
    I implemented a counter in the vb application, the result is that the pbp application generated with easyusb takes 8 secs. to transfer 1000 packets of 8 bytes each.
    The stange thing is that if i use easyhid again, but this time i specify 64 bytes per packet, it takes exactly the same ammount of time to transfer 1000 packets of 64 bytes.

    1) Is there some PBP code that shows how to configure and use the full or high speed (not HID)?
    2) Does the PicBasic instructions USBIn and USBOut works with full or high speed?

    Thanks a lot

    Jonathan Orrego
    Buenos Aires, Argentina

    About the USB taking the same amount of time to transfer 8 times the data.......
    If I remember my USB particulars right, the internals of the USB fire off an 'event' every 1ms or so. If there's data in the buffer, it gets transferred, if not, no transfer. However, the kicker to this is the internal buffer. If the internal buffer gets filled up before the 1ms timer goes off, it transfers anyways. So, basically, the bigger the blocks, the faster the transfer. Use the biggest blocks you can get away with and fill the extra space with dummy data. Depending on the application, the block size will vary. As an example, I was able to build a USB transferring device using a PIC18F4620 and an FTDI chip. I could easily get over 600KB/second as long as my block size at the PC end was above 4K (give or take, any larger didn't provide any speed gains). But if I set my block size very small, say 64 bytes like you have, the speed dropped dramatically.
    Hope this made sense. And like I said earlier, I'm a bit rusty on my USB particulars...
    JDG

  5. #5
    Join Date
    Jul 2008
    Location
    Now, I live in Tokyo, Japan
    Posts
    6

    Unhappy Full speed USB using PIC18F

    Personally, I think Toley00 and Skimask misunderstand the problem of
    Jonathan Orrego because the limitation of sending the data via USBOUT
    with EndPoint #1 are not from the speed of ADC. The conversion speed
    of ADC is faster than the USB speed we can archieve (64 kbit/s).
    Moreover, we can only use a packet of 64Byte at maximum in PIC, so
    we cannot increase our speed by using a packet size of 4k.

    So, our question is how to increase the speed of USB from 64 kbit/s
    to basic speed or high speed or full speed ? In PBP compiler, there
    is no option/parameter to select/change the speed, so what can we do?

    Best regards,

  6. #6
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by lengcallrobot View Post
    Personally, I think Toley00 and Skimask misunderstand the problem of Jonathan Orrego because the limitation of sending the data via USBOUT with EndPoint #1 are not from the speed of ADC. The conversion speed of ADC is faster than the USB speed we can archieve (64 kbit/s). Moreover, we can only use a packet of 64Byte at maximum in PIC, so we cannot increase our speed by using a packet size of 4k.
    So, our question is how to increase the speed of USB from 64 kbit/s to basic speed or high speed or full speed ? In PBP compiler, there is no option/parameter to select/change the speed, so what can we do?
    Maybe, but since that post was over 1 1/2 years ago, I don't really remember what the problem was in the first place.

    True, packet size is limited, and again, you're limited by the number of events you can fire off in X time, and limited by how fast the firmware can reload the buffer with useful data.

    But again, as mentioned in the other post, the PICs are not capable of high speed (480mbps) mode, so you're limited to FULL speed (12mbps) mode at best.
    If the buffer is limited to 64 bytes, and you're limited to 1ms per xfer event, then, there's you're limit...64kB/sec.
    I guess I don't really know if you can go faster than that on a PIC. I assume it's possible, but don't know. As I posted last year, I've been able to max out FULL speed mode, just barely.

  7. #7
    Join Date
    Jul 2008
    Location
    Now, I live in Tokyo, Japan
    Posts
    6

    Default

    Quote Originally Posted by skimask View Post
    Maybe, but since that post was over 1 1/2 years ago, I don't really remember what the problem was in the first place.

    True, packet size is limited, and again, you're limited by the number of events you can fire off in X time, and limited by how fast the firmware can reload the buffer with useful data.

    But again, as mentioned in the other post, the PICs are not capable of high speed (480mbps) mode, so you're limited to FULL speed (12mbps) mode at best.
    If the buffer is limited to 64 bytes, and you're limited to 1ms per xfer event, then, there's you're limit...64kB/sec.
    I guess I don't really know if you can go faster than that on a PIC. I assume it's possible, but don't know. As I posted last year, I've been able to max out FULL speed mode, just barely.
    Thank for your post, however, for other friend and me, we can only send the data at 64kbit/s which is too slow comparing to Low-speed (1.5Mbit/s) or Full-speed (12Mbit/s).

    My question now is: How to configure the PIC to run at Low-speed mode or Full-speed mode? (I use PBP and VB6).

  8. #8
    skimask's Avatar
    skimask Guest

    Default

    One other option that doesn't take too many pins and has very little hardware hassle is the CP2103 type USB/Serial converter chips. They work great and they can be configured to go pretty fast.

  9. #9
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    My question now is: How to configure the PIC to run at Low-speed mode or Full-speed mode?
    Look in your USB.TXT file. There's a section that explains how to run at full-speed and
    low-speed.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. 18F4550 full speed
    By gigel in forum USB
    Replies: 2
    Last Post: - 14th July 2008, 21:26
  4. Replies: 14
    Last Post: - 26th September 2007, 05:41
  5. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37

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