Department of Electronic & Electrical Engineering Further work? Simple Voltmeter. ● Analogue to Digital converter (MCP3001 SPI ) ● Analogue → 10bit binary.

Slides:



Advertisements
Similar presentations
Conversion and Coding (12)10.
Advertisements

Digital Logic Design Week 7 Encoders, Decoders, Multiplexers, Demuxes.
Analogue to Digital Conversion By Cap’n Tim Johnson, PE Prepared 11/12/2013.
Data Acquisition ET 228 Chapter
Digital to Analogue Conversion Chapter 13. Why is conversion needed? Most signals in the world are analogue. Microprocessors and most computers computers.
Loops, and sub-routines Interrupts Can be very useful in control applications particularly when the microprocessor must perform two tasks apparently.
Shift Register Application Chapter 22 Subject: Digital System Year: 2009.
Motor Control Lab Using Altera Nano FPGA
Interfacing ADC to 8051.
RIPPLE COUNTERS A register that goes through a prescribed sequence of states upon the application of input pulses is called a counter. The input pulses.
Analog-to-Digital Converters Lecture L11.2 Section 11.3.
ENGIN112 L26: Shift Registers November 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 26 Shift Registers.
Engineering 4862 Microprocessors Lecture 26 Cheng Li EN-4012
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
SPI By Alexander Maroudis. Outline What is SPI? SPI Configuration SPI Operation Master Slave Setup SPI Transactions SPI Digital Potentiometer Example.
PIC microcontrollers. PIC microcontrollers come in a wide range of packages from small chips with only 8 pins and 512 words of memory all the way up to.
ECE Lecture 1 1 Binary number system Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
Serial Peripheral Interface (SPI) Bus. SPI Bus There is no official specification for the SPI bus. It is necessary to consult the data sheets of the devices.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Engineering 1040: Mechanisms & Electric Circuits Winter 2015 Analog & Digital Signals Analog to Digital Conversion (ADC)
A little bit of exercise.. ;). Exercise Given to you are some binary to decimal examples : Given to you are some binary to decimal examples : Tens Units.
Basic Stamp Free Pins These pins can be used by the operator for digital Inputs and Outputs Used Pins 0.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Digital to Analogue Converter
Data Acquisition Systems
The Digital Codes.
RS232 #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
ENG241 Digital Design Week #8 Registers and Counters.
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
Representing Numerical Data Analog Any signal that varies continuously over time Mechanical Pneumatic Hydraulic Electrical Digital Quantities are represented.
Data Representation Conversion 24/04/2017.
Number Bases and Representation. Denary Number System (Base 10) Our number system uses 10 digits (0-9) As you move from right to left each number is worth.
Lecture 7: Overview Microprocessors / microcontrollers.
Department of Electronic & Electrical Engineering LCD character display (parallel interface). How to interface a LCD character display to a PIC.
ECE 2799 Electrical and Computer Engineering Design ANALOG to DIGITAL CONVERSION Prof. Bitar Last Update:
Department of Electronic & Electrical Engineering Serial interfaces Serial Interfaces allow communication between devices sending one bit at a time. In.
Department of Electronic & Electrical Engineering EE10140 Introduction to Microprocessors and interfacing (Embedded Systems)  Microcontrollers (PIC16F84A)
Department of Electronic & Electrical Engineering Seven segment display Subroutines.
Department of Electronic & Electrical Engineering Lecture 2 ● Introduction to IO ● Using a subroutine ● Driving a 7seg display.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
Serial Peripheral Interface SPI I2C (i-squared cee)
Analog to Digital Conversion - ADC Mark Neil - Microprocessor Course 1 Device Drivers – Measuring Voltages.
Department of Electronic & Electrical Engineering Lecture 2. PIC16F84A Architecture / Instructions Memory. Program/Data (Harvard) File Registers (Data).
Department of Electronic & Electrical Engineering Digital Lock. (e.g. for sports locker room) Assessment: Plan. Demo. Code.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Dr. Shi Dept. of Electrical and Computer Engineering.
Department of Electronic & Electrical Engineering Lecture 4. ➢ Loops ➢ Delays ➢ Conditional instructions ➢ Simple clock example.
Department of Electronic & Electrical Engineering Lecture 3. ● Template program. ● Introduction to IO ● PORTA PORTB TRISA TRISB ● Using a subroutine ●
0808/0809 ADC. Block Diagram ADC ADC0808/ADC Bit μP Compatible A/D Converters with 8-Channel Multiplexer The 8-bit A/D converter uses successive.
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
EKT 314/4 WEEK 9 : CHAPTER 4 DATA ACQUISITION AND CONVERSION ELECTRONIC INSTRUMENTATION.
Lecture Notes / PPT UNIT III
FOR MORE CLASSES VISIT   ECET 340 Week 1 HomeWork 1  ECET 340 Week 1 iLab 1  ECET 340 Week 2 HomeWork 2  ECET 340 Week 2 iLab.
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
Registers and Counters
ADC,DAC and sensor interface
Chapter D – Serial Connections to the RPi and Analog-to-Digital Converters
Principles & Applications
ECET 340 Competitive Success/snaptutorial.com
Analog-to-Digital Converters
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
Digital Control Systems Waseem Gulsher
PIC18F458 Analog-to-Digital
EET 2261 Unit 14 INCOMPLETE Analog-to-Digital Conversion (ADC) & Digital-to-Analog Conversion (DAC) Read. Homework #13 and Lab #13 due next week. Quiz.
Introducing the PIC Mid-Range Family and the 16F84A
ADC and DAC Data Converter
ADC and DAC Data Converter
PIC Microcontroller ADC interfacing Prof. Ashvini Kulkarni
Presentation transcript:

Department of Electronic & Electrical Engineering Further work? Simple Voltmeter. ● Analogue to Digital converter (MCP3001 SPI ) ● Analogue → 10bit binary ● Convert the 10 bit binary into a BCD ● Use bsd.asm (in my resources) ● Display value on the LCD display ● Modify your Hello World code

Department of Electronic & Electrical Engineering MCP3001 SPI Analogue To Digital Converter Features 10-bit resolution SPI™ serial interface Single supply operation: 2.7V - 5.5V 200 ksps sampling rate at 5V Applications Sensor Interface Process Control Data Acquisition Battery Operated Systems

Department of Electronic & Electrical Engineering Functional Block Diagram

Department of Electronic & Electrical Engineering MCP3001 Pins

Department of Electronic & Electrical Engineering MCP3001 operation ( see data sheet for details) IN+ positive analogue input (IN- can be connected to ground) /CS initiate communication by pulling low CLK initiate conversion and clock for each bit of data DOUT output data appears on the falling edge of the clock.

Department of Electronic & Electrical Engineering Reading a sample (see section 5.0) The device will begin to sample the analog input on the first rising edge after CS goes low. The sample period will end in the falling edge of the second clock, at which time the device will output a low null bit. The next 10 clocks will output the result of the conversion with MSB first, as shown in Figure 5-1. Data is always output from the device on the falling edge of the clock.

Department of Electronic & Electrical Engineering Sequence for operation. (fig 5.2)

Department of Electronic & Electrical Engineering Digital Output

Department of Electronic & Electrical Engineering Your first task ? Don't try to do everything at first. Break the exercise down into smaller easier tasks. Connection to the PIC (see eeprom ex.)? Your first program ? Display the voltage of a 4 bit number. Just stop reading after 4 bits! The MCP3001 is similar to the serial EEPROM (but no SI or instructions!) If you really understand the serial EEPROM code it should be easy!

Department of Electronic & Electrical Engineering Converting 10bits into decimal characters. e.g → '8' '5' '5' The bcd.asm code will make this job easier ! The code has a routine which takes a 16bit binary number (in 2 registers). NumH:NumL It returns 4 registers which have the Binary Coded Decimal values TenK:Thou:Hund:Ones

Department of Electronic & Electrical Engineering Binary-to-BCD. Written by John Payson #define NumH 0x10 ; registers used by Convert #define NumL 0x11 #define TenK 0x12 #define Thou 0x13 #define Hund 0x14 #define Tens 0x15 #define Ones 0x ; PJL test code try it out with 0x03FF --> 1023 movlw 0x03 movwf NumH movlw 0xFF movwf NumL call Convert ; now TenK=1 Thou=0 Hund=2 Ones= Convert: ; Takes number in NumH:NumL ; Returns decimal in TenK:Thou:Hund:Tens:Ones ; snip.....

Department of Electronic & Electrical Engineering Displaying the voltage from the ADC ➔ Read 10 bit value into 2 registers. NumH NumL XX YYYYYYYY ➔ Call BCD conversion ➔ Display TenK Thou Hund Ones + Some details that are left as an exercise for you ! !

Department of Electronic & Electrical Engineering Hints: Avoid nasty sums The PIC16F84 was not designed for arithmetic. You can make life a lot easier by: ➢ Choosing a appropriate Vref (e.g. MCP1541) ➢ Only use simple arithmetic ( X2 X4 X8 etc)

Department of Electronic & Electrical Engineering Further Work Add any features that you think would be cool !