I am able to connect my sim900 gsm module with hyper terminal but I am not able to connect it with 89s52. Please help me to connect it.
I noticed that there's something I can't understand - the sign extension that is performed when moving a 8-bit or 16-bit value to a register. How does it work?
Why not?
What have you tried?
What results were you expecting?
What results did you actually get?
What have you done to investigate why your results were not as you expected?
You say it "works" with Hyperterminal - so what have you done to determine what's different between that and your 89s52 setup?
What have you learned from the large number of posts already on this forum on this very topic?
What have you learned from the vast number of posts all over the interweb on this very topic?
Sign extension? Exactly what does that have to do with GSM modules?
What? You didn't notice that this thread is about "How to interface GSM module with 89s52" - and that your question on integer promotion has, aparently, nothing whatsoever to do with that topic?
yes but I don't know how to make a new topic.
I connect TX pin of gsm module with Rx pin of 89s52 and Rx pin of gsm with Tx pin of 89s52. I use this program, #include <REGX51.H> #include <AT89X51.H> unsigned char *command_AT = "AT\r"; unsigned char *command_CMGF = "AT+CMGF=1\r"; unsigned char *command_CMGS = "AT+CMGS=\"Mobile Number\"\r"; unsigned char *message = "Message"; unsigned char *CTRLZ = "\x1A";
void puts(unsigned char* ptr); void putc(unsigned char chr); void sendsms(void); void initialize();
main() { initialize(); sendsms(); while(1); }
void initialize() { SCON = 0x50; /*SCON: mode 1, 8-bit UART, enable receive */ TMOD |= 0x20; /*TMOD: timer 1, mode 2, 8-bit */ TH1 = 0xFD; /*TH1: for 9600 baud */ TR1 = 1; /*TR1: timer 1 run */ }
void sendsms() { puts(command_AT); puts(command_CMGF); puts(command_CMGS); puts(message); puts(CTRLZ); }
void puts(char* p) { char *temp = p; /*temp pointer so that the actual pointer is not displaced */ while(*temp != 0x00) { putc(*temp); temp++; } }
void putc(unsigned char chr) { SBUF = chr; while(TI==0); /*Wait until the character is completely sent */ TI=0; /*Reset the flag */ }
I want to send message by GSM module using 89s52. When i burn this program in micro controller. There is no result come.
Besides missing lot of hardware information already mentioned - like clock frequencies (to verify if you really got 9600 baud) or electrical levels used by that GSM modem - you do other interesting stuff.
You think it is a good idea to send multiple commands to the modem at maximum transfer speed?
Did you test the same with the hyperterminal, i.e. never waiting for any response before starting with the following command? You have seen in a datasheet somewhere that the modem do support this? Really?
Don't you believe there was a reason why the AT commands do generate responses?
i use crystal frequency 11.0592MHz. Baud Rate 9600 serial comm. details are 9600-N-8-1
You say it "works" with Hyperterminal - so what have you done to determine what's different between that and your 89s52 setup? (you've already had a hint about observing the module's responses, and the speed at which you can send commands manually)
then you need
micro <-> MAX232(equivalent) <-> GSM module
I did this but not works.Pls check my program i added before and help.
As pointed out by several posters your program fails to be attentive to if the modem responds with OK/ERROR to commands sent, and blindly ploughs forward. Suggest you try something simpler, and with a scope or analyzer, and confirm if the modem is responsive to some basic AT commands (ie one where it can respond immediately, and doesn't depend on carrier or SIM)
Get better at debugging so you can solve your own problems.
So maybe you did it wrong?
Again: what debugging (including hardware debugging) have you done?