Problems with Microcontroller Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you the Codes for Registered Members of this site only, at free service...Follow Me.

How to Interface PIC16F877A / 18F452 with RS232C Serial Communication Using CCSC


Communication between a Microcontroller and a Computer is not a big thing. Use a level converter in between Microcontroller and PC. You can test it using a proteus simulation  or directly connect your hardware to PC and use Hiper Terminal for Testing

Here a Simple code for testing Serial Communication

        #include <16F877A.h>
        #DEVICE ADC=10
        #fuses HS,NOWDT,NOPROTECT,NOLVP
        #use delay(clock=20000000)
        #use rs232 (baud=9600,rcv=PIN_C7, xmit=PIN_C6)

        int count=0;
      
        void main()
        {
        while(1){

        //1 Sec Delay
        delay_ms(1000);

        //Increment Count
        count ++;
        if (count>60)
      {  count=0;}

        //Send data to PC
        printf("\n\r Count Value: %d",count);
        }
        }

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Recent Comments

Popular Projects

Give Support

Give Support
Encourage Me through Comments

Microcontroller Projects

Total Pageviews