Sei sulla pagina 1di 12

Hardware ARM 7 (LPC 2148)


The LPC2148 microcontrollers are based on a 32/16 bit ARM7TDMI-S CPU with realtime emulation and embedded trace support, that combines the microcontroller with embedded high speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory interface and a unique accelerator architecture enable 32-bit code execution at the maximum clock rate. For critical code size applications, the alternative 16-bit Thumb mode reduces code by more than 30 % with minimal performance penalty. Due to their tiny size and low power consumption, LPC2141/2/4/6/8 are ideal for applications where miniaturization is a key requirement, such as access control and point-of-sale. A blend of serial communications interfaces ranging from a USB 2.0 Full Speed device, multiple UARTs, SPI, SSP to I2Cs, and on-chip SRAM of 8 kB up to 40 kB, make these devices very well suited for communication gateways and protocol converters, soft modems, voice recognition and low end imaging, providing both large buffer size and high processing power. Various 32-bit timers, single or dual 10-bit ADC(s), 10-bit DAC, PWM channels and 45 fast GPIO lines with up to nine edge or level sensitive external interrupt pins make these microcontrollers particularly suitable for industrialcontrol and medical systems. Architectural overview The ARM7TDMI-S is a general purpose 32-bit microprocessor, which offers high performance and very low power consumption. The ARM architecture is based on Reduced Instruction Set Computer (RISC) principles, and the instruction set and related decode mechanism are much simpler than those of micro programmed Complex Instruction Set Computers (CISC). This simplicity results in a high instruction throughput and impressive realtime interrupt response from a small and cost-effective processor core. Pipeline techniques are employed so that all parts of the processing and memory systems can operate continuously. Typically, while one instruction is being executed, its successor is being decoded, and a third instruction is being fetched from memory.The ARM7TDMI-S processor also employs a unique architectural strategy known as Thumb, which makes it ideally

suited to high-volume applications with memory restrictions, or applications where code density is an issue.The key idea behind Thumb is that of a super-reduced instruction set. Essentially, the ARM7TDMI-S processor has two instruction sets: The standard 32-bit ARM set. A 16-bit Thumb set. The Thumb sets 16-bit instruction length allows it to approach twice the density of standard ARM code while retaining most of the ARMs performance advantage over a traditional 16-bit processor using 16-bit registers. This is possible because Thumb code operates on the same 32-bit register set as ARM code. Thumb code is able to provide up to 65 % of the code size of ARM, and 160 % of the performance of an equivalent ARM processor connected to a 16-bit memory system.The particular flash implementation in the LPC2141/42/44/46/48 allows for full speed execution also in ARM mode. It is recommended to program performance critical and short code sections (such as interrupt service routines and DSP algorithms) in ARM mode. The impact on the overall code size will be minimal but the speed can be increased by 30% over Thumb mode.

16/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package. 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program memory. 128 bit wide interface/accelerator enables high speed 60 MHz operation. In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or full chip erase in 400 ms and programming of 256 bytes in 1 ms. EmbeddedICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip RealMonitor software and high speed tracing of instruction execution. USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2148 provide 8 kB of on-chip RAM accessible to USB by DMA. One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14 analog inputs, with conversion times as low as 2.44 s per channel. Single 10-bit D/A converter provides variable analog output. Two 32-bit timers/external event counters (with four capture and four compare

channels each), PWM unit (six outputs) and watchdog. Low power real-time clock with independent power and dedicated 32 kHz clock input. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with buffering and variable data length capabilities. Vectored interrupt controller with configurable priorities and vector addresses. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package. Up to nine edge or level sensitive external interrupt pins available. 60 MHz maximum CPU clock available from programmable on-chip PLL with settling time of 100 s. On-chip integrated oscillator operates with an external crystal in range from 1 MHz to 30 MHz and with an external oscillator up to 50 MHz. Power saving modes include Idle and Power-down. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power optimization. Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or Real-Time Clock (RTC). Single power supply chip with Power-On Reset (POR) and BOD circuits

Applications Industrial control Medical systems Access control Point-of-sale Communication gateway Embedded soft modem General purpose applications

Pin Diagram

Block Diagram

Motion Sensors

The term Motion detectors can be used to refer to any kind of sensing system which is used to detect motions; motion of any object or motion of human beings. However, it is primarily used to detect motion of human beings or in other words, presence of a body in a certain area. A motion detector is an electronic device that detects the physical movement in a given area/ designated locations and it transforms motion into an electric signal. Applications to detect motion do so by either: Generating some stimulus and sensing its reflection. Sensing some signals generated by an object.

All motion sensors indicate the same thing; that some condition has changed. All sensors have some 'normal' state. Some sensors only report when the 'normal' status is disturbed, others also report when the condition reverts to 'normal'.

