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.

PIC16F877A interface with PC.

Status
Not open for further replies.

sfchew7

Junior Member level 2
Junior Member level 2
Joined
Sep 29, 2011
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,423
How can I transmit the data from visual basic 2008/ 2010 to my PIC16F877a?
I am using ccs compiler.
I can send the text from PIC16F877a to computer but I do not know how to send text from VB2008/2010 to PIC16F877a.
I need this urgently because whenever PIC receives the certain text from VB2008/10 then the PIC will do something.
thanks
 

if you don't have VB Program Download Visual Basic express edition 2008 and google "Serial Communication In Visual Basic 6 or 2008 or 2010 " or for fast results search in you tube. once you download the program and see the example videos you'll finish it in less than one hour its very easy.. and feel free to msg me if you face any problems.

"You Must Learn By Your Self"
 
How can I transmit the data from visual basic 2008/ 2010 to my PIC16F877a?
I am using ccs compiler.
I can send the text from PIC16F877a to computer but I do not know how to send text from VB2008/2010 to PIC16F877a.
I need this urgently because whenever PIC receives the certain text from VB2008/10 then the PIC will do something.
thanks

Code:
 #include "16f877A.h"
    #fuses HS,NoPROTECT,NoWDT,put,brownout
    #use delay(clock=4000000)
    #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS)


    char chr;
    void main()
    {

       printf("\n\rThis is a demo");
       
       while(1)
       {
          if(kbhit())  // check if there is a char ready to fetch
          {              
             chr=getc(); // get one char from USART  
             putc(chr); // here we echo the chr we received            

             if (chr=='1')
			{
				output_high(pin_d5);
				output_high(pin_d6);
				output_high(pin_d7);
								}

			




			}
		
       }
    }
what I want to do is when the PIC16F877A received "1" from VB2008
then It will turn on the 3 LEDS
it is the code is true ?
thanks
 

Can anyone help me? I need it urgently. Thanks
 

The code seen like true, but don't know actual because I not use CCS.
 

The code seen like true, but don't know actual because I not use CCS.
if this code is true
that mean in vb2008
if i write in this way, and make a button.
serialport1.wrte("1")
by clicking the button then the vb will send the "1" to the pic.
Unfortunately, it does not work. thanks
 

I have another problem is when I am using my friend computer , the data can be transmitted from pc to Pic but when I am using my own computer, it failed to do so. So probably what will be the problem? thanks
 

Hi,

I had tried alreadly a serial interface to communcate the PC, where one can use C# donet language and develop the text box to read the PIC serial port output ....In a way one need to use serial port component in the donet for which the parameters like baud rate, flow control need to be set properly and as same of the PIC port....

To check that you are getting the things please use HyperTermianl or tera term like application....Bcz first time I forget to convert the char to it's ASCII value .... thus I could not able to found any thing on hyper terminal/ TeraTerm so in that case As I was reading the number I had added + 48 to convert to the ASCII value.....

Both codes works perfectly fine with serial Port.......

with regards,

Milind
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top