System Controllers: A Navya Vishnu 1210410304
System Controllers: A Navya Vishnu 1210410304
System Controllers: A Navya Vishnu 1210410304
ELECTRONIC WARFARE
Electronic warfare (EW) refers to any action involving the use of the electromagnetic spectrum or directed energy to control the spectrum, attack an enemy, or impede enemy assaults via the spectrum. EW includes three major subdivisions: Electronic Attack (EA), Electronic Protection (EP), and Electronic warfare Support (ES).
PROJECT DESCRIPTION
The objective of the project is to design a system controller which can interface the following: Can interface USART module: with RS-485, RS-232 support Eight Single ended Analog sensors interface In-Circuit Serial (ICP)Programming Eight Pulse counting sensors interface
BLOCK DIAGRAM
APPLICATION
The project is used in the Electronic Warfare to check and control the status of different modules and to communicate through serial communication, using RS232, RS485 and CAN Bus.
MAIN CONSTITUENTS
MICROCONTROLLER
A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Micro suggests that the device is small, and controller suggests that it is used in control applications.
Micro controller used in this project is PIC18F2580 PIC is a family of modified Harvard architecture microcontrollers made by Microchip Technology. PIC18F2580 has integrated CAN module.
CAN INTERFACE
CAN-Controller Area Network CAN bus is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer. CAN was initially created by German automotive system supplier Robert Bosch in the mid-1980s for automotive applications as a method for enabling robust serial communication.
The CAN bus has a multimaster structure where each device on the bus can send or receive data. Only one device can send data at any time while all the others listen. If two or more devices attempt to send data at the same time, the one with the highest priority is allowed to send its data while the others return to receive mode.
RS-232
RS-232 is a standard interface approved by the Electronic Industries Association (EIA) for connecting serial devices. In serial I/O, data can be transmitted as either current or voltage. When data is transmitted in the form of voltage, RS232 is the commonly used standard.
The driver used is MAX233.This is an RS232 <=> TTL interface chip that needs no external capacitors. The MAX233 uses no external components and are recommended for applications where printed circuit board space is critical Applications: Portable computers Low power modems
MAX 233
RS-485
When communicating at high data rates, or over long distances in real world environments, RS-485 is used. This standard is published by ELECTRONIC INDUSTRIES ALLIANCE (EIA). It can offer data transmission speeds of 35Mbits/s upto 10m and 100Kbits/s at 1200m.
ADM489 is used as a driver and enable control for RS485 communication. ADM489 is chiefly intended for balanced data transmission. The ADM489 is low power, differential line transceiver suitable for communication on multipoint bus transmission lines. Applications: Local area networks Data multiplexers
Sensors
A sensor (also called detector) is a converter that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. The sensitivity is then defined as the ratio between output signal and measured property. Analog sensors give a signal output which is proportional to sensing quantity. They produce an analog (continuous) voltage that typically varies from 0 to 5 volts.
Examples of analog sensors: Potentiometers Proximity Accelerometers Pulse sensors count the number of pulses and give a digital output in TTL range. This information can be used by the microcontroller and can be used for further accessing of data. Example: counters
Hardware Design
The hardware design of the project is implemented by using a Computer Aided Design (CAD) tool. The CAD tool used in the project is OrCAD. OrCAD is a proprietary software tool suite used primarily for electronic design automation. The software is mainly used to create electronic schematics and electronic prints for manufacturing printed circuit boards.
CGND
C5V
R1 U1 2 AN0 AN1 AN2 AN3 DIO1 AN4 CGND DIO2 DIO3 DIO4 DIO5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 MCLR/VPP/RE3 RA0/AN0 RA1/AN1 RA2/AN2/VREFRA3/AN3/VREF+ RA4/T0CKI RA5/AN4/*SS/HLVDIN VSS OSC1/CLK1/RA7 OSC2/CLK0/RA6 RC0/T1OSO/T13CKI RC1/T1OSI RC2/CCP1 RC3/SCK/SCL 18F2580 RB7/KBI3/PGD RB6/KBI2/PGC RB5/KBI1/PGM RB4/KBI0/AN9 RB3/CANRX RB2/INT2/CANTX RB1/INT1/AN8 RB0/INT0/AN10 VDD VSS1 RC7/RX/DT RC6/TX/CK RC5/SDO RC4/SDI/SDA 28 27 26 25 24 23 22 21 20 19 18 17 16 15 DIO10 DIO9 DIO8 AN6 AN5 AN7 C5V CGND RXD TXD DIO7 DIO6 U4 CGND C5V 1 2 TXD 3 VSS 4 VDD RXD 8 RS 7 CANH 6 CANL 5 VREF CGND CANH CANL
1 JP1
Y1
C2
C3
CGND
U2 1 RS485_RX 2 RE 3 DE 4 RS485_TX 5 CGND 6 CGND 7 NC1 RO *RE DE DI GND1 GND VCC NC2 A B Z Y NC 14 13 12 11 10 9 8 C5V AN0 RxT_RS485 RxF_RS485 TxF_RS485 TxT_RS485 R2 C4 CGND AN1 R3 C5 CGND AN2 R4 CGND C6 AN3 R5 C7 CGND SI3 AN7 R9 C8 CGND SI2 AN6 R8 C9 CGND SI7 SI1 R6 AN5 R7 C10 CGND SI6 C11 CGND SI5 SI0 AN4 SI4
ADM489ANZ U3 TXD RXD RX TX CGND C5V CGND 1 2 3 4 5 6 7 8 9 10 T2IN T1IN R1OUT R1IN T1OUT GND1 VCC (V+)C1+ GND (V-)CSR2OUT R2IN T2OUT VC2C2+ V+(C1-) C1-(C1+) V-(C2+) C2+(C2-) MAX233 20 19 18 17 16 15 14 13 12 11
Title <Title> Size A Date: Document Number <Doc> Monday , June 03, 2013 Sheet 1 of 1 Rev <Rev Code>
C12
JD1A C5V JDR1 SI0 SI1 SI2 SI3 SI4 1 2 3 4 5 1 6 2 7 3 8 4 9 5 CGND RE 6 7 8 9 SI5 RxT_RS485 SI6 TxT_RS485 SI7 TX CGND CANH DI10 CONN DSUB 9-R DI8 DI6 DI4 DI2 DI0 13 11 9 7 5 3 1 15 17 19 25 23 21 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 U1 24 22 20 18 16 14 12 10 8 6 4 2 CGND DE RxF_RS485 TxF_RS485 RX CANH CGND DI9 DI7 DI5 U3 DI3 DI1 C15 C14 U2 C13
Title <Title> Size A Date: Document Number <Doc> Monday , June 03, 2013 Sheet 1 of 1 Rev <Rev Code>
Software Design
The software design of the project is implemented by by using Mikroc PRO for PIC programmer. The mikroC PRO for PIC is an user-friendly and intuitive environment. The mikroC PRO for PIC is a powerful, feature-rich development tool for PIC microcontrollers. It is designed to provide the programmer with the easiest possible solution to developing applications for embedded systems, without compromising performance or control.
// Test Configuration : MCU : PIC18F2580 OSCILLATOR : HS, 10 MHz A/D Conversion Clock : 312.5KHz(Fosc/32) Acquisition time : 12.8usec Software : mikroc PRO for PIC VREF+ : AVDD VREF: AVss // ******** A/D CONVERTER MODULE *********** void ADCINIT() { TRISA=0x2F; // Initializing AN0-AN4 as input ports TRISB=0x13; // Initializing AN8-AN10 as input ports ADCON1=0x00; // configuring all 8 analog pins with VREF- = AVss and VREF+ =AVdd ADCON2=0x12; // result : left justified ; Tacq=4TAD ; a/d clock :fosc/32; } unsigned int ADCREAD(unsigned char ch) { switch (ch) { case(0): ADCON0=0x00; // AN0 is selected break; case(1): ADCON0=0x04; // AN1 is selected break;
case(2): ADCON0=0x08; break; case(3): ADCON0=0x0C; break; case(4): ADCON0=0x10; break; case(5): ADCON0=0x20; break; case(6): ADCON0=0x24; break; case(7): ADCON0=0x28; break;
// AN2 is selected
// AN3 is selected
// AN4 is selected
// AN8 is selected
// AN9 is selected
// AN10 is selected
} ADON_bit=1; //switch on the adc module GO_DONE_bit=1; //Start conversion while(GO_DONE_bit); //wait for the conversion to finish ADON_bit=0; //switch off adc return ADRESH; // return the result of a/d conversion }
void main() { char read ; int i; char str[20]="hello world" ; TRISC = 0xFF; // initializing port c as input port PORTC = 0xFF; Usart_Init(9600); // initializing usart module(library function in mikroc PRO for PIC) while(1) { for (i=0;i<=strlen(str);i++) { Usart_Write(str[i]); delay_ms(100); read=Usart_Read(); delay_ms(100); Usart_Write(read); delay_ms(100); }
} }
// sending the character string hello world // receiving the data sent // resending the data received
// File name : CAN.c // Test Configuration : // MUC : PIC18F2580 // OSCILLATOR : HS , 10 Mhz // Software : mikroc PRO for PIC
// ***** CAN INTERFACE MODULE ***** unsigned short x, y, len, z; unsigned short data[8]; long id; unsigned short zr, cont, oldstate; void main() { PORT A = 0; TRISA = 0; PORTB = 0;
1.
CANInitialize(1,1,3,3,1,x);
CANSetOperationMode(CAN_MODE_CONFIG,0xFF); id = -1;
CANSetMask(CAN_MASK_B1,ID,CAN_CONFIG_XTD_MSG); CANSetMask(CAN_MASK_B2,ID,CAN_CONFIG_XTD_MSG); CANSetFilter(CAN_FILTER_B2_F3,3,CAN_CONFIG_XTD_MSG); CANSetOperationMode(CAN_MODE_NORMAL,0xFF); PORTB = 0xFF; id = 12111; CANWrite(id,data,1,y); while (1) { oldstate = 0; zr = CANRead(&id, data , &len, &z); if ((id == 3) & zr) { PORTB = 0xAA; PORTA = data[0]; data[0]++ ; if (len == 2) PORTB = data[1]; data[1] = 0xFF; id = 12111; CANWrite(id, data, 2,y); } }
CONCLUSION
The importance and robustness of serial communication and its implementation through different interfaces like CAN BUS, RS232,RS485 was studied. For hardware implementation of the project , a detailed research was made on the OrCAD software tool. Similarly to implement software, Mikroc Pro for PIC was well studied and used. As a result , the product has been successfully developed.
THANK YOU