Professional Documents
Culture Documents
Table of Content
CHAPTER-1....................................................................................7 INTRODUCTION.............................................................................7 1.1 Background of the problem............................................................................8 1.2 Statement of the problem ...............................................................................9 CHAPTER-2...................................................................................10 PROJECT OVERVIEW...................................................................10 2.1 VIEW OF PROJECT ...................................................................................11 2.2 Advantages of the PC-Based Oscilloscope ..................................................11 2.3 Circuit Diagram of Project ...........................................................................12 2.3.1 CIRCUIT DESCRIPTION .......................................................................13 2.3.2 OPERATION ........................................................................13 CHAPTER-3...................................................................................15 PIC18F2550 Microcontroller .............................................................................15 3.1 Description ...................................................................................................16 3.2.2 UNIVERSAL SERIAL BUS (USB) .........................................................16 3.5 Pin out Diagram of PIC18F2550 Microcontroller .......................................16 3.4 Internal Block Diagram of PIC18F2550 (28-Pin) .......................................17 3.10 USB Overview ...........................................................................................18 3.10.4 POWER ..............................................................................18 3.10.9 USB Hardware ........................................................................................18
Medi-Caps Institute Of Technology & Management, Indore Page 1
CHAPTER-4...................................................................................20 COMPONENTS USED....................................................................20 4.1 LF353 DUAL OPERATIONAL AMPLIFIER ............................................21 4.1.1 General Description ..................................................................................21 4.1.2 Features......................................................................................................21 4.1.3 Typical connection ....................................................................................22 4.1.4 Connection Diagram..22 4.1.4 Application of LF353 in our Project .........................................................22 4.2 MCP6S91 Low gain PGA ............................................................................23 4.2.1 Description ................................................................................................23 4.2.2 Block Diagram ..........................................................................................23 4.2.3 Package Types...........................................................................................23 4.2.4 Typical Applications .................................................................................24 4.3 ICL7660 - SWITCHED CAPACITOR VOLTAGE CONVERTERS ........24 4.3.1 General Description ..................................................................................24 4.3.2 Features .....................................................................................................24 4.3.3 Typical Operating Circuit .........................................................................25 4.3.5 Application of ICL7660 in our Project .....................................................25 CHAPTER-5...................................................................................26 PCB Designing Process .....................................................................................26 5.1 Introduction ..................................................................................................27
Medi-Caps Institute Of Technology & Management, Indore Page 2
5.2 Material required ..........................................................................................27 5.3 Procedure.................................................................................27 CHAPTER 6...................................................................................29 SOFTWARES.................................................................................29 6.1 Microcontrollers Programming.......................................................30 6.1.1 Microcontroller Programming and Code ..................................................30 CHAPTER 7...................................................................................34 INSTALLATION AND WORKING OF THE PROJECT.................................34 7.1 Installation Steps ..........................................................................................35 7.2 Project Working ...........................................................................................35 CHAPTER-8...................................................................................36 CONCLUSION...............................................................................36 8.1Applications ..................................................................................................37 8.2 Future aspects ..............................................................................................37 REFERENCE..................................................................................38
Page 3
CHAPTER-1 INTRODUCTION
Page 4
The heart of the traditionally CRT oscilloscope is the display screen itself, the CRT. The CRT is a glass bulb which has had the air removed and then been sealed with a vacuum inside. At the front is a flat glass screen, which is coated inside with a phosphor material. This phosphor will glow when struck by the fast-moving electrons and produce light, emitted from the front and forming the spot and hence the trace. The rear of the CRT contains the electron gun assembly. A small heater element is contained within a cylinder of metal called the cathode. When the heater is activated by applying a voltage across it, the cathode temperature rises and it then emits a stream of electrons. Medi-Caps Institute Of Technology & Management, Indore Page 5
Page 6
Page 7
Page 8
Page 9
2-Channel PC-Based Oscilloscope 2.3.1 CIRCUIT DESCRIPTION At the heart of this oscilloscope is USB2.0-compliant microcontroller PIC18F2550from Microchip. We can also use PIC18F2445 in place of PIC18F2550.Specifications these microcontrollers are as follows: Programming 1. Up to 32 KB of flash memory. 2. 2 KB RAM and 256-byte EEPROM2. Extended instruction set (optimized for C compiler). 3. 3. 8x8 single-cycle multiplier. 4. Single-supply serial programming and easy debugging. USB transceiver 1. USB1.1 and 2.0 from 1.5 MB/s to 12 MB/S. 2. Isochronous, bulk and interrupt transfer modes. 3. 1 KB of access RAM usable with 32 endpoints (64 bytes each) Multiple oscillator and power modes 1. From internal 31 kHz to external 48 MHz with PLL. 2. Possible software switching between run, idle and sleep modes. In sleep mode, current is down to 0.1 A. 3. 3. Wide operating voltage range (2.0V to 5.5V) Useful for battery operations. Complete set of classical peripherals 1. Several input/output (I/O) ports, four timers with capture/compares. 2. Synchronous and asynchronous enhanced modules. 3. Streaming parallel port. 4. 10-bit ADC module with up to 13-channel multiplexer.
2.3.2 OPERATION
Figure 2-1shows the circuit of the 2-Channel-PC Based Oscilloscope.MCP6S91 from Microchip Technology is an analogue programmable gain amplifier that is well suited for driving analogue-to digital converters (ADCs) and an analogue input to a PIC microcontroller. Two MCP6S91 programmable gain amplifiers (IC2 and IC3) make it possible to choose the input ranges for each of the two channels, by selecting a gain from 1:1to32:1. The amplifiers are small, cheap and easy to use. A simple three-wire serial peripheral interface (SPI) allows the PIC to control them through its pins 5, 6 and7. The MCP6S91 amplifier is designed with CMOS input devices. It is designed to not exhibit phase inversion when the input pins exceed the supply voltages. The maximum voltage that can be applied to the input pin is -0.3V (Vss) to +0.3V (Vdd). Input voltages that exceed this absolute maximum rating can cause excessive current into or out of the input pins. Current beyond 2mA can cause reliability problems. Applications that exceed this rating must be externally limited with a resistor to the input pin.
Page 10
2-Channel PC-Based Oscilloscope Vref (pin 3), which is an analogue input, should be at a voltage between Vss and Vdd. The voltage at this pin shifts the output voltage. The SP Interface inputs are chip-select (CS), serial input (SI) and serial clock (SCK). These are Schmitt-triggered, CMOS logic inputs. The only disadvantage is that these amplifiers accept only positive signals. Thats why voltageshifting amplifiers LF353 (IC4A and IC5A) are used, one each for each channel input (see Figure 2- 1). The LF353 is a JFET input operational amplifier with an internally compensated input offset voltage. The JFET input device provides wide bandwidth; low input bias currents and offset currents. This voltage-shifting amplifier results in high input impedance and an attenuation factor of 1:4.5.A 16V input signal is then shifted to the 0-5Vrange when the programmed gain is 1:1. Two halves of the LF353 (IC4B and IC5B) are used as voltage followers to provide a lowimpedance shifting voltage (Vref) to the programmable amplifiers. This voltage must be precisely adjusted with two 4.7-kiloohm presets to measure precisely 2.5V level on the inputs of IC2 and IC3 when the input signals are grounded. Because LF353 Op-Amps need a symmetrical supply voltage, a small DC-DC voltage converter ICL7660 (IC6) is used to feed 5V to LF353. With its small 8-pin DIP package, it needs only two polarized capacitors. ICL7660 can be replaced with a MAX1044. The MAX1044 and ICL7660 is monolithic, CMOSs witched-capacitor voltage converters that invert, double, divide or multiply a positive input voltage.
Page 11
Page 12
3.1 Description
The PIC18F2550 is 28-Pin High Performance, Enhanced Flash, USB Microcontroller with Nano-watt technology. This family of devices offers the advantages of all PIC18 microcontrollers namely, high computational performance at an economical price with the addition of high endurance, Enhanced Flash program memory. In addition to these features, the PIC18F2455/2550/ 4455/4550 family introduces design enhancements that make these microcontrollers a logical choice for many high-performances, power sensitive applications.
Page 13
Page 14
3.5.1 POWER
Power is available from the Universal Serial Bus. The USB specification defines the bus power requirements. Devices may either be self-powered or bus powered. Self-powered devices draw power from an external source, while bus powered devices use power supplied from the bus. The USB specification limits the power taken from the bus. Each device is ensured 100 mA at approximately 5V (one unit load). Additional power may be requested, up to a maximum of 500 mA. Note that power above one unit load is a request and the host or hub is not obligated to provide the extra current. Thus, a device capable of consuming more than one unit load must be able to maintain a low-power configuration of a one unit load or less, if necessary. The USB specification also defines a Suspend mode. In this situation, current must be limited to 500 A, averaged over 1 second. A device must enter a Suspend state after 3 ms of inactivity (i.e., no SOF tokens for 3 ms). A device entering Suspend mode must drop current consumption within 10 ms after Suspend. Likewise, when signaling a wake-up, the device must signal a wake-up within 10 ms of drawing current above the Suspend limit.
Page 15
2-Channel PC-Based Oscilloscope The image of Type-A and Type-B USB Connector is shown in Figure 3-4.
The specification also defines mini-B connector, mainly used in smaller portable electronic devices such as cameras and other hand-held devices. This connector or has a fifth pin called ID, though this pin is not used.
Page 16
Page 17
2-Channel PC-Based Oscilloscope Some of the other important components used in our project are described in brief in the subsequent sections. They are as follow: LF353 Dual Operation Amplifier. MSCP6S91 Gain Amplifier from Microchip Technology. ICL7660 Switched Capacitor Voltage Converter.
4.1.2 Features
Internally trimmed offset voltage Low input bias current Low input noise voltage Low input noise current Wide gain bandwidth High slew rate Low supply current Low total harmonic distortion Low 1/f noise corner Fast settling time to 0.01%
Table 4.1 Features of LF353
Page 18
Page 19
Page 20
For further details on MCP6S91 IC from Microchip Technology, one can refer its datasheet, which can be downloaded free of cost from the www.microchip.com.
4.3.2 Features
Miniature MAX Package 1.5V to 10.0V Operating Supply Voltage Range 98% Typical Power-Conversion Efficiency Invert, Double, Divide, or Multiply Input Voltages No-Load Supply Current: 200A Max at 5V No External Diode Required for Higher-Voltage Operation
Page 21
Page 22
Page 23
5.1 Introduction
Making a Printed Circuit Board is the first step towards building electronic equipment by any electronic industry. A number of methods are available for making PCB. The PCB in this project is made in lab with the proper procedure mentioned below. PCB is developed to obtain a conducting circuit diagram on the board. All the path which leads to current flow are developed on board and then desired components are soldered.
5.3 Procedure
Layout is developed in EAGLE, and then its printout is taken on glossy paper with LASER printer as shown in Figure 5-1. Now place this printout on the Copper Board and place hot iron on it and press it for 3-5 minutes. Now the circuit is printed on the Copper Board. Excess copper is removed by etching. For etching add Ferric Chloride (FeCl3) in a plastic container carefully, without any splashing. Place the board in solution with copper side up After etching PCB is ready and the holes are drilled and finally components are mounted on it.
Page 24
Page 25
CHAPTER 6 SOFTWARES
Page 26
MikroC for PIC from MikroElektronika. Both of these softwares are extremely good, we have used both softwares for our learning purpose but as MikroC doesnt permit to compile the code above 2 kilobytes in its evaluation version, so we have to go for MPLAB IDE along with Hi-Tech C Compilers.
/********************************************************************* * * Microchip USB C18 Firmware Version 1.0 * ********************************************************************* * FileName: main.c * Dependencies: See INCLUDES section below /** I N C L U D E S **********************************************************/ #include "p18f2550.h" #include "typedefs.h" // Required #include "usb.h" // Required #include "io_cfg.h" // Required #include "user.h" // Modifiable /** V A R I A B L E S ********************************************************/ #pragma udata extern extern extern extern unsigned char voie1[256]; unsigned char voie2[256]; unsigned char voiesH1[64],voiesH2[64]; char ordre, timeout;
Page 27
#pragma interruptlow timer_isr //Fixe une periode de 1 seconde pour le time-out aquisition void timer_isr(void) { //Reset l'it du timer 1 INTCONbits.TMR0IF=0; TMR0H= 256-183; TMR0L= 0; timeout++; } /*#pragma code _LOW_INTERRUPT_VECTOR = 0x000818 void low_ISR (void) { ; }*/ /** D E C L A R A T I O N S **************************************************/ #pragma code /********************************************************************** ******** * Function: void main(void) * PreCondition: None * Input: None * Output: None * Side Effects: None * Overview: Main program entry point. * Note: None *********************************************************************** ******/ void main(void) { InitializeSystem(); // incremente le compteur time-out !!
Page 28
/********************************************************************** ******** * Function: static void InitializeSystem(void) * PreCondition: None * Input: None * Output: None * Side Effects: None * Overview: InitializeSystem is a centralize initialization routine. * All required USB initialization routines are called from * here. * User application initialization routine should also be * called from here. *********************************************************************** ******/ static void InitializeSystem(void) { ADCON1 |= 0x0F; // Default all pins to digital #if defined(USE_USB_BUS_SENSE_IO) tris_usb_bus_sense = INPUT_PIN; // See io_cfg.h #endif #if defined(USE_SELF_POWER_SENSE_IO) tris_self_power = INPUT_PIN; #endif UserInit(); mInitializeUSBDriver(); }//end InitializeSystem /********************************************************************** ******** * Function: void USBTasks(void) * PreCondition: InitializeSystem has been called. * Input: None * Output: None * Side Effects: None * Overview: Service loop for USB tasks. *********************************************************************** ******/ void USBTasks(void) { /* Servicing Hardware */ USBCheckBusStatus(); // Must use polling method if(UCFGbits.UTEYE!=1) // See user.c & .h // See usbdrv.h
Page 29
Rests of the programs are provided by Microchip and are available on the Microchips website ( www.microchip.com ). After compiling this code the hex file gets generated, now we have to burn this hex file into the microcontroller. To do this we have used simple JDM programmer given in PIC Microcontroller Development Board (NV5002 kit by Nvis Technologies) for programming the microcontroller. The software used for programming is PICPgm Programmer.
Page 30
CHAPTER 7
INSTALLATION AND WORKING OF THE PROJECT
Page 31
2-Channel PC-Based Oscilloscope This chapter describes how to connect the Oscilloscope Hardware with the host Computer. The various steps are to be taken while installing the hardware. And these are as follow:
Page 32
CHAPTER-8 CONCLUSION
Page 33
8.1 Applications
Monitoring of sound waves, which are difficult to monitor on a traditional oscilloscope due to the low frequencies involved. Monitoring of an ECG signal, again because this is such a low frequency traditional oscilloscopes would have difficultly monitoring such a signal. ECG data could be logged and emailed directly to the doctor for diagnosis, or perhaps real-time TCP/IP internet communication so that the doctor could remotely monitor the ECG signal in real-time. The PC based oscilloscope is ideal for demonstration purposes, for example using data projector a class of student could be introduced to the oscilloscope, with real waveforms being monitored (signal generator, or even a microphone for sound waves) and displayed on a large project or display. Because of the low cost of the PC based oscilloscope, it is economical for a school / technical college to have large quantities available for students. Unlike traditional analogue scopes which are expensive and students are forced to share equipment, because it is not economical to purchase enough scopes for every student.
Page 34
REFERENCE
1. 2. 3. 4. 5. 6. www.sonsivri.to www.electronicsforu.com www.microchip.com for USB Based firmwares and datasheets MikroElektronika Documentation. MPLAB IDE and Hi-Tech Documentation M.A. Mazidi | J.G. Mazidi | R.D. McKinlay The 8051 Microcontroller and Embedded Systems Using Assembly & C 7. www.usb.org for USB 2.0 Specifications 8. www.google.com for searching all datasheets
Page 35