Interface Between Maxrs232 And Microcontroller

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

Chapter 2

It is very important to have literature review before starting the project. Literature review is defined as reading, analysing, evaluating and summarizing scholarly materials about a specific topic. By researching many conference research papers and journals, the concept of Frequency shift keying remote control for load appliances .In order to do a literature review, it is a must to understand the literature relevant to the topics that are searching. By doing this, it can help to prevent from repeating previous errors or redoing work which has already been done.

Generally, literature review brings many benefits in doing this project. An up to date account and discussion of the conference research in a particular topic relevant to this project is provided. The ways other people have constructed their own projects is learned and thus a better understanding in this Frequency shift keying Remote Control load appliances is achieved. Also, the methods that other more experienced researchers have used are observed and their footsteps may also be followed.

2.1.2 Theory of the project

For my project, it includes hardware and software. For hardware part, it includes RS232, MaxRS232, PIC16F690, filters and loads appliances such as light. For software parts the Visual basic and Protus had been used in this project in order to create button to act as a remote control and simulate the project before fabrication.

Multiple feedback band-passes filters

PIC to determine when the Relay should turn the load ON

Figure 3: Basic Flow of My Project

2.2 MAX RS-232

The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals that are suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/ receiver and typically converts the RX, TX, CTS and RTS signals. The figure (3.0) below shows the MAX232 chip.

Figure 4: Pin Diagram of MAX232

Table 1.0: Pin Description of MAX232

Pin

Symbol

Description

1

C1+

Capacitor 1+

2

V+

Voltage +

3

C1-

Capacitor 1 -

4

C2+

Capacitor 2 +

5

C2-

Capacitor 2-

6

V-

Voltage -

7

T2out

RS232 Output

8

R2IN

RS232 Input

9

R2OUT

TTL/CMOS Outputs

10

T2IN

TTL/CMOS inputs

11

T1IN

TTL/CMOS inputs

12

R1OUT

TTL/CMOS Outputs

13

R1IN

RS232 Inputs

14

T1out

RS232 Outputs

15

GND

Ground

16

Vcc

Voltage Supply

.

The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V. Figure (4.0) below shows the typical connection of the MAX232 chip to the serial port.

C:\Documents and Settings\Administrator\Desktop\untitled.bmp

Figure 5: The Connection of the MAX232 to the Serial Port.

2.2.1 Serial Port (RS232 to TTL Converter)

Serial communication is taken as a whole in large topic to keep this white paper shorter than a book. It will focus on asynchronous RS232 serial port communications. Primarily in PC world and will emphasize the connectors and UARTs most frequently seen on today PCs.

2.2.2 Serial Port Definitions

A serial port is a connector and related electronics that uses one of a number of serial Input/ output (I/O) standards to interface data communications equipment (DCE) and data terminal equipment (DTE). The serial port usually either a 9- pin (DB-9) or a 25 pin (DB-25) connector, but other types also exist (RJ-11, RJ-12, 8 pin DIN, RJ-45 or DB-37). The serial ports signalling and data handling are managed by a Universal Asynchronous Receiver-Transmitter (UART).

A UART usually designed as a chip produces an electrical signal that follows an accepted serial I/O standard. Among PCs, the usual standard for serial I/O is called RS-232.

RS-232 is a species of serial connection described is a specification written by the Electronic Industrial Association (EIA) which, in conjunction with the telecommunications Industry Association, defined the standards for traditional serial data transfer. Formally the RS-232 standard is called EIA/ TIA -232-F, reflecting the initials of the organizations that administer it.

The RS-232 serial port specification defines the type of RS-232 communications equipment as signalling, electrical, and mechanical characteristics of RS-232 serial ports.

The RS-232 specification defines two type of communication equipment:

DTE: Data Terminal Equipment.

DCE: Data Circuit-Terminating Equipment.

