S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

I/O Unit.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Serial Communication Buses: I 2 C and SPI By Brody Dunn.
STUDY OF THE ARIZONA MICROCHIP MICRO CONTROLLERS MOSTEFA GHASSOUL DAMMAM TECHNICAL COLLEGE
Serial Peripheral Interface (SPI)
Read Chapter 3 (David E. Simon, An Embedded Software Primer)
HT46 A/D Type MCU Series Data Memory (Byte) Program Memory HT46R22 (OTP) HT46C22 (Mask) 2Kx Kx16 4Kx HT46R23 (OTP) HT46C23 (Mask) HT46R24.
9/20/6Lecture 3 - Instruction Set - Al Hardware interface (part 2)
Two Wire Interface Another popular serial peripheral interface bus -More flexible than SPI -Master and slave modes supported -7-bit slave address -400khz.
Microcontroller Architecture PIC18F Family
Lecture 27: LM3S9B96 Microcontroller – Inter- Integrated Circuit (I 2 C) Interface.
Synchronous Serial IO Send a separate clock line with data
NS Training Hardware. System Controller Module.
Programming 8-bit PIC Microcontrollers in C Martin Bates Elsevier 2008.
INPUT-OUTPUT ORGANIZATION
Interfaces A practical approach. Lesson 2 I2C and SPI
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.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
ECE/CS-352: Embedded Microcontroller Systems Embedded Microcontroller Systems.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
7/23 Inter-chip Serial Communication: SPI and I 2 C Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
1 SERIAL PORT INTERFACE FOR MICROCONTROLLER EMBEDDED INTO INTEGRATED POWER METER Mr. Borisav Jovanović, Prof.dr Predrag Petković, Prof.dr. Milunka Damnjanović,
16F877A. Timer 0 The Timer0 module timer/counter has the following features: –8-bit timer/counter –Readable and writable –8-bit software programmable.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
Microprocessors A practical approach Subjects Goals for this module Results Subjects of the module Plans Questions.
Prepared by Eng. Musa Alyaman1 Chapter Seven Chapter Seven PIC16F87x.
11/16/2006 WSN Mote- MCU & Sensor Hardware 1 ECET 581 Wireless Sensor Networks Mote – MCU & Sensor Hardware 2 of 3 Fall 2006
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
1 Synchronous Serial IO Send a separate clock line with data –SPI (serial peripheral interface) protocol –I 2 C (or I2C) protocol Encode a clock with data.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
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.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
Chapter 7 Larger Systems and the PIC 16F873A The aims of this chapter are to introduce: The architecture of the 16F873A microcontroller; The 16F873A memory.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
80386DX functional Block Diagram PIN Description Register set Flags Physical address space Data types.
Architecture and instruction set. Microcontroller Core Features:  Operating speed: DC - 20 MHz clock input DC ns instruction cycle Up to 8K x.
Device Overview 1.  The advantages of all PIC18Fxxxx microcontrollers:  High computational performance  High-endurance  Enhanced Flash program memory.
Features of the PIC18 microcontroller - 8-bit CPU - 2 MB program memory space (internal 32KB to 128KB) bytes to 1KB of data EEPROM - Up to 4096 bytes.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
Multiplex of Data and Address Lines in 8088 Address lines A0-A7 and Data lines D0-D7 are multiplexed in These lines are labelled as AD0-AD7. –By.
Components of a typical full-featured microcontroller.
BIRLA VISHVAKARMA MAHAVIDYALAY SUBJECT: SPI PROTOCOL & MAX7221 DISPLAY INTERFACING SUBMITTED BY: KISHAN AVASTHI( ) MANSI CHANDEGARA( )
میکرو کنترلرهای AVR Serial Interfaces, I2C and SPI
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.
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
CORDLESS MOUSE FEATURES BY TV REMOTE USING PIC MICROCONTROLLER
PIC CONTROLLED DYNAMIC TIME BASED CITY TRAFFIC SIGNAL
Serial Communication Buses: I2C and SPI
Figure SPI Single-Byte Write Timing (Notice A7 = 1)
Inter-IC Bus (I C) 2.
Chapter 11: Inter-Integrated Circuit (I2C) Interface
UNIT – Microcontroller.
Introduction to the processor and its pin configuration
DENSITY BASED TRAFFIC LIGHT TIMING CONTROL
(Inter-IC bus) By Tejaswini Gadicherla
Project Title EVM IN PIC Under the Guidance of Submitted by.
I2C PROTOCOL SPECIFICATION
EEPROM Comparison – Parallel or Serial
Serial EEPROM (Atmel 24C-512)
I2C Protocol and RTC Interfacing
Преглед Начин функционисања Имплементације
Introducing the PIC Mid-Range Family and the 16F84A
Presentation transcript:

S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals & Enhanced FLASH New Peripherals Enhanced FLASH PIC16F87X and PIC16F62X Enhanced FLASH PIC16F87X and PIC16F62X

S4525A Peripherals & Enhanced FLASH 2 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 2 Peripherals & Enhanced FLASH PIC16F87X Features at a Glance l 8K x 14 FLASH Program Memory l Typ E/W l Byte/Word Read/Write at V DD l 256 x 8 EEPROM Data Memory l Min. 100K E/W l 368 x 8 Data Memory (RAM) l 33 I/O ports l 25mA sink/source l 3 Timers l bit l bit l 10-bit A/D l 8K x 14 FLASH Program Memory l Typ E/W l Byte/Word Read/Write at V DD l 256 x 8 EEPROM Data Memory l Min. 100K E/W l 368 x 8 Data Memory (RAM) l 33 I/O ports l 25mA sink/source l 3 Timers l bit l bit l 10-bit A/D l Two Capture/Compare/PWMs l USART l 9-bit addressable l High Speed Enhanced SPI  l All 4 SPI modes supported l Microwire  Support Master I 2 C  l Hardware Write to I 2 C devices In-Circuit-Serial Programming  l In-Circuit-Debugger l Parallel Slave Port

S4525A Peripherals & Enhanced FLASH 3 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 3 Peripherals & Enhanced FLASH PIC16F62X Features at a Glance l 18-pin package l Up to 2K x 14 FLASH Program Memory l Typ E/W l Byte/Word Read/Write at V DD l 128 x 8 EEPROM Data Memory l Min. 100K E/W l 224 x 8 Data Memory (RAM) l 16 I/O ports l 25mA sink/source l 18-pin package l Up to 2K x 14 FLASH Program Memory l Typ E/W l Byte/Word Read/Write at V DD l 128 x 8 EEPROM Data Memory l Min. 100K E/W l 224 x 8 Data Memory (RAM) l 16 I/O ports l 25mA sink/source l 3 Timers l bit l bit l Capture/Compare/PWM l USART l 9-bit addressable l High Speed l 2 Comparators In-Circuit-Serial Programming  l Internal RC Oscillator

S4525A Peripherals & Enhanced FLASH 4 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 4 Peripherals & Enhanced FLASH Master SSP Module: I 2 C  Mode l PIC16F87X devices have the Master SSP. l SSPCON2 register is added. l SSPSTAT are new. l Code from PIC16C7X devices is 100% compatible.

S4525A Peripherals & Enhanced FLASH 5 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 5 Peripherals & Enhanced FLASH I 2 C Master Operation l There is a sequence of events during a transfer from Start bit to Stop bit: Start Bit Byte Writes Byte Reads Acknowledges Restart Conditions Stop Bit l The I 2 C Master is like a state machine. Cannot spool or queue events l The I 2 C module must be idle before starting a new event.

S4525A Peripherals & Enhanced FLASH 6 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 6 Peripherals & Enhanced FLASH I 2 C Master Mode

