telit GM862 with a m64

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi everyone~!

i bought a telit GM862 development board and i can successfully make phone calls, send sms, by sending the string commands from my laptop. i'm now trying to do it from a m64 but i get no response - the voltage levels are ok - 3.8V to power telit, 2.8 for the communication lines -(using a volt level translator) --> running the m64 at 3V3. baud rate 19200

is there a better way to send an AT command (string) to the telit module? for instance, using hyperterminal if i send 'AT' i get a response 'OK'.

should i send this 'AT' command like

USART1_TX(65);
USART1_TX(84);

or maybe

for (i=0; i<2; i++)
{// send AT to telit
USART1_TX(test[i]);
}

where char test[2] = {65,84};//,13,0}; // A T x0d x00

i found this line on the internet

Serial.print("AT\r\n");

but not sure if 'serial.xx' is declared in some library... any input much appreciated!

thank you!
- Eric

EDIT - i do know that the GM862 transmits on RxD and receives on TxD

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was going to suggest that you might have TxD and RxD the wrong way round until I saw your edit. That caught me out with another Telit module. :)

In my software (PIC assembler) I wrote a routine that sent strings to the module. That serial.print function should work.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks Leon,
i found the line

Serial.print("AT\r\n");

somewhere on the internet but couldn't find the function -
wouldn't that line be something similar to

for (i=0; i<2; i++) 
{// send AT to telit 
USART1_TX(test[i]); 
}
where char test[2] = {65,84};
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think you need a CR and LF, as well as "AT".

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

still trying but no luck yet... here's my code if anyone can catch something i'm missing... btw - i have telit at USART1 and the xbee to send the telit response to my laptop at USART0... thank you!

#define F_CPU 7372800UL						
#define BAUDRATE 19200	
#define UBRR_VALUE ((F_CPU/(BAUDRATE*16UL)) - 1)

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 					
#include 

#define true 1 
#define false 0 

volatile char byte;

#define Rx_buffer_size	10
#define Rx_pos_end		(Rx_buffer_size - 1)
volatile unsigned char Rx_bufferN = 0;	
volatile unsigned char Rx_buffer[Rx_buffer_size];


void USART_init()
{	
	UBRR0L = UBRR_VALUE;					
	UBRR0H = (UBRR_VALUE >> 8);			
	UCSR0B |= (1<<RXEN0) | (1<<TXEN0) | (1<<RXCIE0);	

	UBRR1L = UBRR_VALUE;	 		
	UBRR1H = (UBRR_VALUE >> 8);	
	UCSR1B = (1 << TXEN1);
}

void USART0_TX(unsigned int byt)					
{
	while(!(UCSR0A & (1 << UDRE0)))
	{		}	
	UDR0 = byt;			
} 

void USART1_TX(unsigned int byt)					
{
	while(!(UCSR1A & (1 << UDRE1)))
	{		}	
	UDR1 = byt;			
} 

ISR(USART1_RX_vect)						
{		
	byte = UDR1;
	if (Rx_bufferN == 0)
	{	
		Rx_buffer[Rx_bufferN] = byte;
		Rx_bufferN++;
	}
	else if (Rx_bufferN > 0 && Rx_bufferN < Rx_pos_end)
	{	
		Rx_buffer[Rx_bufferN] = byte;
		Rx_bufferN++;	
	}
	else if (Rx_bufferN == Rx_pos_end)
	{
		Rx_buffer[Rx_bufferN] = byte;	
		Rx_bufferN = 0;
	}
}

void turnOnOff(void)
{
	PORTA = 0b00000001;		
	_delay_ms(1500); // send impulse for 1.5secs 
	PORTA = 0b00000000;
}

int main(void)				
{
	_delay_ms(250);

	USART_init();	
	sei();

	DDRA = 0b00000101;	// PA0: output - controls ON/OFF telit
						// PA2: RESET

	int i;
	char test[4] = {65,84,13,10};
	// A,T,carriage return, line feed

	turnOnOff();
	_delay_ms(2000);
	_delay_ms(2000);
	
	while(1) // telit is on
    {	
		USART0_TX(68);// test char
		
		for (i=0; i<4; i++)//send AT to telit
		{
			USART1_TX(test[i]);
		}

		_delay_ms(1000);

/* NOW SEND response to xbee assuming response
was caught with the ISR */
		for (int i=0; i<10; i++)
		{
			USART0_TX(Rx_buffer[i]);
		}
	
		_delay_ms(5000);
		_delay_ms(5000);
    }
return 0;
}