Searching \ for '[PIC] Max USB transfer speed for an 18F85J50?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=18F
Search entire site for: 'Max USB transfer speed for an 18F85J50?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Max USB transfer speed for an 18F85J50?'
2010\12\22@190333 by Philip Pemberton

face
flavicon
face
Quick question -- what's the fastest anyone's managed to transfer data from a PIC18F85J50 to or from a PC, using USB?

After a heck of a lot of protocol tweaks and the addition of double-buffering (which netted me another 20 kbytes/sec), I'm up to a shade under 220 kbytes/sec. Is this about right for a chip with the PLL on and a core clock of 48MHz?

The data is being sourced from the Parallel Master Port -- data either goes from USB to PMP, or the other way.

The source code is online at http://hg.discferret.com/firmware/ for the curious. This includes a patch to the Microchip USB Stack which adds a 'special' string descriptor that reads the device serial number from the end of the bootloader block of the Flash.

Thanks,
-- Phil.
spam_OUTpiclistTakeThisOuTspamphilpem.me.uk
http://www.philpem.me.uk

2010\12\22@193357 by Michael Watterson

face picon face
On 23/12/2010 00:03, Philip Pemberton wrote:
> Quick question -- what's the fastest anyone's managed to transfer data
> from a PIC18F85J50 to or from a PC, using USB?
>
> After a heck of a lot of protocol tweaks and the addition of
> double-buffering (which netted me another 20 kbytes/sec), I'm up to a
> shade under 220 kbytes/sec. Is this about right for a chip with the PLL
> on and a core clock of 48MHz?
>
> The data is being sourced from the Parallel Master Port -- data either
> goes from USB to PMP, or the other way.
>
> The source code is online at http://hg.discferret.com/firmware/ for the
> curious. This includes a patch to the Microchip USB Stack which adds a
> 'special' string descriptor that reads the device serial number from the
> end of the bootloader block of the Flash.
>
> Thanks,

It's only USB 1.1 not USB 2.0

USB speeds are fantasy. Nothing gets close to supposed speed.

PIC 18F uses 24MHz USB clock = 12MHz peak data rate of USB 1.1
There is CRC overhead on every packet
It's half duplex

220kByte/s is about 1.7Mbps  Not bad really. maybe you might get 4 to 6Mbps on USB 1.1 if really clever. Only one data connection, so any data transfer can only use a proportion of the speed with protocol overhead, TX/RX change over and CRC etc.

<< USB 1.1 has a theoretical throughput of 12 Mbps, or 1.5 MB/sec . In practice, the fastest you're likely to see is less than 8 Mbps [but it's half duplex]. This discrepancy arises because the USB controller reserves a portion of the bandwidth for non-data use and because USB uses bit stuffing, a technique that mixes filler bits with the actual data to simplify the system. >>

I've also seen "real world" speeds for USB 1.1 of  5.4Mbits/s average throughput (about 6.1Mbits/s peak)  quoted.



Also the CPU is 12MIPS peak with 48MHz clock. i.e. if you doing 6 instructions per byte transferred = 2Mbps.
So other than streaming Parallel port mode you are not going to get  anywhere near full 1.1 speed.

So 220k bytes /sec doesn't sound too bad.

2010\12\22@193627 by Michael Watterson

face picon face
On 23/12/2010 00:03, Philip Pemberton wrote:
> Quick question -- what's the fastest anyone's managed to transfer data
> from a PIC18F85J50 to or from a PC, using USB?
>
> After a heck of a lot of protocol tweaks and the addition of
> double-buffering (which netted me another 20 kbytes/sec), I'm up to a
> shade under 220 kbytes/sec. Is this about right for a chip with the PLL
> on and a core clock of 48MHz?
>
> The data is being sourced from the Parallel Master Port -- data either
> goes from USB to PMP, or the other way.
>
> The source code is online at http://hg.discferret.com/firmware/ for the
> curious. This includes a patch to the Microchip USB Stack which adds a
> 'special' string descriptor that reads the device serial number from the
> end of the bootloader block of the Flash.
>
> Thanks,

I think the max speed USB 1.1 will do in reality with wind behind it, down hill is about 780 k Bytes /s

Assuming 24MHz USB clock = 12Mbps data rat

2010\12\22@200452 by Oli Glaser

