CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

comunication problems with GSM Modem TC35i

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nicenoise



Joined: 10 May 2004
Posts: 17
Location: barcelona

View user's profile Send private message

comunication problems with GSM Modem TC35i
PostPosted: Wed Oct 04, 2006 6:12 am     Reply with quote

hello,
i have a big problem... i dont understand what's happend with this system!!!
i'm trying to connect the TC35i siemens gsm modem to the pic18f452 CCS development kit with the serial cable!!!

the conection with the terminal and modem is good!!!

the conection with the terminal and the pic is good!!!

but the conection with the pic and the modem dosent works!!!!!!!!

this is my code!!!!
if i receive something to the buffer,
the yellow led connected to B4 blinking with every caracter received!!!


Code:

#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=19200, xmit=PIN_C6, rcv=PIN_C7, PARITY=N, BITS =8 )  // Jumpers: 8 to 11, 7 to 12

#define BUFFER_SIZE 32
BYTE buffer[BUFFER_SIZE];
BYTE next_in = 0;
BYTE next_out = 0;


#int_rda
void serial_isr() {
   int t;

   buffer[next_in]=getc();
   t=next_in;
   next_in=(next_in+1) % BUFFER_SIZE;
   if(next_in==next_out)
     next_in=t;           // Buffer full !!
}

#define bkbhit (next_in!=next_out)

BYTE bgetc() {
   BYTE c;

   while(!bkbhit) ;
   c=buffer[next_out];
   next_out=(next_out+1) % BUFFER_SIZE;
   return(c);
}

void tx_data(void)
{
   putc(65); // Transmit "AT" through serial port
   putc(84);
   putc(13);
   putc(10);

}

void main() {

   enable_interrupts(global);
   enable_interrupts(int_rda);

   printf("\r\n\Running...\r\n");
   output_low(PIN_B5);

   do {
   
      tx_data();
      delay_ms(1000);
      //printf("\r\nBuffered data => ");
      while(bkbhit){
        putc( bgetc() );
        output_low(PIN_B4);
        delay_ms(50);
        output_high(PIN_B4);
        delay_ms(50);
      }
      output_high(PIN_B4);
     
   } while (TRUE);
}


it's possible the problem are the pins DSR and CTS???
there isn't connected in the minijack-232 cable of the kit!!!
this pins put on when i connect the modem to the terminal,
but not put on when i connect the pic to the terminal,

i need help!!!!!!
please!!!!

thanks,

Alex Sad
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 04, 2006 6:56 am     Reply with quote

Quote:
the conection with the terminal and modem is good!!!


Terminal == DTE, Modem == DCE, Problem = No

Quote:
the conection with the terminal and the pic is good!!!


Terminal == DTE, PIC == DCE, Problem = No

Quote:
but the conection with the pic and the modem dosent works!!!!!!!!


PIC == DCE, Modem == DCE, Problem = YES
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
nicenoise



Joined: 10 May 2004
Posts: 17
Location: barcelona

View user's profile Send private message

PostPosted: Wed Oct 04, 2006 7:40 am     Reply with quote

hello,
but,
how can i convert a DCE (Data Communications Equipment)
into a DTE (Data Terminal Equipment)???
i don't understand where is the difference...

Smile

thanks...

alex
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 04, 2006 7:53 am     Reply with quote

You need a different cable. The first two use a straight thru cable. The last option requires the transmit and receive pins to be transposed.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
nicenoise



Joined: 10 May 2004
Posts: 17
Location: barcelona

View user's profile Send private message

PostPosted: Wed Oct 04, 2006 9:47 am     Reply with quote

thanks,
now it's working!!!

alex
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group