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 / How to program a ATmega16 with GPS (basic)?

How to program a ATmega16 with GPS (basic)?

|

Microcontroller › AVR › How to program a ATmega16 with GPS (basic)?

  • This topic has 3 replies, 3 voices, and was last updated 12 years, 8 months ago by sushant.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 19, 2013 at 8:08 am #2194
    Claes
    Participant

    Hi guys

     

    Im sitting here with a school project, where  I need to program a ATMEGA16 with gps. i need my gps singal to show me latitudes and longitudes any one know how i do that?

    March 19, 2013 at 4:23 pm #9346
    AJISH ALFRED
    Participant

    Hi,

    Tell you the first step. Connect the GPS module to the serial port of your PC, and use any application like hyperterminal to view what all data comes.

    Next connect the GPS module to the serial port of the microcontroller, write a program to read the data, collect only the data you require.

    March 20, 2013 at 11:36 am #9355
    Claes
    Participant

    yearh i know that, my problem is the code? i dont understand how to code the program i need

    March 31, 2013 at 4:25 am #9400
    sushant
    Participant

     

    CODE VIII:
    #include <avr/io.h>
    BRiCS
    Page
    7
    #include <avr/interrupt.h>
    #include <util/delay.h>
    char status = 0,index = 0,lat[10] = ” “,lon[10] = ” “;
    char sat[2] = “**”,dop[4] = “****”,tim[6] = “******”;
    ISR(USART_RXC_vect){
    unsigned char c;
    c = UDR;
    if (c==’$’){status = 1;index = 0;}
    else if((index == 3)&(c != ‘G’)) status=0;
    else if((index == 4)&(c != ‘G’)) status=0;
    else if(index> 6 & index< 13)tim[(index- 7)]=c;
    else if(index>17 & index< 27)lat[(index-18)]=c;
    else if(index>30 & index< 40)lon[(index-31)]=c;
    else if(index>44 & index< 47)sat[(index-45)]=c;
    else if(index>46 & index< 51)dop[(index-47)]=c;
    if(status==1)
    index++;
    }
    int main(void) {
    set_uartbaud(9600);
    enable_uart_rxcint();
    LCDinit();
    LCDclr();
    sei();
    while (1) {
    _delay_ms(200);
    LCDGotoXY(0,0);
    LCDstring(lat,10);
    LCDstring(sat,2);
    LCDstring(dop,4);
    LCDGotoXY(0,1);
    LCDstring(lon,10);
    LCDstring(tim,6);
    }
    }
  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • volkswagen car stereo model rcd310 December 11, 2025
  • Dog fence help December 11, 2025
  • anyone recognizes this laser diode? December 10, 2025
  • How to power motors for lumbar support? December 10, 2025
  • EEPROM not being written or read on dsPIC30F2010 December 10, 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