fireball003
Full Member level 3
at#sktd
Hi,
I am interfacing microcontroller with GPRS modem. I have DS89C450 MCU and GM862-GPS module.
I did the following-
1. Program MCU to send AT command using UART (printf) and receive the response using scanf function.
2. Test the code using PC terminal and it was working fine.
3. Connect the serial cable from MCU to gprs modem serial port.
4. reset the MCu to send the AT command to GPRS module.
But I got no response from the GPRS module. Did I miss anything? Do I need extra initialisation? Or anything else? Can't I connect GPRS module and MCU using serial port?
My simple code to send AT command is (Keil c51) -
Please suggest me.
Thanks in advance.
Hi,
I am interfacing microcontroller with GPRS modem. I have DS89C450 MCU and GM862-GPS module.
I did the following-
1. Program MCU to send AT command using UART (printf) and receive the response using scanf function.
2. Test the code using PC terminal and it was working fine.
3. Connect the serial cable from MCU to gprs modem serial port.
4. reset the MCu to send the AT command to GPRS module.
But I got no response from the GPRS module. Did I miss anything? Do I need extra initialisation? Or anything else? Can't I connect GPRS module and MCU using serial port?
My simple code to send AT command is (Keil c51) -
Code:
#include "DS89C4XX.h"
#include "stdio.h"
void main()
{
char c;
char aa[40];
int i=0;
/**********Serial port initialization**************************/
SCON0 = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 252; /* TH1: reload value for 14400 baud @ 22.1184MHz */
TR1 = 1; /* TR1: timer 1 run */
TI_0 = 1; /* TI: set TI to send first char of UART */
/************End of serial port initialization****************/
P1 = 0x0F; //to see if the LEDs blink conencted to P1 port
msdelay(20000);
P1 = 0xF0; //to see if the LEDs blink conencted to P1 port
msdelay(20000);
/*Printing string in LCD before sending command to GPRS module*/
printchar(0,0, "Sending AT command");
/*Sending AT command using serial port*/
printf("AT\n");
/*Waiting for the response*/
scanf("%s", &aa);
/*There is a LCD to show the result. I deleted the LCD codes for simplicity
The LCD was showing outptu when conencted to PC terminal.
But it was not showing the output when conencted to GPRS module.*/
printchar(0,0, aa);
while(1);
}
Please suggest me.
Thanks in advance.