Motion sensors are commonly used in security systems as triggers for automatic lights or trips for remote alarms and similar applications. Motion sensors work based on a wide variety of principles and is used in a wide variety of applications. Typical usage could be in the exterior doorways or windows of a building for monitoring the area around the building. Upon detecting motion, they generate an electrical signal based on which some actions are taken. Some operate in much the same way as a military radar scanner, while others work based upon vibration, infrared radiation and even sound. All of these different types of motion sensors have different strengths and weaknesses, which are important to take into account when making a decision to choose a particle motion detection sensor.

TYPES OF MOTION SENSING Motion sensors are employed to detect different types of human movement. Some are intended for local event sensing, some for area sensing Local Sensing Local Sensing implies sensing of a motion at designated locations. Some of the motion sensors commonly used for this purpose are

Visible/ Infrared light(LED/Laser) beam Contact Switch Piezoelectric Sensors Piezoresistive Sensors, etc.

Area Sensing Area Sensing implies sensing of a motion in a specific Field of View (FOV). Motion sensors commonly employed for such application are

Active/ Passive Infrared Motion Detector Ultrasound motion detection sensor Footstep Detection Sensing Microwave Doppler sensor Video

Wireless Communication with 2.4 GHz RF Transceiver CC2500

CC2500 is wireless transmitter receiver developed by Texas instruments which is used in 2400-2483.5 MHz ISM/SRD band systems. In this project, the input present at PORTD of transmitter atmega8 is transmitted wirelessly to the PORTD of receiver atmega8. This project shows how to configure registers of CC2500, how to give commands to CC2500 and how to activate transmission or receiver mode of CC2500 via SPI interfacing with avr microcontroller. The CC2500 RF module is a low-cost 2.4 GHz transceiver used in very low power wireless applications. The RF transceiver is integrated with a highly configurable baseband modem. It support OOK, 2-FSK, GFSK, and MSK modulations. It works in voltage range of 1.8 - 3.6V. Two AA batteries are enough to power it. It has 30m range with onboard antenna. It is always used with microcontroller which support SPI communication . Programming CC2500:

SPI interface: CC2500 is configured via a simple 4-wire SPI compatible interface (SI, SO, SCLK and CSn) where CC2500 is the slave and microcontroller (here atmega8) is used as master.

SPI interfacing Register access and commands are given serially to CC2500 by PIC with spi interface. In SPI, master generate clock and chip select signal. SPI communication involves two shift registers. One in master and other in slave. Data is shifted from master to slave and slave to master in circular manner in synchronous with clock generated by master and at the end of shift operation, data in master register and slave register is exchanged.

In CC2500, all transfers on the SPI interface are done most significant bit first. All transactions on the SPI interface start with a header byte containing a R/W bit, a burst access bit (B), and a 6bit address (A5 A0). The CSn pin must be kept low during transfers on the SPI bus. If CSn goes high during the transfer of a header byte or during read/write from/to a register, the transfer will be cancelled.

SPI interfacing between PIC and CC2500 Transmit or receive data: Similar to the configuration register there are tx and rx FIFO registers. To transmit data wirelessly, data has to be written into tx FIFO in similar way as we write data in config register. Address byte and data byte is send to CC and CC will write data in its tx FIFO. Then STX

command is given to send the data in tx FIFO wirelessly. The address for tx FIFO is 0x3F. So A5-A0=111111. But we are using burst mode because we are sending 3 bytes of data, so 6th bit of address byte will be 1. Hence address byte will be now 01111111= 0x7F. Similarly, whenever CC2500 receives some data, it gets stored in Rx FIFO and CC generates interrupt on GD0 pin. Atmega8 continuously check GD0 pin by polling method. Whenever interrupt is generated on GD0 pin atmega8 reads data from Rx FIFO. To read data from CC2500 register again two bytes are sent by atmega8. One is address byte and second one is data byte. But now atmega8 will send data byte as 0x00 and in exchange CC2500 will send the value in register to atmega8. For read operation, MSB of address byte will be 1 and we are using burst mode to receive continuous three bytes of data and the address of TX and RX FIFO are same. Thus address byte is 0xFF. To give commands to cc2500 like STX, SRX, SFTX, SFRX, SIDLE, only one byte is sent from atmega8 to CC2500 via SPI. STX will send data in TX FIFO. SRX will receive data in RX FIFO. SFTX will flush TX FIFO. SRTX will flush RX FIFO. SIDLE will turn CC2500 into idle mode. Atmega8 give these commands to CC2500 by sending one byte address of these commands. For reading and writing registers two bytes are send but for giving commands only one byte is send.
Pin configuration 0f CC2500: