EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / problem with sending sms from atmega32

problem with sending sms from atmega32

|

Microcontroller › AVR › problem with sending sms from atmega32

  • This topic has 2 replies, 2 voices, and was last updated 12 years, 2 months ago by AJISH ALFRED.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 30, 2013 at 2:10 pm #2216
    rama
    Participant

    hi…, we typed this code  for sending sms from atmega32 using sim300.but its not responding.. can you please help us as soon as possible                                                    #include <avr/io.h>

    #include <stdio.h>

    #define F_CPU 16000000ul

    #include <util/delay.h>

    ?

    #define BAUD 9600

    #define MYUBRR F_CPU/16/BAUD-1

    ?

    void usart_init(uint16_t ubrr);

    void usart_putchar(char data);

    void usart_pstr (char *s);

    void usart_init( uint16_t ubrr) {

    //PORTD=0x00;

    //DDRD=0x02;

    // Set baud rate

    UBRRL = (uint8_t)ubrr;

    UBRRH = (uint8_t)(ubrr>>8);

     

    // Enable receiver and transmitter

    UCSRB = (1<<RXEN)|(1<<TXEN);

    // Set frame format: 8data, 1stop bit

    UCSRC = (1<<URSEL)|(3<<UCSZ0);

    }

    unsigned int usart_getch()

    {

    while (!(UCSRA & (1 << RXC)) ); // Do nothing until data has been received and is ready to be read from UDR

    _delay_ms(1);

    return(UDR); // return the byte

    }

    ?

    void usart_putchar(char data) {

    // Wait for empty transmit buffer

    while ( !(UCSRA & (_BV(UDRE))) );

    // Start transmission

    UDR = data;

    }

    void usart_pstr(char *s)

    {

    // loop through entire string

    while (*s) {

    usart_putchar(*s);

    s++;

    }

    }

    int main()

    {

    //PORTD=0x00;

    //DDRD=0x02;

    usart_init(MYUBRR);

    //usart_pstr(“AT+CMGD=1;rn”);

    usart_pstr(“ATArn”);

     

    usart_pstr(“AT+CMGF=1rn”);

    _delay_ms(2000);

    usart_pstr(“AT+CMGS=”+919141147771″rn”);

    _delay_ms(2000);

    usart_pstr(“hellor”);

    usart_pstr(“0x1Arn”);

    return 0;

    }

    March 30, 2013 at 3:44 pm #9396
    rama
    Participant

    8 views not even one reply:( pls guys im in final year BE and need to continue my project… Pls do help me soon pls

    April 2, 2013 at 4:19 pm #9411
    AJISH ALFRED
    Participant

    Hi Rama,

    Have you tried to send the same command using hyperterminal? How was the response?

    If you did, then connect your microcontroller to the PC hyperterminal and then run the code. You should get the same commands there. If you don’t get the same commands, then only you have to worry about the code. Otherwise it might be just a connection mistake.

    Try and update the result.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Fun with AI and swordfish basic June 23, 2025
  • Simple LED Analog Clock Idea June 23, 2025
  • Microinverters and storeage batteries? June 23, 2025
  • PIC KIT 3 not able to program dsPIC June 23, 2025
  • Is AI making embedded software developers more productive? June 23, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise