Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

USB interfacing with 16 bit microcontroller

Status
Not open for further replies.
E

expertengr

Guest
I am wondering how much data rate to computer can be achieved practically using a 16 bit microcontroller which has build in USB FS module that can offer 12 M bits per second. In theory if in microcontroller one sample consists of 12 bits then 1 M sample per sample can be received in computer. Please let me know if this is correct ?
 

You are forgetting about the overhead of the USB protocol, in practice with 12Mbits second you will get around 0.75MBytes second.
 

Thanks for reply. Is there any software which can log the received data from micro controller 18PIC2550 in computer ?
 

Thanks for reply. Is there any software which can log the received data from micro controller 18PIC2550 in computer ?

I use a program such as Hyperterminal or Realterminal to save the data to a file.
 

Missing link: Which USB device type are you going to implement? Terminal program is right for CDC (communication device class), in other words virtual COM port.
 

Yes virtual COM port. Can I use Tera Term to download the data in computer ? Can I achieve 0.75MBytes per second with 18PIC2550 ?
 

I'm not sure how fast the Tera Term interface to COM device driver is, but I guess it's not the bottle neck. Otherwise you can modify the code. The USB firmware on the PIC side must fill up the USB packets to utilize the available bandwidth.
 

By using the USB interface as a virtual com port you will be limited to 926100 baud which is 0.09261 MB/S
 

By using the USB interface as a virtual com port you will be limited to 926100 baud which is 0.09261 MB/S
No. Virtual COM port baud rate has only a meaning if you connect to a real UART device and rely on setting standard Windows baud rates through SetCommState() API function. An USB device without real UART will simply ignore the baud rate set requests.

USB-to-UART bridges can set non-standard baud rates through SetCommState() by redefining Windows baud rate (review respective FTDI instructions) or using vendor specific USB drivers like the FTDI D2XX to connect to the device.
 

No. Virtual COM port baud rate has only a meaning if you connect to a real UART device and rely on setting standard Windows baud rates through SetCommState() API function. An USB device without real UART will simply ignore the baud rate set requests.

USB-to-UART bridges can set non-standard baud rates through SetCommState() by redefining Windows baud rate (review respective FTDI instructions) or using vendor specific USB drivers like the FTDI D2XX to connect to the device.

That is true, but what terminal program will you use to capture the data? If you use a terminal program you are limited to the standard Windows baud rates.
 

The terminal programs don't care for the baud rate, except for setting it in USB device.
 

The terminal programs don't care for the baud rate, except for setting it in USB device.

I am not so sure that this would work, but I have not tried it, have you?
 

Hi,

Yes, I've tried that with FT245BM, FT245RL, FT2232H (in parallel FIFO mode).... FvM is correct.

Klaus
 
Again same question if I configure 16F2550 in USB FS module. Can I use Tera Term to download data in computer ? If yes then how much the data rate should I expect maximum ? Can I get higher data rate by using some other terminal for example PuTTY ?
 

Hi,

With a FT245 and the VCP drivers we achieved about 300kByres/s max.
Independent of terminal program.

Klaus
 

I read from the data sheet of PIC18F2550 that USB module require Primary Clock i.e., external clock source of 48 MHz for Full Speed operation.

I am wondering if I can use QX3 HCMOS Clock Oscillator to get 48 MHz frequency for USB module. I don't see any circuit in the data sheet to tune or set the frequency to 48 MHz. Any suggestions or comments ?

http://www.qantek.com/tl_files/products/oscillators/QX3.pdf
 

The usual option is to generate the USB clock with a crystal in HSPLL mode. Please review the datasheet for useable crystal frequencies, 16 MHz is my choice in many USB applications.

- - - Updated - - -

See TABLE 2-3: OSCILLATOR CONFIGURATION OPTIONS FOR USB OPERATION
 

I read from the data sheet of PIC18F2550 that USB module require Primary Clock i.e., external clock source of 48 MHz for Full Speed operation.

I am wondering if I can use QX3 HCMOS Clock Oscillator to get 48 MHz frequency for USB module. I don't see any circuit in the data sheet to tune or set the frequency to 48 MHz. Any suggestions or comments ?

You can set the internal source to 48MHz with different (there is a table in the document- just download it and look in the USB section) multipliers and dividers that can be used for different external crystals. Of course any arbitrary crystal freq will not work.
 

multipliers ? I guess we can divide the clock by a factor of two and so on but multiplying a clock I am not sure if it is really possible. Let's take an example of PIC18F2550 which need clock source of 48 MHz for Full Speed USB operation. The internal clock is 8 MHz. Can we get 48 MHz internally by using multipliers ?
 

multipliers ? I guess we can divide the clock by a factor of two and so on but multiplying a clock I am not sure if it is really possible. Let's take an example of PIC18F2550 which need clock source of 48 MHz for Full Speed USB operation. The internal clock is 8 MHz. Can we get 48 MHz internally by using multipliers ?

Please take a look at the documentation: https://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf

In particular, see Fig 2.1, Table 2.3 and the Fig 17.1.

The external clock can be only few selected ones but you need to go through the documentation (it is massive)
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top