The two different in Pin out assignments-for practical purpose a PC can be considered as a DTE and a modem as a DCE. An RS-232 link connects a DTE and DCE, or uses a crossover (sometimes called a "null-modem") cable to make the connection as if it Ire between a DTE and DCE (as when connection two PCs to each other with a serial cable).

RS-232 signals are indicated by voltage differences with respect to a ground signal, and can vary between +3 to +15 volts and -3 to -15 volts. At same time, serial receivers must be undamaged by voltages up to ±25 volts.

The RS-232 standard defined 25 signal lines in its interface, although in practice rarely use more than nine of these lines. Then the RS-232 I choose has 9 pins.

2.3 Microcontroller

2.3.1 Introduction

Any device that has a remote control almost certainly contains a microcontroller. Basically, any device that interacts with it is user has a microcontroller buried inside. A microcontroller is a highly integrated chip that contains all the components comprising a controller. Typically this includes a CPU, RAM, some form of ROM, I/O ports, and timers.

Unlike a general purpose computer which also includes all of these components, a microcontroller is designed for a very specific take to control a particular system. As a result, the parts can be simplified and reduced, which cuts down on production costs. Microcontrollers are sometimes called embedded system microcontroller, which just mean that they are part of an embedded system that is one part a larger devices or system.

2.3.2 Microcontroller overview

This paragraph describes a brief idea of a simplified block diagram of interior of a microcontroller. This simplified block diagram contains essential blocks:

Figure 6: Simplified Block Diagram of a MCU

The program Memory it contain the written program. The program it set a set of instruction that the microcontroller will perform. The software (instruction) will be written in a computer and the programmed (burned) into the program memory. This memory is EEPROM memory which can be rewritten thousands of times.

The Register and RAM it contains all the internal registers and a small RAM memory where temperature data is sorted. There are several registers with different function. The RAM memory is not large it is a bout 64-128 byte. The content in the Register and RAM information will disappear when the power off.

EEROM it is another memory which works as the RAM. This is a small memory where data can be rad and written, but the data will not disappear when the power is off.

Ports the port is the input and output pins of the actual circuit.

2.3.3 PIC16F690

A PIC16F690 is a microcontroller (MCU) which is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. PIC16F690 is designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications.

PIC16F690 has all single-cycle instructions except branches. The operating speed is 20 MHz oscillator/clock input and 200ns instruction cycle. As for the enhanced USART module which is the main program in this project, it can support RS232, auto-baud detects and auto-wake-up on Start bit. This PIC16F690 has the low power features.

Figure 7: PIC16F690 pin diagram

2.3.4 Interface between MaxRS232 and Microcontroller

A microcontroller (MCU) is a basic part of computer on a single integrated circuit (IC) that contents a processor core, programmable input/output peripherals, and memory (RAM). It is designed mainly for embedded applications which in contrast to the microprocessors used in personal computers.

Microcontrollers are usually found in automatically controlled devices such as appliances, toys, remote controls, radios, television, and many similar areas. It is preferred due to its speed, small size, internal time, interrupt control, and re-programmable flash memory properties. Among the choices, PIC (Peripheral Interface Controller) is the most popular and common used MCU produced by Microchip. It has simple and small sized instruction set because it is produced with RISC (Reduced Instruction Set Computer) architecture. USART stands for Universal Synchronous Asynchronous Receiver and Transmitter. It is sometimes refer to as Serial Communications Interface (SCI). In this case, it is used in asynchronous mode. The most common use of the USART in asynchronous mode is to communicate to a PC serial port using the RS232 protocol. However, a driver is always needed to interface to RS232 voltage level where in the most commonly used is MAX232 chip.

Hence, for device testing purpose, PIC16F90 is connected to COM port of PC with RS232 through MAX232 driver. This can be described in the following diagram.

Figure 8: MAX232 as RS232 Driver

Note than pin 11 and pin 12 are TTL input and output pins while pin 13 and pin 14 are RS232 input and output pins.

