BL4S100 and Siemens GSM modem

Hello,

I am trying to connect the BL4S100 to a GSM modem using the RS-232 cable (540-0094). I cannot seem to get a response from the modem. Below is a simple code that I compiled. I connected 3 wires (Red, Brown, and Black) as specified in the samples. I was wondering if I am missing out on something. Thanks is advance.

void main()
{
auto int rs232_received, menu_received;
int c;
auto char error_code;

// Initialize the controller
brdInit();

// open serial port
serDopen(_232BAUD);
serDflowcontrolOff();
serDparity(PARAM_NOPARITY);

// disable flow control
serMode(0);

// Clear serial data buffers
serDwrFlush();
serDrdFlush();

// start with no parity
tx_parity = PARAM_NOPARITY;
serDparity(tx_parity);

// Initialize the counters
success_count = 0;
error_count = 0;

serDopen(115200);
while (1)
{
    if ((c = serDgetc()) != -1)
    {
printf("Char received

");
}
}
serDclose();

Most modems sit quitely until they are told to do something, you have only setup a serial port, then you listen for characters??? What are you expecting to receive? You haven’t done anything to enable the modem. Have you looked at the documentation for the GSM modem, most likely you need to send some ‘AT’ commands to it before you’re going to get a response.

Secondly your port setup is confusing. You have two serDopen calls, the second after you have flushed the buffers. You also have two serDparity calls which seem unnecessary. Assuming you want the port running at 115200 baud, reduce your port setup code to:


// open serial port
serDopen(115200);
serDflowcontrolOff();
serDparity(PARAM_NOPARITY);

// disable flow control
serMode(0);

// Clear serial data buffers
serDwrFlush();
serDrdFlush();

And lastly a lot of GSM modems come with flow control on as default. You’ll have to disable the modems flow control with a full serial port first, usually the AT&K command, before your 3 wire interface serial port will be able to talk to the GSM.