jjeevan007
Full Member level 5
Hi to all,
i am trying to transmit the Data from PIC16F877A to PC using serial communication with following code.
Code:
the problem is i am facing is the message "HELLO TECHNOLOGY" is receiving continuously
anyone help me so that it should send the message only once.....
Complier used is HI-TECH complier.
regards
jeevan
i am trying to transmit the Data from PIC16F877A to PC using serial communication with following code.
Code:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 #include<htc.h> #include<pic.h> //#include <pic16f877a.h> #define _XTAL_FREQ 4000000 __CONFIG(0x1f3a); void main(void) { ADCON1 =0x06 ; // Changes PORTA and PORTE to digital TRISA = 0x00 ; // Configure PORTA as output TRISD = 0X00 ; // Configure PORTD as output TRISB = 0x00 ; // Configure PORTB as output TRISC = 0x00 ; // Configure PORTC as output TRISE = 0x00 ; // Configure PORTE as output SPBRG=25; //setting the Baud Rate RCSTA=0X80; //Enabling the Serial Communication TXSTA=0X26; //Enabling Transmission in Serial Communication, Selecting Mode and Speed TXREG='H'; while(TXIF==0 || TRMT==0); TXREG='E'; while(TXIF==0 || TRMT==0); TXREG='L'; while(TXIF==0 || TRMT==0); TXREG='L'; while(TXLIF==0 || TRMT==0); TXREG='O'; while(TXIF==0 || TRMT==0); TXREG=' '; while(TXIF==0 || TRMT==0); TXREG='T'; while(TXIF==0 || TRMT==0); TXREG='E'; while(TXIF==0 || TRMT==0); TXREG='C'; while(TXIF==0 || TRMT==0); TXREG='H'; while(TXIF==0 || TRMT==0); TXREG='N'; while(TXIF==0 || TRMT==0); TXREG='O'; while(TXIF==0 || TRMT==0); TXREG='L'; while(TXIF==0 || TRMT==0); TXREG='O'; while(TXIF==0 || TRMT==0); TXREG='G'; while(TXIF==0 || TRMT==0); TXREG='Y'; while(TXIF==0 || TRMT==0); while(1); }
the problem is i am facing is the message "HELLO TECHNOLOGY" is receiving continuously
anyone help me so that it should send the message only once.....
Complier used is HI-TECH complier.
regards
jeevan
Last edited by a moderator: