Sure thing brother,
Play around with the baud rates and see what max data speed you get. 250K would be awesome! but I think some sought of hardware hand shaking is needed to get up to those speeds. Hahaha
Anyway, first step I think is to increase the buffer size form 1 char to as DT said, about 64 Chars.
CheersCode:'**************************************************************** INCLUDE "DT_INTS-18.bas" ; Base Interrupt System INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts ' USB sample program for PIC18F4550 CDC serial port emulation ' Compilation of this program requires that specific support files be ' available in the SOURCE DIRECTORY!! ' 18F*.BAS Device header files that use the USB libraries ' CDCDESC.ASM Descriptor file for CDC serial demo ' JADESC.ASM Descriptor file for Jan Axelson demo ' MOUSDESC.ASM Descriptor file for mouse demo ' PBPCDC.INF INF file for the CDC serial driver ' USB.TXT This file ' USB18.ASM USB assembler file ' USB18.INC USB definitions file ' USB18MEM.ASM USB memory allocation file ' USBCDC.BAS CDC serial demo BASIC program file ' USBDESC.ASM Include file for descriptor file ' You WILL also need to modify the ' file USBDESC.ASM so that the only line used is -> include "CDCDESC.ASM" ' MUST use the 4 MHz xtal for this. ' this program receives data via usb virtual port then sends out via serial ' usart. ' USART module ' ------------ Define OSC 48 DEFINE HSER_RCSTA 90h DEFINE HSER_TXSTA 20h DEFINE HSER_BAUD 4800 DEFINE HSER_CLROERR 1 ' USB module ' ---------- UCFG var byte EXT ' include UCFG register... Yeah Melabs didn't :o( ucfg = %00010100 ' enable internal USB pull-up, Full speed USB ' ANALOG I/O CONFIG ' ----------------- ADCON1 = 15 ' Set all I/Os to Digital CMCON = 7 ' Disable Comparator Buffer VAR BYTE[16] Cnt VAR BYTE B0 VAR BYTE ASM INT_LIST macro ; IntSource,Label,Type,ResetFlag? INT_Handler RX_INT,_SendUsB,PBP,yes endm INT_CREATE ; Creates the interrupt processor INT_ENABLE RX_INT ; enable external (RX) interrupts ENDASM USBInit ' Main Program Loop MainLoop: USBService ' Must service USB regularly Cnt = 16 USBIn 3, Buffer, Cnt, MainLoop HSEROUT [STR Buffer\Cnt] GOTO Mainloop '---[RX_INT - interrupt handler]------------------------------------------------ ' PROGRAM COMES HERE WHEN DATA ENTERS THE USART PORT SendUsB: HSERIN [B0] Buffer[0] = b0 cnt = 1 OutLoop: USBService ' Must service USB regularly USBOut 3, Buffer, Cnt, OutLoop @ INT_RETURN





Bookmarks