Saturday, 15 April 2017

IMPLEMENTING PERIPHERALS USING 32-BIT ARM MICROCONTROLLER

INTRODUCTION
This project is based on industrial micro controller which is a 32-bit ARM controller. The main objective of the project is to implement the peripherals & interface them which are basic requirement of any industrial project. This is mainly a study project.
Our aim is to develop complete hardware and software for these interfaces. By understanding these standard peripherals and protocol, we get through with some basic protocols which are needed for industrial applications.
DESCRIPTION
            In this project, we will select an industrial specific 32-bit micro controller to implement our interfaces. ARM controllers are 32-bit micro controller which has covered maximum of embedded market. We will work with 32-bit micro controller by implementing on-chip peripherals like Oscillator, voltage reference, ADC, DAC, SPI, SM Bus, Interrupts, Timers, UART, Watch dog timer, Comparator, Reset circuits etc. These all peripherals are needed to develop any project with some display on external. Advantage is that, to develop any project if I use all these peripherals external then different types of supply voltage is required, PCB board size and circuit increases, program size increases etc.
            ARM7TDMI-S architecture based LPC2103 micro controller from NxP is used to implement this project. This is a 32-bit micro controller acts as the heart of the project, which controls the whole system. It contains 8k RAM, 32k Flash, 2 Timers, 4 external interrupts, 2 UART’s, 46 GPIO’s, I2C communication, RTC, ISP programming, JTAG debugging support etc.

COMPONENTS USED
  1. Display                                 -         LED, Alpha numeric LCD, GLCD Display.
  2. Key                                       -        External keys, DTMF keyboard
  3. Serial Communication          -        UART
  4. Data conversion                    -        ADC
  5. Peripherals                            -       Timers, Interrupts, GPIO
  6. Sensor                                   -       Temperature, IR sensor



BLOCK DIAGRAM


 

HARDWARE DESCRIPTION

    MICRO CONTROLLER      

P89V51RD2 is an 80C51 micro controller with 64 KB Flash and 1024 bytes of data RAM. The P89V51RD2 device contains a non-volatile 16kb/32kb/64kb flash program memory that is both parallel programmable and serial in-system and in-application programmable.                                 

IN-System programming (ISP) allows the user to download new code while the micro controller sits in the application. In-Application Programming (IAP) means that the micro controller fetches new program code and reprograms itself while in the system.

An OTP configuration bit lets the user select conventional 12 clock timing if desired. This device is a single-chip 8-bit micro controller manufactured in advanced CMOS process and is a derivative of the 80c51 micro controller family. The instruction set is 100% compatible with the 80c51 instruction set. The device also has four 8-bit I/O ports, three 16-bit timer/event counters, a multi-source, Four-priority-level, nested interrupt structure, an enhanced UART and on-chip oscillator and timing circuits. The added features of the p89v51rd2 makes it a powerful micro controller for applications that require pulse width modulation, high-speed I/O and up/down counting capabilities such as motor control.    

This allows for remote programming over a modem link. A default serial loader (boot loader) program in ROM allows serial in-system programming of the flash memory via the UART without the need for a loader in the flash code. For in-application programming, the user program erases and reprograms the flash memory by use of standard routines contained in ROM. This device executes one machine cycle in 6 clock cycles, hence providing twice the speed of a conventional 80c51.

a key feature of the P89V51RD2 is its X2 mode option. the design engineer can choose to run the application  with the conventional 80c51 clock rate (12 clocks per machine cycle) or select the x2 mode (6 clocks per machine cycle)  to achieve twice the throughput at the same clock frequency.

Another way to benefit from this feature is to keep the same performance by reducing the clock frequency by half, thus dramatically reducing the EMI. The capability to  field/update the applicationfirmware makes a wide range of applications possible.

 

POWER ON RESET

      (POR) is ensuring that the processor starts at a known address when power is first applied. To accomplish that task, the POR logic output holds the processor in its reset state when the processor's power supply is first turned on. The POR's second task is to keep the processor from starting its operation from that known address until three events have occurred: the system power supplies have stabilized at the appropriate levels; the processor's clock(s) has (have) settled; and the internal registers have been properly loaded.

 

    The POR accomplishes this second task through an onboard timer, which continues to hold the processor in its reset state for a prescribed period of time. That timer triggers after the processor's power supply reaches a specific voltage threshold. After a set time elapses, the timer expires, causing the POR output to become inactive, which in turn makes the processor come out of reset and begin operation

 

ANALOG-TO-DIGITAL CONVERTER

  Signals in the real world are analog: light, sound, you name it. So, real-world signals must be converted to digital, using a circuit called ADC (Analog-to-Digital Converter), before they can be manipulated by digital equipment. In this tutorial, we will give an in-depth explanation about analog-to-digital conversion yet keeping a very easy to follow language.

   When you scan a picture with a scanner what the scanner is doing is an analog-to-digital conversion: it is taking the analog information provided by the picture (light) and converting into digital When you record your voice or use a VoIP solution on your computer, you are using an analog-to-digital converter to convert your voice, which is analog, into digital information.

Digital information isn't only restricted to computers. When you talk on the phone, for example, your voice is converted into digital (at the central office switch, if you use an analog line, or at you home, if you use a digital line like ISDN or DSL), since your voice is analog and the communication between the phone switches is done digitally.

 When an audio CD is recorded at a studio, once again analog-to-digital is taking place, converting sounds into digital numbers that will be stored on the disc.

  Whenever we need the analog signal back, the opposite conversion – digital-to-analog, which is done by a circuit called DAC, Digital-to-Analog Converter – is needed. When you play an audio CD, what the CD player is doing is reading digital information stored on the disc and converting it back to analog so you can hear the music. When you are talking on the phone, a digital-to-analog conversion is also taking place (at the central office switch, if you use an analog line, or at you home, if you use a digital line like ISDN or DSL), so you can hear what the other party is saying.

RTC

    The term real-time clock is used to avoid confusion with ordinary hardware clocks which are only signals that govern digital electronics, and do not count time in human units. RTC should not be confused with real-time computing, which shares its three-letter acronym but does not directly relate to time of day.

    Most RTCs use a crystal oscillator, but some use the power line frequency.In many cases, the oscillator's frequency is 32.768 kHz.This is the same frequency used in quartz clocks and watches, and for the same reasons, namely that the frequency is exactly 2 cycles per second, which is a convenient rate to use with simple binary counter circuits.

POWER SUPPLY 

A power supply is an electronic device that supplies electric energy to an electrical load. The primary function of a power supply is to convert one form of electrical energy to another and, as a result, power supplies are sometimes referred to as electric power converter. Some power supplies are discrete, stand-alone devices, whereas others are built into larger devices along with their loads. Examples of the latter include power supplies found in desktop computers and consumer electronics devices.

DTMF KEYPAD

The dtmf telephone is laid out in a 4x4 matrix of push  buttons in which each row represents the low frequency component and each column represents the high frequency component of the DTMF signal pressing a key sends a combination of the row and column frequencies.for  example, the key 1 produces a superimposition of tones of 697 and 1209 hertz (Hz).

   Initial pushbutton designs employed levers, so that each button activated two contacts.the tones are  decoded by switching center to determine the keys pressed by the user.

 

COMPUTER

 A computer is a device that can be instructed to carry out an arbitrary set of arithmetic or logical

operations automatically. The ability of computers to follow generalized sequences of operations,

called programs, enable them to perform a wide range of tasks.

       Such computers are used as control systems for a very wide variety of industrial and consumer

devices. This includes simple special purpose devices like microwave ovens and remote controls,

factory devices such as industrial robots and computer assisted design, but also in general purpose

 devices like personal computers and mobile devices such as smartphones. The Internet is run on

 computers and it connects millions of other computers.

        Since ancient times, simple manual devices like the abacus aided people in doing calculations.

Early in the Industrial Revolution, some mechanical devices were built to automate long tedious

tasks, such as guiding patterns for looms. More sophisticated electrical machines did specialized

 analog calculations in the early 20th century. The first digital electronic calculating machines were

developed during World War II. The speed, power, and versatility of computers has increased

 continuously and dramatically since then.Conventionally, a modern computer consists of at least one

 processing element, typically a central processing unit (CPU), and some form of memory.

        The processing element carries out arithmetic and logical operations, and a sequencing and

control unit can change the order of operations in responseto stored information. Peripheral devices

include input devices (keyboards, mice, joystick, etc.), output devices (monitor screens, printers,

etc.), and input/output devices that perform both functions (e.g., the 2000s-era touchscreen).

Peripheral devices allow information to be retrieved from an external source and they enable the

result of operations to be saved and retrieved.

 

TEMERATURE SENSOR

     the thermistor is a temperature sensing device whose resistance changes with temperature.

Thermistors, however, are made from semiconductor materials. Resistance is determined in the same

manner as the RTD, but thermistors exhibit a highly nonlinear resistance vs. temperature curve.

Thus, in the thermistors operating range we can see a large resistance change for a very small

temperature change. This makes for a highly sensitive device, ideal for set-point applications.

 

LCD DISPLAY

 

 

             A liquid-crystal display (LCD) is a flat panel display, electronic visual Crystals display, or video display that uses the light modulating properties of liquid. Liquid crystals do not emit light directly. LCDs are available to display arbitrary images or fixed images with low information content which can be displayed or hidden, such as pre-set words, digits, and 7-segment displays as in a digital clock. The most common type of LCD controller is HITACHI44780.  This provides a relatively simple interface between a processor and LCD. This LCD having 16 characters and 2 lines characteristics.

The most commonly used ALPHANUMERIC displays are 1x16 (Single Line & 16 characters), 2x16 (Double Line & 16 character per line) & 4x20 (four lines & Twenty characters per line).       The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The number on data lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required. How do we decide which mode to use? It’s simple if you have sufficient data lines you can go for 8 bit mode & if there is a time constrain i.e. display should be faster then we have to use 8-bit mode because basically 4-bit mode takes twice as more time as compared to 8-bit mode.

when RS is low (0), the data is to be treated as a command. When RS is high (1), the data    being sent is considered as text data which should be displayed on the screen.   when R/W is low (0),  the information on the data bus is being written to the LCD. When RW is high (1), the program LCD DISPLAY is effectively reading from the LCD. Most of the times there is no need to read from the LCD so this line can directly be connected to Gnd thus saving one controller line.

The ENABLE pin is used to latch the data present on the data pins. A HIGH - LOW signal is required to latch the data. The LCD interprets and executes our command at the instant the EN line is brought low. If you never bring EN low, your instruction will never be executed. In digital electronics, a binary decoder is a combinational logic circuit that converts a binary integer value to an associated pattern of output bits. They are used in a wide variety of applications, including data demultiplexing, seven segment displays, and memory address decoding.

 

STEPPER MOTOR

    A stepper motor or step motor or stepping motor is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor's position can then be commanded to move and hold at one of these steps without any feedback sensor (an open-loop controller), as long as the motor is carefully sized to the application in respect to torque and speed.

Switched reluctance motors are very large stepping motors with a reduced pole count, and generally are closed-loop commutated.

     Brushed DC motors rotate continuously when DC voltage is applied to their terminals. The stepper motor is known by its property to convert a train of input pulses (typically square wave pulses) into a precisely defined increment in the shaft position. Each pulse moves the shaft through a fixed angle.

    Stepper motors effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. The electromagnets are energized by an external driver circuit or a microcontroller. To make the motor shaft turn, first, one electromagnet is given power, which magnetically attracts the gear's teeth. When the gear's teeth are aligned to the first electromagnet, they are slightly offset from the next electromagnet.

    This means that when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one. From there the process is repeated. Each of those rotations is called a "step", with an integer number of steps making a full rotation. In that way, the motor can be turned by a precise angle.

 

SOFTWARE'S USED

1.         Embedded C.

2.         KIEL compiler.

3.         OR CAD Capture

4.         Flash Magic

 

ADVANTAGES

 

•             Get to know the working of ARM7 controller

•             Advanced Risc Machines(ARM) are widely used in industrial automation.

•           Interfacing various peripherals will give us an exposure to ARM various applications.

•           We will be using C programming to program the device ,hence the lengthy process of knowing the Instruction set will be avoided.

•           Steps and Process  involved in combining hardware and software to get an end product will be known.

 

DISADVANTAGES

•           There is no disadvantage that is specific for this project except that

•           we are not targeting this project for any specific application.

•           We will not be concentrating on the instruction set of the ARM controller.

 

FUTURE SCOPE

 

•           We can further work on ARM9 architecture.

•           Take our project to an implementation level with some application.

 

CONCLUSION

 

    From knowledge point of view this project will be helpful in knowing about Advanced RISC machines.This provides us a step for knowing industrial level controllers and Knowledge about  how hardware and software are combined to get an end product.

No comments:

Post a Comment

1N4148 Diode

1N4148 Diode 1N4148 Diode 1N4148 Diode Pinout 1N4148 Pin Configuration Pin No. Pin Name Description 1 Anode ...