flavicon
face
On 23/12/2010 00:03, Philip Pemberton wrote:
> Quick question -- what's the fastest anyone's managed to transfer data
> from a PIC18F85J50 to or from a PC, using USB?
>
> After a heck of a lot of protocol tweaks and the addition of
> double-buffering (which netted me another 20 kbytes/sec), I'm up to a
> shade under 220 kbytes/sec. Is this about right for a chip with the PLL
> on and a core clock of 48MHz?
>
> The data is being sourced from the Parallel Master Port -- data either
> goes from USB to PMP, or the other way.
>
> The source code is online at http://hg.discferret.com/firmware/ for the
> curious. This includes a patch to the Microchip USB Stack which adds a
> 'special' string descriptor that reads the device serial number from the
> end of the bootloader block of the Flash.
>
> Thanks,

Difficult one - 220K sounds reasonable to me but you could maybe push it a bit faster. ~1MB per sec is the theoretical max with no other bus activity for bulk/isochronous transfers (which you are probably aware of), but in practice much slower. I've seen umpteen discussions on this subject with claims of up to 800K or so, but that's probably with the PIC doing nothing else.
Will be looking at similar myself very shortly with my 18F24J50/FPGA board, I need pretty good speeds there - will let you know if I manage anything different. Mind you, if I needed much faster I would probably just use something with high speed capabilities (different MCU or add on a Cypress or FTDI IC) rather than trying to tweak the full speed excessively.

Sure Xiaofan would have some good input here.. :-)


2010\12\22@203507 by Xiaofan Chen

face picon face
On Thu, Dec 23, 2010 at 9:04 AM, Oli Glaser <.....oli.glaserKILLspamspam@spam@talktalk.net> wrote:
> On 23/12/2010 00:03, Philip Pemberton wrote:
>> Quick question -- what's the fastest anyone's managed to transfer data
>> from a PIC18F85J50 to or from a PC, using USB?
>>
> Sure Xiaofan would have some good input here.. :-)
>

www.microchip.com/forums/fb.ashx?m=281705
http://www.microchip.com/forums/tm.aspx?m=417509

Oli is right that you can achieve around 1MB/sec when the PIC
is doing nothing else. I've tested that with a PIC18F87J50 using
the libusbdotnet benchmark firmware and the host test program.

http://www.microchip.com/forums/tm.aspx?m=417509

More about this topic.
http://www.microchip.com/forums/m123533-p2.aspx

libusbdotnet:
http://sourceforge.net/projects/libusbdotnet/

-- Xiaofa

2010\12\22@204649 by Philip Pemberton

face
flavicon
face
On 23/12/10 00:35, Michael Watterson wrote:
> I think the max speed USB 1.1 will do in reality with wind behind it,
> down hill is about 780 k Bytes /s

And possibly a JATO rocket gaffer-taped to the roof :)

Well, it's nice to know I've probably hit the limit (though it would have been nice to hit 300kbps). Now I can go back to playing with the API and the FPGA microcode. Fun!

In any case, I'm looking at about 0.6secs per disc track just to read the data off the disc, plus however long it takes to poll the status flags from the PC. Even if I had this thing tied to a USB High Speed device controller (Cypress EZ-USB for example), it's not likely to go much quicker...

Thanks,
-- Phil.
piclistspamKILLspamphilpem.me.uk
http://www.philpem.me.uk

2010\12\23@050803 by alan.b.pearce

face picon face
> Quick question -- what's the fastest anyone's managed to transfer data
> from a PIC18F85J50 to or from a PC, using USB?
>
> After a heck of a lot of protocol tweaks and the addition of
> double-buffering (which netted me another 20 kbytes/sec), I'm up to a
> shade under 220 kbytes/sec. Is this about right for a chip with the PLL
> on and a core clock of 48MHz?
>
> The data is being sourced from the Parallel Master Port -- data either
> goes from USB to PMP, or the other way.
>
> The source code is online at http://hg.discferret.com/firmware/ for the
> curious. This includes a patch to the Microchip USB Stack which adds a
> 'special' string descriptor that reads the device serial number from the
> end of the bootloader block of the Flash.
>
> Thanks,
> --
> Phil.

The host computer also has a lot to do with the maximum transfer rate.

I was using an Explorer 16 dev board with PIC24FJ256GB110 to do some demonstration of the fastest transfer rate I could get using the Microchip CDC code. Using my desktop quad core machine with Windows 7 64 bit I could get the maximum rate that CDC will do, but the identical code in the PIC would attempt to send faster than my dual core laptop running Vista 64 would handle..
-- Scanned by iCritical.

More... (looser matching)
- Last day of these posts
- In 2010 , 2011 only
- Today
- New search...