AT+CPIN? causes ERROR on microcontroller, OK on PC Terminal



I want to access the GS64 integrated on CEPAGs GS64T via RS232 by the ATMEL ATMEGA128 microcontroller. Therefor I use a cable with four lines: Rx, Tx, RTS and CTS … it’s the only difference in communication to the PC I can imagine, where all lines are connected.

When I start the Modem, an initial “ATE2SDR?" is sent for checking the SIM-Status, if the presence of a SIM-card is reported, the PIN should be sent. Before sending, the MC asks which type of PIN is needed by sending an “AT+CPIN?” … and there the fun starts. The MC always gets ERROR back, if I try the very same commands by a PC based Terminal, everything is fine. All the other commands work well on the MC, the only commands working differently are “AT+CPIN?”, “AT+CPIN=“xxxx”” and as a try "ATE2SSN” Somehow commands related to the SIM-Card, except for “AT*E2SDR?” are corrupted when being used by the MC.

What might be the cause?


Well, you could easily check that by using a 4-line cable with your PC, surely?

Are you certain that all the settings are the same - flow control, stop bits, parity, etc, etc…?

Does your microcontroller have a proper RS232 interface - ie proper transceivers (MAX232 or whatever)?

Are you typing the commands manually on the terminal?
If so, the timing will certainly be different!



I just made a cable with only Tx, Rx, RTS, CTS, GND and guess what … the PC got the same error. By connecting the DTR-pin the problem could be solved. The only thing I have to figure out now is, how to actually use the DTR-line correctly.

I already used a four line MAX232 where all four lines are in use. I hope it works with a static 1 on DTR or might be connecting DTR and DSR a better (or worse) idea?

€dit: The program sends the commands, from the terminal they come manually.


What does the module’s datasheet say?


The technical Datasheet indicates, that only CTS and RTS are really needed for communication, that the needed signal is active low and that the behaviour of DTR and DSR can be configured manually. AT command manual reveals now, that by default, the DTR-Pin is ignored.

And fun fact: letting the modem rest for a night made the connection of the DTR Pin obsolete, at least with the PC terminal, the MC carries on getting the ERROR-Message … would have been boring anyway if it just worked.


I’ve set the DTR to 1 by pulling it to active low with the V- of the ST3232 converter. Nothing. Still the MC gets the errors when using SIM-related commands, the PC terminal meanwhile works fine without DTR line … I’m really running out of ideas.

€dit: Might the voltage level of +5/-5 V of the ST3232 be the problem? Isn’t it +12/-12 V with the PC?

€dit 2: I just measured +6/-6 V on the COM-Port of my Notebook


Have you tried to get the error number threw AT+CMEE, in order to understand your error…


Funny, latest thing I came up with yesterday =) Errornumber is 3 “operation not allowed” … and as a bonus, I found out that my lab mate designed the interface board a little faultily … wrong enough to blast the audio interface on the GS64 Module. One feature gone, two left. That was the point I decided not to take the whole project personally … then this little terrorist modem would have won O_O
Thank God it’s only for my bachelor thesis … enough of this. It’s weekend!

€dit: AT+CEER throws “failure cause 94” any ideas? Haven’t found it yet.


Finally someone competent at Cepag who talks to the customer =) So, it appears, that the SIM-Card needs some time to initialize before becoming available to commands. The PIN-command was simply given too early. Feels good having solved a problem, sucks having wasted a whole week on it.

Thanks anyway,



Well, I did suggest timing to you in my very first reply! 8) … ght=timing

The Wavecom AT Commands manual has a section at the end that lists what commands depend on things like SIM state - I don’t know if the GS64 documentation (being originally Ericsson) has something similar…?

Note that the time required for a SIM to initialise is undefined, and can differ between different SIMs - so you need to be sure to allow plenty of time!

Again, Wavecom have +WIND: indications that advise SIM state - I don’t know if the GS64 has anything similar?


I know =/ I was so fixed on communication that I totally forgot about the needs of the module. Cepag support said “You have to realize that this is only a dumb modem.” That’s the way I see it now … dumb modem! I couldn’t test the +WIND command yet, the AT manual knows nothing about it, the list at the end of it is just all the commands in alphabetic order.

Anyway, I have a new problem … time for a new thread. Later when I’m at the university.


Like I said: it’s a Wavecom special - probably not available on the GS64, as that’s essentially a Sony-Ericsson module.
(Wavecom “inherited” it when they bought-out the Sony-Ericsson M2M business)

My question was, does the GS64 offer anything equivalent :question: