The default config in the PBP directory looks correct for a 20MHz external.
Can you confirm that the chip is running at 48MHz?
The default config in the PBP directory looks correct for a 20MHz external.
Can you confirm that the chip is running at 48MHz?
Dave
Always wear safety glasses while programming.
I can't confirm it right now, but I feel it is. I have been playing with receiving serial at 115K without any problems. But I was using configs set in code. I also tried those same configs, still nothing. I will double check all configs tonight.
Thank you for verifing the defaults should work. I know Darryl said not to mess with the code until it connected, but I think I can at least toggle a pin to make sure there is life, and at what speed.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Post your code. Maybe there is something else.
Dave
Always wear safety glasses while programming.
Here it is:
Code:' USB sample program for PIC18F4550 CDC serial port emulation ' Requires PBP 2.60 or later ' Compilation of this program requires that specific support files be ' available in the source directory. For detailed information, see ' the file PBP\USB18\USB.TXT. Include "cdc_desc.bas" ' Include the HID descriptors Define OSC 48 buffer Var Byte[16] cnt Var Byte OSCTUNE.6 = 1 ' Enable PLL for 18F87J50 family Pause 10 USBInit ' Get USB going ' Wait for USB input idleloop: USBService ' Must service USB regularly cnt = 16 ' Specify input buffer size USBIn 3, buffer, cnt, idleloop ' Message received buffer[0] = "H" buffer[1] = "e" buffer[2] = "l" buffer[3] = "l" buffer[4] = "o" buffer[5] = " " buffer[6] = "W" buffer[7] = "o" buffer[8] = "r" buffer[9] = "l" buffer[10] = "d" buffer[11] = 13 buffer[12] = 10 buffer[13] = 0 outloop: USBService ' Must service USB regularly USBOut 3, buffer, 14, outloop Goto idleloop ' Wait for next buffer
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
revisied code with a speed test added
the results of the speed test: pin toggles at 3Mhz. To be clear, there is .3333uS between toggles. Now I don't feel like that is correct. lets see: 48Mhz=12Mips. So thats .08uS per instruction? So we are executing 4 instructions? Hmm, that doesn't sound right.Code:' USB sample program for PIC18F4550 CDC serial port emulation ' Requires PBP 2.60 or later ' Compilation of this program requires that specific support files be ' available in the source directory. For detailed information, see ' the file PBP\USB18\USB.TXT. Include "cdc_desc.bas" ' Include the HID descriptors Define OSC 48 trise.3 = 0 buffer Var Byte[16] cnt Var Byte OSCTUNE.6 = 1 ' Enable PLL for 18F87J50 family Pause 10 '***************************************** '--------------Speed test speedtest: toggle porte.3 goto speedtest '--------------End test '****************************************** USBInit ' Get USB going ' Wait for USB input idleloop: USBService ' Must service USB regularly cnt = 16 ' Specify input buffer size USBIn 3, buffer, cnt, idleloop ' Message received buffer[0] = "H" buffer[1] = "e" buffer[2] = "l" buffer[3] = "l" buffer[4] = "o" buffer[5] = " " buffer[6] = "W" buffer[7] = "o" buffer[8] = "r" buffer[9] = "l" buffer[10] = "d" buffer[11] = 13 buffer[12] = 10 buffer[13] = 0 outloop: USBService ' Must service USB regularly USBOut 3, buffer, 14, outloop Goto idleloop ' Wait for next buffer
Ok, I will see if someone else can think better then I this evening
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Might be a problem with the buffer size compared to the data being sent. They are different sizes.
Here is an example:
As for your speed test... my brain is ready to fuss out for the day also...Code: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
Dave
Always wear safety glasses while programming.
Hmmm.. I would think OS should still see it as a new device even if thats the case.
Well I am studing the schematic now, I am not sure I have the "CAP" on Vusb. But I can say this thing works with a USB bootloader no problem. Now does that mean winblows will see it? IDK
I see there are pullups on the data lines. And according to the datasheet, The internal pullups must be disabled. I have been looking at the include file, and I think there are being set.
I am just about to give up on this "pre-configured" answer. After all, it may NOT be the answer for this chip anyway. I will start looking at your solution to see if I can make that work.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Bookmarks