Microcontroller › PIC › usart transmission problem
- This topic has 1 reply, 2 voices, and was last updated 12 years ago by
AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
March 31, 2013 at 10:22 pm #2221
kingshuk basu
Participanti am facing a problem with data transmission while using the usart module of 16f877a.
the data is being sent continuously even though the program is for sending data once only…………………..
plzzzzzzzzzz help.its urgent.this my program:
main
#include <htc.h>#include “usart.h”void gsm_cmd(unsigned char *);void Delay_ms(unsigned char);unsigned char value=0;int i=0,j,k;unsigned char *sms_format=”AT+CMGF=1″;unsigned char *sms_write=”AT+CMGS=”9038940850″”; // 10-Digit Mobile Numberunsigned char *sms=”Hello”;unsigned char *sms_report=”SMS Sent…”;unsigned char sms_terminate=0x1A;unsigned char enter=0x0D;unsigned char *data;void main(){INTCON=0; // purpose of disabling the interrupts.init_comms(); // set up the USART – settings defined in usart.hgsm_cmd(sms_format);Delay_ms(1000);gsm_cmd(sms_write);Delay_ms(1000);gsm_cmd(sms);Delay_ms(1000);putch(0x1A);Delay_ms(1000);while(1);}void Delay_ms(unsigned char d){while(d–);}void gsm_cmd(unsigned char *string){int i=0;j=0;while(string!=’