GSM 800c is not responding from ATMEGA16

Thread Starter

nishkum3

Joined Jun 5, 2017
14
Hi,
Working on Gsm Project. I wanna comunicate to GSM800C with ATMEGA. But its not responding at all.
I made the F_CPU=16000000 and tried. again i changed the F_CPU=7372800 and again tried. but no success.In the pin configuration i connected mcu txd to gsm rxd and mcu rxd to gsm txd. pin configuration seems all correct. One more important thing i am using the port D(PD2,PD3,PD4) for my LCD command port. I have configured the D as such (DDRD =0b11111110).
==================================================================
#define USART_BAUDRATE 9600
#define BAUD_PRESCALE (((( F_CPU / 16) + ( USART_BAUDRATE / 2)) / ( USART_BAUDRATE )) - 1)


void USART_Init(unsigned long BAUDRATE) /* USART initialize function where BAUDRATE=9600 */
{
UCSRB = (1 << RXEN) | (1 << TXEN); // Turn on the transmission and reception circuitry
UCSRC = (1 << URSEL) | (1 << UCSZ0) | (1 << UCSZ1); // Use 8-bit character sizes

UBRRH = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value into the high byte of the UBRR register
UBRRL = BAUD_PRESCALE; // Load lower 8-bits of the baud rate value into the low byte of the UBRR register

UCSRB |= (1 << RXCIE); // Enable the USART Receive Complete interrupt (USART_RXC)
sei(); // Enable the Global Interrupt Enable flag so that interrupts can be processed
}


=======================================================
I tried to send the following at command..
USART_SendString("AT\r"); /* send AT to check module is ready or not */
LCD_String_xy(1,0,"AT");

==========================================================

ISR(USART_RXC_vect)
{
buff[buffer_pointer] = UDR; /* copy UDR(received value) to buffer */
buffer_pointer++;
status_flag = 1; /* flag for new message arrival */
}
===========================================================

when I print "buff" on LCD, its print junk. not any output. I think something i missed to configure.
 

shteii01

Joined Feb 19, 2010
4,644
When talking to lcd, I have used 8 bit parallel and 4 bit parallel setups. You say you are using 3 pins to talk to lcd (PD2-4). What are you using? SPI?

LCD has to be configured. Have you configured it?
 

Thread Starter

nishkum3

Joined Jun 5, 2017
14
When talking to lcd, I have used 8 bit parallel and 4 bit parallel setups. You say you are using 3 pins to talk to lcd (PD2-4). What are you using? SPI?

LCD has to be configured. Have you configured it?
Its not about LCD. LCD is working fine. I mean to say GSM is not responding. IF i want to know the UDR content on LCD after sending the "AT" command to GSM. Its showing Junk. My point is here that GSM is not responding. Could you please help me on this.
 

shteii01

Joined Feb 19, 2010
4,644
looking at sim800c, it is powered 3.4-4.4 volts, interface to external devices 3V/1.8V. I am not sure why they list 3V and 1.8V, my guess low voltage (3V) and ultra low voltage (1.8V) setups.

Judging by 16 MHz you are doing on ATmega16, you are running ATmega 16 at 5 volts. I don't have enough experience, but make sure your 5V did not damage the sim800c.
 

Thread Starter

nishkum3

Joined Jun 5, 2017
14
looking at sim800c, it is powered 3.4-4.4 volts, interface to external devices 3V/1.8V. I am not sure why they list 3V and 1.8V, my guess low voltage (3V) and ultra low voltage (1.8V) setups.

Judging by 16 MHz you are doing on ATmega16, you are running ATmega 16 at 5 volts. I don't have enough experience, but make sure your 5V did not damage the sim800c.
Thanks for your suggestion. I checked its not damaging, we are providing the circuit appropriate current. i Put Sim card and its working fine.GSM part is good. only problem is that it's not coordinating with atmega16. Not sure Why?
 
Top