I went from the 4550 to the 2550 and have an interesting problem.
Went back to the basics http://www.picbasic.co.uk/forum/showthread.php?t=5806 and I still do not see what I am doing wrong.
In order for the device to connect I have to move the USBINIT below the FOR/NEXT loop...If USBINIT is in the "correct" place the device will not connet.
Doing that the device connects and will send data but the data looks like this.
The same happens on a 32 or 64 bit machine.Quote:
` ($#_H! c 8 X- &X6USB CONNECTED!
I have a 1.0uF cap on VUSB and I am running the chip at 3.3 volts as I do with a 4550.
The machine I am on tonight is running PBP 2.50
The code.
Same code, same machine(s) with a 4550 works fine.Code:'USB_2550
@ __CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
@ __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
@ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
@ __CONFIG _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H
@ __CONFIG _CONFIG4L, _LVP_OFF_4L
DEFINE OSC 48
Buffer VAR BYTE[16]
Cnt VAR BYTE
B0 VAR BYTE
B1 VAR BYTE
ADCON1 = 15 ' Set all I/Os to Digital
CMCON = 7 ' Disable Comparators
Cnt = 16
for b0 = 0 to 15
lookup b0,["USB CONNECTED!",10,13],B1
BUFFER(B0) = B1
NEXT B0
USBINIT
' Main Program Loop
Loop:
USBService ' Must service USB regularly
USBOut 3, Buffer, Cnt, loop
goto loop
END