Zuhause> Blog> SoPC+GPS/GSM realizes vehicle condition monitoring system

SoPC+GPS/GSM realizes vehicle condition monitoring system

February 22, 2023

introduction:

The SoPC-based automotive safety monitoring system uses Altera's latest SoPC (Programmable System-on-Chip) solution, the Nios processor soft core, to monitor the parking and operating status of the car with GPS and GSM systems.

The SoPC-based vehicle safety monitoring system can be widely used in the anti-theft, routine maintenance and traffic accident handling of automobiles, providing an effective test method for vehicle faults.

1 system hardware components

The design uses Altera's SoPC development tools. The development of the system includes two major parts of hardware and software. Using SoPC Builder to generate Nios embedded processors, Nios embedded processor development tools allow users to configure one or more Nios CPUs, add peripherals from the standard library, integrate custom systems, and compile the system with Quartus II design software. The steps of software development are: using the software files generated by SoPC Builder, writing assembly language or C/C++ source program with text editor, programming, building and debugging with GNUPro software development tools. GNUPro builds source programs (including assembly/compilation and linking) into executable programs, and debugs and runs executable programs through download cables. Quartus II design software provides a comprehensive and efficient design environment that integrates design, synthesis, layout and validation, as well as third-party EDA tool interfaces in a seamless environment. You can create your own Nios CPU system with SoPCbuilder integrated in the Quartus II 3.0. Nios is a 16/32-bit embedded processor soft core developed by Altera Corporation.

The school research fund project "SOPC-based vehicle safety monitoring system" is funded. Altera Corporation has introduced a new generation of FPGAs. The design uses the low-cost Cyclone series EP1C12, which has 12 060 logic cells, 52 M4K RAM blocks, 239 616 RAM bits and 2 phase-locked loops. I/O pin 249.

The block diagram of the system hardware consists of two parts, the Nios system and the external device, as shown in Figure 1.



Nios system includes CPU (Nios), memory (memory), timer (timer), bus and parallel/serial interface (key_pio, led_pio, lcd_pio, ccs_pio, uart_0, and uart_1), etc., and the serial interface is implemented separately with the keyboard. , LED and LCD displays, automotive central control systems, and connections to external devices such as GPS and GSM systems. The Nios system design and design results are shown in Figure 2 and Figure 3, respectively.





The Nios system is relatively simple to connect to external devices such as keyboards, LEDs and LCD monitors, automotive central control systems, and GPS systems. The connection to the GSM system is complex, as shown in Figure 4.

GSM system

The whole system works as follows: information from the car's central control system and GPS system can be displayed on the LED and LCD display, or wirelessly via the GSM system. The user can control the system through the keyboard, or remotely control the car's central control system through the GSM system.

This article refers to the address: http://



2 system software components

The system software mainly consists of the main program, the GPS management subroutine and the GSM management subroutine.

The main program completes the initialization of the system, as well as the operation management of the keyboard, LED, LCD display and car central control system.

The GPS management subroutine is primarily responsible for receiving time and location information from the GPS system.

The binary command to request the GPS system to return ASCII time position information is:

@@EqmC

Wherein, when m is 0, the response information (query) is output once, and when m is 1 to 255, the response information is output every 1~255 s (continuous);

C is the checksum (Eqm is XORed by byte);

For carriage return (hex 0d);

Wrap (hex 0a);

The command length is 8 bytes.

The response information for the command is:

@@Eq,mm,dd,yy,hh,mm,ss,dd,mm.mmmm,n,ddd,mm.mmmm,w, shhhhh.h,sss.s,hhh.h,m,t,dd. d,nn,rrrr,aa,CCC

Date: mm is the month (01~12), dd is the day (01~31), and yy is the year (99~19).

World Time (UTC): hh is the time (00~23), mm is the minute (00~59), and ss is the second (00~59).

Latitude: dd is degree (00~90), mm.mmmm is minute (00~59.9999), and n is direction (N is north and S is south).

Longitude: ddd is degree (000~180), mm.mmmm is minute (00~59.9999), w is direction (W is west, E is east).

The message length is 96 bytes.

The corresponding management subroutine is:

Int eq[8]={"@","@","E","q",1,"C",0x0d,0x0a};

Void gps_txd(int data[], int n) {

Volatile int m,sum=0;

For(m=0;m

While(~na_uart_0->np_uartstatus & 0x40);

/waiting to send ready

If(m!=n-3) {

Sum^=data[m];/calculate checksum

Na_uart_0->np_uarttxdata=data[m];/send data

}else

Na_uart_0->np_uarttxdata=sum; /send checksum

}

}

Int gps, gps_buf[46];/Define global variables

Void gps_rxd(int context) {/receive interrupt service routine

Gps_buf[gps]=na_uart_0->np_uartrxdata; /receive data

If(gps_buf[gps++]=="q") gps=0; /data positioning

If(gps>46) gps=46;/ignoring useless data

}

The GSM management subroutine is mainly responsible for data transmission and reception management of the GSM system.

The data transmission and reception of the GSM system is carried out in the form of short messages. The AT command for selecting the short message format is AT+CMGF, and the AT commands for sending and receiving short messages are AT+CMGR and AT+CMGS respectively. The corresponding management subroutine is:

Cmgf[20]={"A","T","+","C","M","G","F","=","1",0x0d};/SMS format void gsm_txd (int data[], int n) {

Volatile int m;

For(m=0;m

While(~na_uart_1->np_uartstatus & 0x40);

/waiting to send ready na_uart_1->np_uarttxdata=data[m]; /send data

}

}

Int gsm=2, gsm_buf[18]={"A","T"};

Void gsm_rxd(int context) {

/ Receive Interrupt Service Routine

Gsm_buf[gsm]=na_uart_1->np_uartrxdata; /receive data

If(gsm_buf[gsm]=="T") gsm=1;

/data positioning

If(++gsm==18) gsm=2;

}

3 Design debugging methods and design results

The actual trial results show that the SoPC-based vehicle safety monitoring system operates normally, with accurate positioning, reliable data transmission, and convenient operation and management. If equipped with GIS (Geographic Information System), the whole system will be even more powerful.
Kontaktiere uns

Author:

Ms. Zoe Zhong

Phone/WhatsApp:

+86 18617178558

beliebte Produkte
You may also like
Related Categories

Mail an Lieferanten

Fach:
E-Mail-Adresse:
Nachrichten:

Your message must be betwwen 20-8000 characters

Kontakten

  • Telefonnummer: 86-186-17178558
  • Whatsapp: +86 18617178558
  • E-Mail-Adresse: sales07@ynxantenna.com
  • Firmenadresse: Room #101,201,301,5BLDG , No.4 of XinWuCun New Area ,Shabo community Maluan Street Pingshan District, Shenzhen ,Guangdong , China, Shenzhen, Guangdong China

Send Inquiry

We will contact you immediately

Fill in more information so that we can get in touch with you faster

Privacy statement: Your privacy is very important to Us. Our company promises not to disclose your personal information to any external company with out your explicit permission.

senden