Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Sending data from PIC to PC via USB with 18f2550

Status
Not open for further replies.

bayabi

Newbie level 6
Joined
Jan 28, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,392
Hey there I want to control my PIC from PC and send feedback from PIC. I can easily control my PIC, however; the pic to PC part does not work. I have defined a function named USB_DATA on C18 on pic side :

Code:
void USB_Data(void)
{
	send_data[1] = 1;
	if(!mUSBGenTxIsBusy() )
  	{
      	USBGenWrite(send_data[1],2);
	}
}
and on my PC side I try to read my send_data[1] via :


Code:
	unsigned char Data = 0;
	
	data_in[1] = Data;
	while(1)
	{
		if(Data == 1)
		{
			cout << "Data_here";
		}
	
		if(MPUSBRead(inPipe , data_in, 2, &ActualLength, 1000));
	}
Where do I do wrong? I guess I am sending the data right way. But due to the misusage of MPUSBRead function I cant read it on visual side.

Thanks for your helps
Best regards..
 

bayabi

Newbie level 6
Joined
Jan 28, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,392
Is there nobody that can help me? Even an example code for usage of MPUSBRead function would be helpful.

Thank you..
 

bayabi

Newbie level 6
Joined
Jan 28, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,392
thank you very much I overcome my problem.
 

PLAAHemantha

Newbie level 5
Joined
May 31, 2012
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,349
Hi everybody!
I'm also trying to send a numeric value from PIC and get and display it on PC But I can't to success. I want to send a numeric value from PIC and get and display it on PC, or send pulse from PIC then get and count pulses given time interval and display it on PC. Anyone can give schematic, C source code for PIC and VB source code.

Hemantha
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top