Seeing your code would help...
Seeing your code would help...
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I've just used the usb wizard ( this is'nt whole code, it's on my desktop, but this code don't work( )
TRISB =%00000000
DEFINE OSC 48
DEFINE LOADER_USED 1
'PORTB = 0
USBBufferSizeMax con 8 ' maximum buffer size
USBBufferSizeTX con 8 ' input
USBBufferSizeRX con 8 ' output
' the USB buffer...
USBBuffer Var Byte[USBBufferSizeMax]
USBBufferCount Var Byte
' ************************************************** **********
' * main program loop - remember, you must keep the USB *
' * connection alive with a call to USBService every couple *
' * of milliseconds or so... *
' ************************************************** **********
' initialise USB...
ProgramStart:
usbinit
gosub DoUSBIn
gosub DoUSBOut
write 0,USBbuffer[1] ' ******* or asd=usbbuffer[1] write 0,asd
'**don't save, why ?
Goto ProgramStart:
' ************************************************** **********
' * receive data from the USB bus *
' ************************************************** **********
DoUSBIn:
USBBufferCount = USBBufferSizeRX ' RX buffer size
USBService ' keep connection alive
USBIn 1, USBBuffer, USBBufferCount, DoUSBIn ' read data, if available
return
' ************************************************** **********
' * wait for USB interface to attach *
' ************************************************** **********
DoUSBOut:
USBBufferCount = USBBufferSizeTX ' TX buffer size
USBService ' keep connection alive
USBOut 1, USBBuffer, USBBufferCount, DoUSBOut ' if bus available, transmit data
return
Do a little test...
Use a scope to see if there's some activity on LED pin. If not, you may want to comment of of these to see where your program stuckCode:HIGH LED write 0,USBbuffer[1] LOW LED
I can't tell for Proteus, but I'm always impressed to see how rich students areCode:usbinit gosub DoUSBIn gosub DoUSBOut![]()
Last edited by mister_e; - 26th February 2009 at 13:57.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
welll I confess, I'm using school computers, for Proteus( I'm not rich
)
I'll try it by real 4550 but, a little question, when I tried your USBDemo (mister_e), I realized that after resetting the pic, still the same leds are high ( some kind of save I think) but in your codes, there is no "write" command and I tried it with usb wizard just like my example, it works fine but when I reset the pic all leds are off. why yours are still on ?
are you using my schematic?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I don't know your sch. but, I've used a standart sch. I guess it was in micro code studio. easy hid wizard help. but I tried your USB Demo
Bookmarks