The PIC16F90 at master units will send a command signals in a packet through X10 standard to the electrical line with the help of the modem. Modem will convert the digital data from microcontroller to analogue signals to transmit over the electrical line which is analogue based.

There are only two I/O ports in this MCU which are Port A and Port B. Some pins for these I/O ports are multiplexed with an interchange purpose for the peripheral features on the device. Hence, when the peripheral is enabled, that pin may not be used as a general purpose I/O pin.

The PIC16F690 is used at the slave units to determine whether the command received from master unit is belongs to them or not.

2.4 Filter Design

2.4.1 Introduction

In modern electronics, it is important to be able to separate a signal into different frequency regions. In analogy electronics, four classes of filters exist to process an input signal: low-pass, high-pass, band-pass, and band-stop. Further, many different types of filters exist under each major class. For example, elliptical, Butterworth, and Chebyshev filters all exist under the low-pass class of filter. Each filter is classified by a transfer function that defines the gain for the circuit for all input frequencies. While each of these filters may be used under different circumstances, the elliptical filter is a filter with widespread application, due to its sharp frequency cut off and equiband ripples. Also, it exemplifies several characteristics seen in other types of filters, which makes it excellent for student design and analysis.

A filter is a circuit that passes certain frequencies and attenuates or rejects all other frequencies. The pass band of a filter is the range of frequencies that are allowed to pass through the filter with minimum attenuation (usually defined as less than -3dB of attenuation).

2.5Low pass filter

A low pass filter is one that passes frequencies from dc to fc and significantly attenuates all other frequencies. The bandwidth of an ideal low pass filter is equal to fc. Alternative definition low-pass filter is a circuit offering easy passage to low-frequency signals and difficult passage to high-frequency signals. [7]

There are two basic kinds of circuits capable of accomplishing this objective and many variations of each one the capacitive low-pass filter in Figure below

Figure 9: Low pass filter

All low-pass filters are rated at a certain cut-off frequency. That is, the frequency above which the output voltage falls below 70.7% of the input voltage. This cut-off percentage of 70.7 is not really arbitrary, all though it may seem so at first glance. [7]

In a simple capacitive/resistive low-pass filter, it is the frequency at which capacitive reactance in ohms equals resistance in ohms. In a simple capacitive low-pass filter (one resistor, one capacitor), the cut-off frequency is given as:

F=

Figure 10: Comparison of an ideal low-pass filter response

A low-pass filter allows for easy passage of low-frequency signals from source to load, and difficult passage of high-frequency signals.

Inductive low-pass filters insert an inductor in series with the load; capacitive low-pass filters insert a resistor in series and a capacitor in parallel with the load. The former filter design tries to "block" the unwanted frequency signal while the latter tries to short it out. [7]

The Cutoff frequency for a low-pass filter is that frequency at which the output (load) voltage equals 70.7% of the input (source) voltage. Above the cut off frequency, the output voltage is lower than 70.7% of the input, and vice versa.

Figure 11: Idealized low filter response

In order to produce a filter that has a steeper transition region, it is necessary to add additional circuitry to the basic filter.

2.5.1 Lowpass Filter Characteristics

If an ideal low-pass filter is there, it would have completely eliminated signals above the cut-off frequency, and perfectly pass signals below the cut-off frequency. In real filters, various trade-offs are made to get optimum performance for a given application.

Butterworth filters are termed maximally-flat-magnitude-

Response filters, optimized for gain flatness in the pass-band. The attenuation is –3 dB at the cutoff frequency. Above the cutoff frequency the attenuation is –20dB.

Bessel filters are optimized for maximally flat time delay. This means that they have linear phase response and excellent transient response to a pulse input. This comes at the expense of flatness in the pass band and rate of roll off. The cutoff frequency is defined as the –3 dB point.

