Mar 14, 2015 #1 J Jeffin Jacob Philip Newbie level 2 Joined Mar 14, 2015 Messages 2 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 11 is this code correct . . . its not working is there anyone to help me.... Code: //crystal 20Mhz void main() { TRISD=0; PORTD=0xff; Delay_ms(1000); PORTD=0; UART1_init(9600); Delay_ms(10); UART1_Write_Text("AT\r\n"); Delay_ms(2000); UART1_Write_Text("AT+CMGF=1\r\n"); Delay_ms(2000); UART1_Write_Text("AT+CMGS=\"+919895595189\"\r\n"); Delay_ms(1000); UART1_Write_Text("OK...Its working"); UART1_Write(0x1A); Delay_ms(2000); Delay_ms(2000); PORTD=0xff; Delay_ms(1000); PORTD=0; } Last edited by a moderator: Mar 14, 2015
is this code correct . . . its not working is there anyone to help me.... Code: //crystal 20Mhz void main() { TRISD=0; PORTD=0xff; Delay_ms(1000); PORTD=0; UART1_init(9600); Delay_ms(10); UART1_Write_Text("AT\r\n"); Delay_ms(2000); UART1_Write_Text("AT+CMGF=1\r\n"); Delay_ms(2000); UART1_Write_Text("AT+CMGS=\"+919895595189\"\r\n"); Delay_ms(1000); UART1_Write_Text("OK...Its working"); UART1_Write(0x1A); Delay_ms(2000); Delay_ms(2000); PORTD=0xff; Delay_ms(1000); PORTD=0; }
Mar 14, 2015 #2 M milan.rajik Banned Joined Apr 1, 2013 Messages 2,524 Helped 540 Reputation 1,078 Reaction score 524 Trophy points 1,393 Activity points 0 Try this. If it still doesn't work then switch to PIC18F device. 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 void main() { TRISC = 0x80; PORTC = 0x00; TRISD = 0x00; PORTD = 0x00; UART1_init(9615); Delay_ms(200); UART1_Write_Text("AT\r\n"); Delay_ms(1000); UART1_Write_Text("AT+CMGF=1\r\n"); Delay_ms(1000); UART1_Write_Text("AT+CMGS=\"9895595189\"\r\n"); Delay_ms(3000); UART1_Write_Text("OK...Its working"); Delay_ms(500); UART1_Write(0x1A); PORTD = 0xFF; Delay_ms(1000); PORTD = 0x00; while(1); }
Try this. If it still doesn't work then switch to PIC18F device. 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 void main() { TRISC = 0x80; PORTC = 0x00; TRISD = 0x00; PORTD = 0x00; UART1_init(9615); Delay_ms(200); UART1_Write_Text("AT\r\n"); Delay_ms(1000); UART1_Write_Text("AT+CMGF=1\r\n"); Delay_ms(1000); UART1_Write_Text("AT+CMGS=\"9895595189\"\r\n"); Delay_ms(3000); UART1_Write_Text("OK...Its working"); Delay_ms(500); UART1_Write(0x1A); PORTD = 0xFF; Delay_ms(1000); PORTD = 0x00; while(1); }