void usart_init();
void sms_read();
void sms_send();
char output[12];
char a;
int i;
void main()
{
OSCCON =0b01100000;
usart_init();
Delay1KTCYx(50);
//sms_read();
sms_send();
while(1);
}
void sms_send()
{
int i;
putrsUSART("AT\n\r");
//putcUSART(0x0D);
Delay10KTCYx(500);
putrsUSART("AT+CMGF=1\n\r");
//putcUSART(0x0D);
Delay10KTCYx(500);
putrsUSART("AT+CMGS=");
putcUSART(0x22);
putrsUSART("+919967602845");
putcUSART(0x22);
//putcUSART(0x0D);
putrsUSART("\n\r");
Delay10KTCYx(500);
putcUSART(0x3E);
putrsUSART("halloooo");
Delay10KTCYx(500);
putcUSART(0x1A);// send ctrl + Z
//putrsUSART("\n\r");
}
i generated the voltage like this.then also the modem is not responding.use to regulator 7805 and then using two seperate diodes in series of each regulator this will make 4.2 volt on each and then connect both to Vbat of modem. this will make a 4.2 volt but modem can get maximum current
#include <p18f45k20.h>
#include <usart.h>
#include <delays.h>
# pragma config FOSC=INTIO67
# pragma config WDTEN = OFF
# pragma config LVP = OFF
#pragma config PWRT = OFF
#pragma config BOREN = OFF
#pragma config MCLRE = OFF
#pragma config PBADEN = OFF
// OSCCON =0b01100000;
// code for ASCII control-Z is 0x1A;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
//enter its 0x0d;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
void usart_init();
void sms_read();
void sms_send();
char output[12];
char a;
int i;
void main()
{
OSCCON =0b01100000;
TRISA=0;
usart_init(); // Initialize UART module at 9600 bps
Delay1KTCYx(50); // Wait for UART module to stabilize
//sms_read();
//printf("press key");
PORTAbits.RA1=0;
Delay10KTCYx(1000);
PORTAbits.RA1=1;
Delay10KTCYx(1000);
PORTAbits.RA1=0;
Delay10KTCYx(1000);
putrsUSART("AT+IPR=9600\n\r");
putcUSART(0x0D);
Delay10KTCYx(500);
while(1)
{
//while(BusyUSART());
// while (!DataRdyUSART());
//putrsUSART("\r\nYou enter: ");
//a=ReadUSART ();
//WriteUSART (a);
//putcUSART(a);
//if (a=='a')
//{
//printf("\r\nu enter a\r\n");
sms_send();
//}
//else
//printf("\r\nplz enter a\r\n");
}
}
void sms_send()
{
int i;
putrsUSART("AT\n\r");
//putcUSART(0x0D);
Delay10KTCYx(500);
putrsUSART("AT+CMGF=1\n\r");
//putcUSART(0x0D);
Delay10KTCYx(500);
putrsUSART("AT+CMGS=");
putcUSART(0x22); //for " character
putrsUSART("9769153924");
putcUSART(0x22); // for "
//putcUSART(0x0D);
putrsUSART("\n\r");
Delay10KTCYx(500);
//putcUSART(a);
//putcUSART(0x3E); //for >
putrsUSART("halloooo");
Delay10KTCYx(500);
putcUSART(0x1A);// send ctrl + Z it will deliver sms
putrsUSART("\n\r");
Delay10KTCYx(10000);
}
AT+CMGR=1
+CMGR: "REC READ","+918108111649",,"12/07/22,14:24:11+22"
halloo
OK
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?