Some guidelines to connecting a modem (Analog or GSM) to a MCU.
Dont forget that some GSM modems require the hardware control lines to operate properly.
DCD, DTR, RTS etc.
However, most modems will accept AT commands without these, it mainly becomes an issue when you attempt to connect or recieve a call, never had an issue with SMS before, so cant say about that.
One thing to do is if your modem isn't behaving itself and you only have pins 2,3 and 5 on a 9 pin 232 connection (RX, TX and GND), I believe GND is pin 7 on a 25way, and I believe that 2 and 3 are reversed, is to disable all flow control and force control lines on, and ignore carrier detection etc.
Commands such as:
AT&Cx
AT&Sx
AT&Dx
Dont forget to AT&W to save the profile.
Some modems require an ATZ to load the default profile on startup, I have a 56k Modem with an Agere chipset, which misbehaves very badly if it doesn't receive an ATZ as its first command!
It really can be modem dependant. Also check your connections to the MAX232.
Remember, Pin 13 (R1In) goes to Pin 3 (TX), Pin 14 (T1Out) goes to Pin 2 (RX) on a 9 WAY 232 Connection, also dont forget to connect Pin 5 to GND, it is used as a reference to the RX/TX lines.
Pin 11 (T1In) goes to your MCU TX, and Pin 12 (R1Out) goes to your MCU RX.
Dont forget to read your datasheet!! Some 232 chips require 0.1uF caps (also take note of polarity if using polarised caps) and some require 1uF caps, and dont forget the decoupling cap on the power supply (0.1uF will suffice).
If using a 25 way 232, Pin 3 is RX and Pin 2 is TX and Pin 7 is GND, so basically using the above guide, just swap Pins 2 and 3 around and connect Pin 7 to GND instead of Pin 5.
Also, if your modem is TTL you can ignore the MAX232 chip, but dont forget to connect RX to TX and vice versa between the modem and MCU.
Hope this helps some people out with their issues!
Regards
Wilksey