Dear Santoshaxl, i am getting a problem on attaching the diagrams,circuits and other descriptions,tell me what should i do so that i post the full circuit of my project which used the technology of PIC.
I am done with my project and everything went good despite of no support from the online technologiest but if any one wish to advance my idea Iam ready toshare what I have and I know
// initialisation afficheur LCD
// Lcd pinout settings
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D4 at RC0_bit;
// Pin direction
sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D7_Direction at TRISC3_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D4_Direction at TRISC0_bit;
unsigned char acqui ;
// variables enables to store temperature and humidity digital values
unsigned temp;
float long temp_o; // originals values of temperature and humidity
unsigned char i,j, valueT[7],testT[14];
char *hu;
void Move_Delay() { // Function used for text moving
Delay_ms(200); // You can change the moving speed here
}
void main() {
TRISA=0xFF;
Lcd_Init();
// displaying information of LCD screen
Lcd_Cmd(_LCD_CLEAR); LCD_cmd(_LCD_CURSOR_OFF);
Lcd_Out(0, 6, "TEMP:");
//######-- started sensor temperature
temp = ADC_Read(0); // digital value ie InputValue/q where q=5/1023
temp_o = temp*(5.0/1023.0); //conversion for obtain the original input in volatge
temp_o = temp_o * 100; // three ruler enable to obtain the corresponding degree
temp = (int)temp_o ;
temp = (temp> 5) ? (temp):(temp+1); // exact value of sensor
LongToStr(temp,testT);
j = 0;
for(i = 0;i<=11;i++)
{
if(testT[i]!=' ')
{
valueT[j] = testT[i];
j++;
}
}
Lcd_Out(2,1," ");
Lcd_Out(1,12,valueT);Lcd_Out(1,15,"C");
/* the protocole that enable to send information between pic and Pc as follows:
- when we send the temperature, we send firstly letter "T" like temperature
- if a percent humidity, we send firstly letter "H" */
UART1_Write_Text("T");
UART1_Write_Text(valueT);
// UART1_Write_Text("°C");
/*##########Interval testing started###########*/
if( (temp >=0) && (temp < 36) ) {
//enclosure is cool
Lcd_Out(2,6, " ") ;
Lcd_Out(2,6, "Cool") ;
}
else if((temp >=36) && (temp < 38)){
// temperature is normal
Lcd_Out(2,6, " ") ;
Lcd_Out(2,3, "Normal Temp") ;
}
else {
// temperature is too hot
Lcd_Out(2,6, " ") ;
Lcd_Out(2,6, "Too Hot") ;
// Moving text
while(1) { // Endless loop
for(i=0; i<5; i++) { // Move text to the right 7 times
Lcd_Cmd(_LCD_SHIFT_RIGHT);
Move_Delay();
}
for(i=0; i<5; i++) { // Move text to the right 7 times
Lcd_Cmd(_LCD_SHIFT_LEFT);
Move_Delay();
}
}
//###########---end sensor temperature----###########
}
while(1);
}
unsigned char* GSM_MSG1 = "AT\n"; //"ATQ0V1E1S0=0\r\n";
unsigned char* GSM_MSG16 = "\r"; //"ATQ0V1E1S0=0\r\n";
unsigned char* GSM_MSG6 = "0x0D\n"; //13 for enter
unsigned char* GSM_MSG20 = "ATD09098725653\n";
unsigned char* GSM_MSG8 = "AT+CFUN=0\n";
unsigned char* GSM_MSG9 = "AT+CFUN=1\n";
unsigned char* GSM_MSG10 = "AT+CMGF=1\n";
unsigned char* GSM_MSG11 = "AT+CMGS=\"09098725653\"\n";
unsigned char* GSM_MSG12 = "0x1a\n";
unsigned char* GSM_MSG13 = "ok 0X1a\n";
unsigned char* GSM_MSG14 = "AT+CMGS=1\n";
unsigned char* GSM_MSG15 = "AT+CMGS=1\n";
void main() {
int ctr;
TRISA= 0xff; // Configuring PORTA as Input
TRISC=0x0; // Configuring PORTC as Output
PORTC=0;
PORTA=0;
while(1)
{
if(PORTA==0x01) // For the call command using AT commands. The codes here are working...
{
PORTC = 0X01; // Test to see if programme started running.
Delay_ms(1000);
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(1000);
UART1_Write_Text(GSM_MSG1);
Delay_ms(3000);
UART1_Write_Text(GSM_MSG16);
Delay_ms(2000);
UART1_Write_Text(GSM_MSG20);
Delay_ms(5000);
UART1_Write_Text(GSM_MSG16);
Delay_ms(15000);
UART1_Write_Text(GSM_MSG6);
Delay_ms(10000);
UART1_Write_Text(GSM_MSG16);
Delay_ms(5000);
PORTC=0x00;
Delay_ms(5000);
}
else if(PORTA==0x02) //For the message sending using AT commands via UART... The codes here are not working...
{
PORTC=0x02;
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(1000);
UART1_Write_Text(GSM_MSG1);
Delay_ms(2000);
UART1_Write_Text(GSM_MSG16);
Delay_ms(3000);
UART1_Write_Text(GSM_MSG10);
Delay_ms(3000);
UART1_Write_Text(GSM_MSG16);
Delay_ms(3000);
UART1_Write_Text(GSM_MSG11);
Delay_ms(3000);
UART1_Write_Text(GSM_MSG16);
Delay_ms(4000);
UART1_Write_Text(GSM_MSG13);
Delay_ms(6000);
PORTC=0x00;
Delay_ms(5000);
}
else
{
PORTC=0;
}
}
}
you should ask help from edaboard admin
what I do is
1. send a command, e.g. AT+GMR<cr>
2. read response from modem putting characters in a buffer until <CR>
I also have a timeout in case there is no response (error condition)
3. compare the string in the buffer to the expected response
if as expected, e.g. OK continue to next command
else take some action e.g. was an error returned
the response may be more complex, e.g. checking the signal quality in response to at+csq
Hi,
Thank you for the information.
if(strncmp(GSMdataRead, "+CSQ:",5)==0) // is it CSQ reply
{
sscanf(GSMdataRead,"+CSQ:%d,", &GSMsignalLevel);
printf(" >>>> CSQ value !!!! %s signal level %d", GSMdataRead, GSMsignalLevel);
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?