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.

c# and PIC using rs232 interface

Status
Not open for further replies.

congthegreat21

Newbie level 3
Joined
Sep 17, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
I have my research using C# program and interfaced with PIC16f877A using rs232. I can send data from my c# application to PIC but i don't know how to send back data from PIC to C# application.
(sample of C# code on the button SEND)
private void button1_Click(object sender, EventArgs e)
{
port.Open();
port.Write("b");
port.Close();

}
(sample of PIC code RECEIVE)
if (UART1_Data_Ready()) { // If data is received,
receive = UART1_Read(); // read the received data,
if(receive == 'b'){

LCD_Out(1,1,txt5);
floatToStr(amtpaid, txt);
LCD_Out(1,11,Ltrim(txt));
prevpulsecount=pulsecount;
prevpulsecount1=pulsecount1;
EEPROM_Write(0x80,prevpulsecount);
EEPROM_Write(0x90,prevpulsecount1);
}
else{
......}
I want to know how to send back data from PIC to C# and put it on the textbox of the C# application. PLEASE HELP ME!!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top