S4525A Peripherals & Enhanced FLASH 7 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 7 Peripherals & Enhanced FLASH SSP Mode Select Bits SSPM 0000SPI Master Mode, clock = Fosc/4 0001SPI Master Mode, clock = Fosc/ SPI Master Mode, clock = Fosc/ SPI Master Mode, clock = TMR2 output/2 0100SPI Slave Mode, clock = SCK pin, SS enabled 0101SPI Slave Mode, clock = SCK pin, SS disabled 0110I 2 C Slave Mode, 7-bit address 0111I 2 C Slave Mode, 10-bit address 1000I 2 C Master Mode, clock =Fosc/(4*(SSPADD+1)) 1011IC Firmware controlled Master Mode (slave idle) 1110I 2 C Firmware controlled Master Mode, 7-bit address 1111I 2 C Firmware controlled Master Mode, 10-bit address 2

S4525A Peripherals & Enhanced FLASH 8 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 8 Peripherals & Enhanced FLASH Bus Collision l The BCLIF flag bit (PIR2 ) indicates a bus collision. l Always check for bus collision, even if one master and one slave are the only devices on the bus. l Check for bus collision after every idle check. l Make sure that the event has completed and that any possible bus collisions were detected.

S4525A Peripherals & Enhanced FLASH 9 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 9 Peripherals & Enhanced FLASH Write Sequence l Any byte that is written out will generate 9 clocks l 8 clocks for data (SDA is an output). l 1 clock for acknowledge bit (SDA is an input). l State of acknowledge bit is in the ACKSTAT bit (SSPCON2 ). l The state of the acknowledge bit should be checked after idle and bus collision checks. l Write sequence: l Start bit l Control/Address with R/W = 0 l Address byte l Data byte l Stop bit

S4525A Peripherals & Enhanced FLASH 10 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 10 Peripherals & Enhanced FLASH Read Sequence l A read sequence will only generate 8 clocks. l The master must acknowledge the slave. l Write ACK state to ACKDT bit (SSPCON2 ),value used on SDA. l Set the ACKEN bit (SSPCON2 ), starts one clock cycle on SCL. l Read Sequence: l Start bit l Control/Address with R/W = 0 l Address l Restart l Control/Address with R/W = 1 l Read Byte l Stop bit l Last byte read from slave should be NACKed by the master.

S4525A Peripherals & Enhanced FLASH 11 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 11 Peripherals & Enhanced FLASH ACK Polling l Determines if the serial EEPROM can accept more data. l ACK Polling sequence: l Start bit l Control/Address with R/W = 0 l Check to see if the serial EEPROM acknowledged (ACKSTAT = 0) l If serial EEPROM acknowledged then continue l Otherwise, wait for serial EEPROM to acknowledge by: l Restart l Control/Address with R/W = 0 l Check ACKSTAT

S4525A Peripherals & Enhanced FLASH 12 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 12 Peripherals & Enhanced FLASH SPI Mode Block Diagram SPI  Mode Block Diagram

S4525A Peripherals & Enhanced FLASH 13 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 13 Peripherals & Enhanced FLASH SPI Module SCK (CKP = 0,CKE =0) SCK (CKP = 1,CKE =0) SCK (CKP = 0,CKE =1) SCK (CKP = 1,CKE =1) SDO (CKE=0) SDO (CKE=1) SDI (SMP=0) SDI (SMP=1) (Microwire ® ) b7 b6 b5 b4 b3 b2 b1 b0

S4525A Peripherals & Enhanced FLASH 14 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 14 Peripherals & Enhanced FLASH I 2 C Master Mode Exercise 2 l Configure I 2 C module for 100KHz clock. l Read the temperature of the I 2 C sensor DS1721. l Read the temperature 128 times to get an average.

S4525A Peripherals & Enhanced FLASH 15 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 15 Peripherals & Enhanced FLASH Bank0 Bank1 Bank2 Bank3 Special Function Registers PIC16C77 PIC16F877 00h 180h 1Fh 19Fh 00h 1Fh 180h 19Fh