circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 151 February 2003
GPS-GSM Mobile Navigator


ACCESSORIES

An AT45D021’s serial-interface flash memory is used as a black box to store data packages. The 2,162,688 bits of memory are organized as 1024 pages of 264 bytes each. In addition to the main memory, the micro also contains two data SRAM buffers of 264 bytes each. The simple SPI serial interface facilitates the hardware layout, increases system reliability, and reduces the package size and active pin count. The AT90S8515 saves GPS data to flash memory via an SPI port at a user-defined specific interval. Or it reads data from the flash memory to backup to PC. Up to 2160 pieces of information can be stored in flash memory.

Because the AT90S8515 has only one UART port, another chip is used to expand the serial port for three kinds of different functions. The digitally controlled MC14052B analog switch is a dual four-channel multiplexer. With two I/O pins, the AVR controls it to switch among three channels, all of which are UART serial interfaces.

One MAX202 chip accomplishes the conversion between TTL/CMOS level and RS-232 level, which is necessary for the RS-232 interface between the navigator and PC. Using the RS-232 port, the system can backup the data in flash memory to the PC. Also, you can change some system parameters through the PC via the RS-232 port.

With two control pins and four data pins, the AVR gives the LCD specific information to display. Port pins PC2 through PC4 individually sense the three push-button switches. There is a Menu button to select the work mode, and an Enter button to confirm the selection. The third is an SOS button used to send an alarm message to the control center.

SOFTWARE DESCRIPTION

We used the powerful BASCOM-AVR to develop the software. An IDE is provided with an internal assembler. You can also generate Atmel OBJ code. Additionally, the BASCOM-AVR has a built-in STK200/300 programmer and terminal emulator. Other notable features include: structured BASIC with labels; fast machine code instead of interpreted code; special commands for LCDs; I2C; one wire; PC keyboard and matrix keyboard; RC5 reception; and RS-232 communications. The BASCOM-AVR has an integrated terminal emulator with download option, an integrated simulator for testing, and an integrated ISP programmer.

You can easily write the firmware for this project using the BASCOM-AVR. And with the ISP benefit of AVR, on-line emulation is almost unnecessary, so you can program and test with ease. The flow charts in Figures 3 and 4 describe the AT90S8515 program that controls the devices. The software handles a number of key functions, such as initializing the system and starting the GPS and GSM modules. The software also selects the working mode. Additionally, it checks and sets the system parameters in mode 0, backs up the trace data stored in flash memory to the PC in mode 2, and resets the system parameters in mode 3.

(Click here to enlarge)

Figure 3—After initialization, you can select the function mode by pressing the Menu button and Enter button. The LCD will show the status and system parameters.

 

(Click here to enlarge)

Figure 4—The main function is mode 1. The AT90S8515 microcontroller receives the ship location data every 2 s from the GPS module, and then saves the data in flash memory every 20 s. At a user-defined time interval, the AT90S8515 sends the location data to the control center, and then receives the control information from the control center via the GSM module.

Mode 1 is the standard working mode during which many tasks are completed. During mode 1, the GPS signals are read every 2 s from a satellite; the location information is saved in flash memory every 20 s; and the GSM module sends location data to the control center according to the given interval time. Meanwhile, the navigator receives the control information from the control center from the GSM module.

APPLIED TECHNOLOGY

Our system is now being used in Shanghai Port, China for navigation and monitoring of ships. Aside from tracking ships, the GPS-GSM Mobile Navigator can also find use in other applications, such as navigating taxis. The system works quite well, and we plan to adapt it for future projects.