Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

18f4550 two way usb communication?

Status
Not open for further replies.

Darknesss

Newbie level 5
Joined
Jun 12, 2006
Messages
8
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Belgium
Activity points
1,332
hidrxreport

I have been experimenting with the CREATE USB Interface:


This project will show up as a HID device (gamecontroller).
The example project from that page is written in C18 for mplab.

I was able to read the output of the pic (from analog inputs) in a C# program based on the software in this article:
http://www.vsj.co.uk/articles/display.asp?id=600

There is however one thing that I was not able to get to work. I was
trying to send commands to the pic.

Basicly I just want the pic to light a led based on the packet data it
receives but no luck so far...
Maybe it's the C# program that does not do it's job properly, but it
would be nice to know if the pic code is able to handle the data.

This is the code in the ProcessIO function that I use to handle the data:
Code:
if (HIDRxReport(rbuffer,32) > 0) // USB receive buffer has data
   {
               //do stuff with Buffer[]
               // for example blink led
               switch(rbuffer[1]) {
                       case 0:
                               LATB = 0;
                               break;
                       case 1:
                               LATB = 0x7F;
                               break;
                       default:
                               LATB = 0x5A;
                               break;
               }
       }

I tried enclosing this code in:
if(!mHIDTxIsBusy()){ }
but still no luck :cry:

Do any of you perhaps have an example of how to do this kind of stuff?
Any hints are welcome.

The original example code is
 

cui pic c18 usb

anyone? I can provide more info if needed.
 

I use CCS c, maybe its helps you .


look at
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top