PDA

View Full Version : PC-usb-PIC problem...



keymuu
- 9th November 2008, 01:06
Hello

I have quit a strange problem I can't solve :(
Please take a look at the attached files.

One is the interface running on my PC the second the PIC 4550 pbp code. The origins are outcomes from easyHID.

All works quit well now when line 45 in pbp code is commented. When things are as you can see them now you can see the same number in the second window (x2=) as in the upper one that is sent to PIC to by pressing Send. You can also see the portA.2 toggle on each Send press. Nothing wrong now.

But what if you uncomment line 45 and assign 77 to USBBuffer[1], you could expect to see 77 in the second textbox. But that is not the case. You will still see the same number that is in the upper textbox and you can see portA toggle on each Send press. It seems that PIC ignores the uncommented line 45.

How can this be explained????? :confused:
Can you explain this?
Please do, if you can :)

Please help.......

I'm using XP and pbp 2.50b (and portB.5 is connected to USB+5V, so we wait there and see the toggling before the USB cable is connected)

mister_e
- 9th November 2008, 01:21
This would help to see the PC software as well.

try to skip DoUsbIn and just do a loop of DOUSBOut.

Never Forget, array index 0 on the PIC side is INDEX 1 on the PC side,

keymuu
- 9th November 2008, 13:57
This would help to see the PC software as well.

try to skip DoUsbIn and just do a loop of DOUSBOut.

Never Forget, array index 0 on the PIC side is INDEX 1 on the PC side,
Attached pc-software. Will try the skipped DoUsbIn as soon as the batteries are charged again... forgot them for a too long time on, so they need to be charged :rolleyes:

keymuu
- 9th November 2008, 21:41
... Never Forget, array index 0 on the PIC side is INDEX 1 on the PC side,

You should never say never... ;)
That was the problem here, thanks mister_e for the "never... "... :)
However, this brings up another issue, if PC buffer[0] is always report ID as stated in VB-program, how could one send that info to the PIC if needed?

A second question, do you now a good pic2550/4550 assembler tutorial somewhere around the wep? I have been trying to look around such tutorials but haven't been so lucky yet :(

mister_e
- 9th November 2008, 23:46
Well you just send it to your pic, the same way i use for the PWM Scroll bar in my USBDemo... not sure how handy it is to send it though :o

I don't know of any good asm tutorial, but as Darrel says elsewhere, the datasheet, and the reference guide for 18F familly is usually more than enough.