Chebyshev filters are designed to have ripple in the pass-band, but steeper roll off after the cutoff frequency. Cutoff frequency is defined as the frequency at which the response falls below the ripple band. For a given filter order, a steeper cutoff can be achieved by allowing more pass-band ripple. The transient response of a Chebyshev filter to a pulse input shows more overshoot and ringing than a Butterworth filter.[8]

2.6 Band-Pass Filter

A band pass filter is a device that passes frequencies within certain rang and rejects (attenuates) frequencies outside that range.

Figure 12: Band passes Filter Parameters

The critical frequency or cut-off frequency (Fc) defines the end of the pass band and is normally specified at the point where the response drops – 3dB from the pass band response.

Filter circuits can be designed to accomplish this task by combining the properties of low-pass and high-pass into a single filter. The result is called a band-pass filter. Creating a band pass filter from a low-pass and high-pass filter can be illustrated using block diagrams:[7][8]

High pass filter

Low pass filter Input signal Signal output

Figure 13: System level block diagram of a band-pass filter

What emerges from the series combination of these two filter circuits is a circuit that will only allow passage of those frequencies that are neither too high nor too low. Using real components, here is what a typical schematic might look like Figure below [7][8]

Figure 14: capacitive band-pass filter.

The fact that the high-pass section comes "first" in this design instead of the low-pass section makes no difference in its overall operation. It will still filter out all frequencies too high or too low. While the general idea of combining low-pass and high-pass filters together to make a band pass filter is sound, it is not without certain limitations. Because this type of band-pass filter works by relying on either section to block unwanted frequencies, it can be difficult to design such a filter to allow unhindered passage within the desired frequency range. Both the low-pass and high-pass sections will always be blocking signals to some extent, and their combined effort makes for an attenuated (reduced amplitude) signal at best, even at the peak of the "pass-band" frequency range. Notice the curve peak on the previous SPICE analysis the load voltage of this filter never rises above 0.59 volts, although the source voltage is a full volt. This signal attenuation becomes more pronounced if the filter is designed to be more selective (steeper curve, narrower band of passable frequencies) [7] [8]

2.6.1 Band- Passes Filter Response

A band-pass filter passes all signals lying within a band between a lower-frequency limit and an upper-frequency limit and essentially rejects all other frequencies that are outside this specified band

The bandwidth (BW) is defined as the difference between the upper critical frequency (fc2) and the lower critical frequency (fc1)

BW=Fc2-Fc1

The critical frequencies at which the response curve is 70.7 percent of its maximum and also called 3dB frequencies

The frequency about which the pass band is centered is called the center frequency, f0, defined as the geometric mean of the critical frequencies fo =

The Quality Factor (Q) of a band-pass filter is the ratio of the center frequency to the bandwidth Q=

The value of Q is an indication of the selectivity of a band-pass filter

The higher the value of Q, the narrower the bandwidth and the better the selectivity for a given value of fo

The quality factor (Q) can also be expressed in terms of the damping factor (DF) of the filter as Q=

2.7 High Pass Filter

A high-pass filter's it is just the opposite of a low-pass filter, to offer easy passage of a high-frequency signal and difficult passage to a low-frequency signal

.

Figure 15: High pass filter

The capacitor's impedance (Figure above) increases with decreasing frequency. (Figure below) This high impedance in series tends to block low-frequency signals from getting to load.

Figure 16: filter response

2.7.1 high- Passes Filter Response

A high-pass filter allows for easy passage of high-frequency signals from source to load, and difficult passage of low-frequency signals.

Capacitive high-pass filters insert a capacitor in series with the load; inductive high-pass filters insert a resistor in series and an inductor in parallel with the load. The former filter design tries to "block" the unwanted frequency signal while the latter tries to short it out.

The cutoff frequency for a high-pass filter is that frequency at which the output (load) voltage equals 70.7% of the input (source) voltage. Above the cutoff frequency, the output voltage is greater than 70.7% of the input, and vice versa.



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now