system controllers
TRANSCRIPT
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 1/33
SYSTEM CONTROLLERS
A NAVYA VISHNU1210410304
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 2/33
Electronic warfare (EW) refers to any action involvingthe use of the electromagnetic spectrum or directedenergy to control the spectrum, attack an enemy, orimpede enemy assaults via the spectrum.EW includes three major subdivisions: Electronic
Attack (EA), Electronic Protection (EP), and Electronicwarfare Support (ES).
ELECTRONIC WARFARE
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 3/33
The objective of the project is to design a systemcontroller 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
PROJECT DESCRIPTION
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 5/33
The project is used in the Electronic Warfare to checkand control the status of different modules and tocommunicate through serial communication, usingRS232, RS485 and CANBus.
APPLICATION
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 6/33
Microcontroller CAN interface USART–
RS-232,RS-485 In-Circuit Serial Programming Sensors
MAIN CONSTITUENTS
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 7/33
A microcontroller is a small computer on a singleintegrated circuit containing a processor core,memory, and programmable input/outputperipherals.Micro suggests that the device is small, and controller
suggests that it is used in control applications.
MICROCONTROLLER
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 9/33
Micro controller used in this project is PIC18F2580PIC is a family of modified Harvard architecturemicrocontrollers made by Microchip Technology.PIC18F2580 has integrated CAN module.
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 10/33
CAN-Controller Area NetworkCAN bus is a vehicle bus standard designed to allowmicrocontrollers and devices to communicate witheach other within a vehicle without a host computer.CAN was initially created by German automotivesystem supplier Robert Bosch in the mid-1980s forautomotive applications as a method for enablingrobust serial communication.
CAN INTERFACE
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 11/33
The CAN bus has a multimaster structure where each deviceon the bus can send or receive data. Only one device can
send data at any time while all the others listen. If two ormore devices attempt to send data at the same time, theone with the highest priority is allowed to send its datawhile the others return to receive mode.
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 12/33
RS-232 is a standard interface approved by theElectronic Industries Association (EIA) for connectingserial devices.In serial I/O, data can be transmitted as either currentor voltage.
When data is transmitted in the form of voltage, RS-232 is the commonly used standard.
RS-232
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 13/33
RS-232 Serial Port
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 14/33
The driver used is MAX233.This is an RS232 <=>TTL interface chip that needs no externalcapacitors.
The MAX233 uses no external components andare recommended for applications whereprinted circuit board space is criticalApplications:
Portable computersLow power modems
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 16/33
When communicating at high data rates, or
over long distances in real worldenvironments, RS-485 is used.This standard is published by ELECTRONICINDUSTRIES ALLIANCE (EIA).It can offer data transmission speeds of35Mbits/s upto 10m and 100Kbits/s at1200m.
RS-485
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 17/33
ADM489 is used as a driver and enablecontrol for RS485 communication.ADM489 is chiefly intended for balanceddata transmission.
The ADM489 is low power, differential linetransceiver suitable for communication onmultipoint bus transmission lines.
Applications: Local area networksData multiplexers
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 18/33
In Circuit Serial Programming (ICSP) is a method ofdirectly programming PIC microcontrollers.
Micro-controllers are typically soldered directly to aprinted circuit board and usually do not have thecircuitry or space for a large external programmingcable to another computer. A separate piece ofhardware, called a programmer is required to connectto an I/O port of a PC on one side and to the PIC onthe other side.
In-Circuit Serial Programming
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 20/33
Examples of analog sensors:
PotentiometersProximityAccelerometers
Pulse sensors count the number of pulses and give a
digital output in TTL range. This information can beused by the microcontroller and can be used forfurther accessing of data.Example: counters
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 21/33
The hardware design of the project is implementedby using a Computer Aided Design (CAD) tool. TheCAD tool used in the project is OrCAD.OrCAD is a proprietary software tool suite usedprimarily for electronic design automation. The
software is mainly used to create electronicschematics and electronic prints for manufacturingprinted circuit boards.
Hardware Design
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 23/33
CGND
RXD
C 5 V
C5
RS485_TX
CGND
JP3
1 2
CGND
CGND
JP1
1 2
TXD
AN3
SI5
DIO9
CGND
TX
SI2 AN6
AN7
DIO5
R5
<Doc> <RevCode>
<Title>
A
1 1Monday, June 03, 2013
Title
Size Document Number Rev
Date: Sheet of
TxF_RS485
U4
MCP2551
1234 5
678
TXDVSSVDDRXD VREF
CANLCANH
RS
C5V
AN4
C4
RS485_RX
R3
SI3
C5V
U2
ADM489ANZ
1234567 8
91011121314
NC1RO*REDEDIGND1GND NC
YZB A
NC2VCC AN4
SI6
DIO2
C11
AN5
AN5
TxT_RS485R7
JP41 2
RS485_RX
JP21 2
CGND
CGND
CANL
C5V
C5V
CGND
DIO10
SI1
R8R4CGND
SI0
Y1
DIO1
JP5
1 2
TXD
R2R6
AN2
C2
CGND
C G N D
DIO4C3
AN6
AN7
CGNDCGND
RX C7
RE
CGND
C6C9
AN0
AN1
RxF_RS485
CGND
DIO8
CGND
RxT_RS485
AN2
DIO3
SI4
AN3
R9
RS485_TX
RXD
CGND
U3
MAX233
123456789
10 11121314151617181920
T2IN
T1INR1OUTR1INT1OUTGND1VCC(V+)C1+GND(V-)CS- C2+(C2-)
V-(C2+)C1-(C1+)V+(C1-)
C2+C2-
V-T2OUTR2IN
R2OUT
AN1
CANH
DIO7TX
SI7
DE
R1
RX
DIO6
AN0
C10
CGNDC8
U1
18F2580
1234567
891011121314 15
161718192021
22232425262728
MCLR/VPP/RE3RA0/AN0RA1/AN1RA2/AN2/VREF-RA3/AN3/VREF+RA4/T0CKIRA5/AN4/*SS/HLVDINVSSOSC1/CLK1/RA7OSC2/CLK0/RA6RC0/T1OSO/T13CKIRC1/T1OSIRC2/CCP1RC3/SCK/SCL RC4/SDI/SDA
RC5/SDORC6/TX/CKRC7/RX/DT
VSS1VDD
RB0/INT0/AN10RB1/INT1/AN8
RB2/INT2/CANTXRB3/CANRX
RB4/KBI0/AN9RB5/KBI1/PGMRB6/KBI2/PGCRB7/KBI3/PGD
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 25/33
The software design of the project is implemented byby using Mikroc PRO for PIC programmer. The mikroCPRO for PIC is an user-friendly and intuitiveenvironment. The mikroC PRO for PIC is a powerful,feature-rich development tool for PICmicrocontrollers. It is designed to provide theprogrammer with the easiest possible solution to
developing applications for embedded systems,without compromising performance or control.
Software Design
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 26/33
// 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;
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 27/33
case(2): ADCON0=0x08; // AN2 is selected break; case(3): ADCON0=0x0C; // AN3 is selected break; case(4): ADCON0=0x10; // AN4 is selected break; case(5): ADCON0=0x20; // AN8 is selected
break; case(6): ADCON0=0x24; // AN9 is selected break; case(7): ADCON0=0x28; // AN10 is selected break; } 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
}
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 28/33
// Test Configuration :// MUC : PIC18F2580// OSCILLATOR : HS , 10 Mhz// BAUD RATE : 9600// Software : mikroc PRO for PIC
// ****** USART MODULE ******* 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 ]); // sending the character string “hello world” delay_ms(100); read=Usart_Read(); // receiving the data sent
delay_ms(100); Usart_Write(read); // resending the data received delay_ms(100); } } }
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 29/33
// 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;
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 30/33
TRISB = 0; x = 0; y = 0; z = 0; y = CAN_TX_PRIORITY_0 & CAN_TX_XTD_FRAME &
1. CAN_TX_NO_RTR_FRAME; x = CAN_CONFIG_SAMPLE_THRICE & CAN_CONFIG_PHSEG2_PRG_ON &
CAN_CONFIG_STD_MSG &
CAN_CONFIG_DBL_BUFFER_ON & CAN_CONFIG_VALID_XTD_MSG & CAN_CONFIG_LINE_FILTER_OFF; data[0] = 0;
CANInitialize(1,1,3,3,1,x); CANSetOperationMode(CAN_MODE_CONFIG,0xFF); id = -1;
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 31/33
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); } }
8/13/2019 System Controllers
http://slidepdf.com/reader/full/system-controllers 32/33
The importance and robustness of serialcommunication and its implementation throughdifferent interfaces like CAN BUS, RS232,RS485 wasstudied. For hardware implementation of the project ,a detailed research was made on the OrCAD softwaretool. Similarly to implement software, Mikroc Pro forPIC was well studied and used. As a result , the
product has been successfully developed.
CONCLUSION