CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

what is the max speed of this UART function

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lgeorge123



Joined: 05 Dec 2004
Posts: 31

View user's profile Send private message

what is the max speed of this UART function
PostPosted: Mon Feb 01, 2010 3:15 am     Reply with quote

I am using ft232BM ( virtual com port IC) and 18f4550 and connect to pc usb port. Under the following codes what is the speed of the transfer rate in baud rate ? If I set the baud rate in 1M , will it transfer in this rate ?

Code:
#include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=48000000)
#use rs232(UART1, baud=1000000, errors)

void main(void)
{
char c;

setup_adc( ADC_CLOCK_INTERNAL );
setup_adc_ports( ALL_ANALOG );
set_adc_channel(1);

while(1)
  {
   c= read_adc();
   putc(c);
  }

}
Ttelmah
Guest







PostPosted: Mon Feb 01, 2010 5:29 am     Reply with quote

The bytes will clock in/out at 1000000Hz.
However, the actual overall transfer 'speed' will be well below this, limited by several things, primarily:
1) How fast you can load a new byte, after one is sent.
2) How fast the data can actually be transferred over USB.

FTDI, claim 1Mb/sec using the D2XX drivers, but only 300KB/sec with the VCP drivers. Since you talk about using the virtual com port, you are using the latter. Even this speed will be dependant on what else is being done on the USB bus at the time.
Then you also have the qustion of wheher the physical connection between the PIC, and the STDI chip, can handle 1MHz. It will, provided the lines are reasonably laid out, but if there is significant length, or you start using RS232 transceivers, then 'no'...

Best Wishes
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Feb 01, 2010 7:50 am     Reply with quote

The requested speed is 1 MBit/s which is < 300kByte/s. Handling this throughput by the PIC18
application may be still an issue. Also at the PC side, the driver interface should be well-considered.
Ttelmah
Guest







PostPosted: Mon Feb 01, 2010 8:08 am     Reply with quote

No, should be lower case 'b' for the second. 300Kb/sec. Shift key slipped....
If you notice, it is correct for the 1Mb/sec on the first driver, and this will be faster than the VCP driver.
If you think about the packet overhead of the VCP driver, and it's priority on USB, this makes good sense.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group