1 SERIAL PORT INTERFACE FOR MICROCONTROLLER EMBEDDED INTO INTEGRATED POWER METER Mr. Borisav Jovanović, Prof.dr Predrag Petković, Prof.dr. Milunka Damnjanović,

Slides:



Advertisements
Similar presentations
Developing an AVR Microcontroller System
Advertisements

INPUT-OUTPUT ORGANIZATION
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
Processor System Architecture
Microcontroller – PIC – 4 PIC types PIC architecture
Introduction of Holtek HT-46 series MCU
DAAD Project ISSNBS Niš, LOW POWER MICROCONTROLLER DESIGN BY USING UPF Borisav Jovanović, Milunka Damnjanović, Faculty of Electronic Engineering.
IO Controller Module Arbitrates IO from the CCP Physically separable from CCP –Can be used as independent data logger or used in future projects. Implemented.
Introduction to Microprocessors Number Systems and Conversions No /6/00 Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller.
HT46 A/D Type MCU Series Data Memory (Byte) Program Memory HT46R22 (OTP) HT46C22 (Mask) 2Kx Kx16 4Kx HT46R23 (OTP) HT46C23 (Mask) HT46R24.
1 ECE 263 Embedded System Design Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System.
The 8051 Microcontroller Architecture
ASPPRATECH.
Microcontroller based system design
Microcontroller: Introduction
BLDC MOTOR SPEED CONTROL USING EMBEDDED PROCESSOR
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
INPUT-OUTPUT ORGANIZATION
MCU – Microcontroller Unit – 1 MCU  1 cip or VLSI core – application-specific.
ECE 447: Lecture 1 Microcontroller Concepts. ECE 447: Basic Computer System CPU Memory Program + Data I/O Interface Parallel I/O Device Serial I/O Device.
AVR Microcontrollers.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
VERIFICATION OF I2C INTERFACE USING SPECMAN ELITE By H. Mugil Vannan Experts Mr. Rahul Hakhoo, Section Manager, CMG-MCD Mr. Umesh Srivastva, Project Leader.
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 13 Computer Systems Roger.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
DLS Digital Controller Tony Dobbing Head of Power Supplies Group.
Typical Microcontroller Purposes
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
Lecture 2 Silicon Labs C8051F020 System Overview.
Microcontroller Presented by Hasnain Heickal (07), Sabbir Ahmed(08) and Zakia Afroze Abedin(19)
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
ECE Lecture 1 Microcontroller Concepts. Basic Computer System CPU Memory Program + Data I/O Interface Parallel I/O Device Serial I/O Device Data.
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
Atmel Atmega128 Overview ALU Particulars RISC Architecture 133, Mostly single cycle instructions 2 Address instructions (opcode, Rs, Rd, offset) 32x8 Register.
Design of a Novel Bridge to Interface High Speed Image Sensors In Embedded Systems Tareq Hasan Khan ID: ECE, U of S Term Project (EE 800)
Microprocessors For a microprocessor to give a working microcomputer system, which can be used for control tasks, additional chips are necessary, e.g.
Computer Organization & Assembly Language © by DR. M. Amer.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
DsPIC30F4011 Fall DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
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.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
Chapter Microcontroller
Embedded Communication Protocols Don Heer 10/18/10 1.
Submitted by:.  Project overview  Block diagram  Power supply  Microcontroller  MAX232 & DB9 Connector  Relay  Relay driver  Software requirements.
Components of a typical full-featured microcontroller.
AVR Architecture Prepared By: Avdhesh Soni ( ) Sarthak Patel ( ) Akshay Parekh ( ) Fenil Sachla ( ) Guided.
NAM S.B MDLAB. Electronic Engineering, Kangwon National University 1.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
CEng3361/18 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2007 Recitation 01.
Design methodology for Implementing a Microcontroller in a FPGA. Phillip Southard Ohio University EE 690 Reconfigurable Design.
ALPHA COLLEGE OF ENGINEERING & TECHNOLOGY Introduction to AVR ATMega32 Architecture PREPARED BY SHWETA ( ) BHOOMI ( ) YOGEN ( )
Introduction to Microcontroller Technology
Programmable Logic Devices
Embedded Systems Programming
Microcontrollers & GPIO
Microprocessor Systems Design I
Chapter 11: Inter-Integrated Circuit (I2C) Interface
UNIT – Microcontroller.
Microprocessor Systems Design I
Principles & Applications
I2C PROTOCOL SPECIFICATION
Subject Name: Microcontroller Subject Code: 10ES42
Introduction to Microprocessors and Microcontrollers
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Serial EEPROM (Atmel 24C-512)
Jeremy Reed ATMEL AT24C512 2-wire Serial EPROM Jeremy Reed
AVR – ATmega103(ATMEL) Architecture & Summary
EECE.3170 Microprocessor Systems Design I
Wireless Embedded Systems
Presentation transcript:

1 SERIAL PORT INTERFACE FOR MICROCONTROLLER EMBEDDED INTO INTEGRATED POWER METER Mr. Borisav Jovanović, Prof.dr Predrag Petković, Prof.dr. Milunka Damnjanović, Faculty of Electronic Engineering Nis, Serbia

2 INTRODUCTION Modern power meters relays on single chip devices referred to as integrated power meter (IPM). Proposed three-phase IPM integrates all primary functional blocks required to implement solid-state energy meter. The chip performs the precision computations necessary to measure: active, reactive energy in four quadrants for all three-phases, instantaneous frequency for each phase, RMS currents and voltages, active, reactive and apparent power and power factor.

3 INTRODUCTION Fig.1 Architecture of the Integrated Power-Meter The digital part is composed of digital filters, digital signal processing block (DSP) and microcontroller unit together with integrated peripherals. The analog part of IPM contains Sigma-Delta AD converters for current and voltage channels, Band-Gap voltage reference and PLL circuits. IPM is a mixed signal circuit consisting of analog and digital signal processing blocks (Fig.1).

4 THE MICROCONTROLLER UNIT OVERVIEW Fig.2 Microcontroller unit memory map Memory areas: program memory, implemented as internal 8kB SRAM block; external data memory, 2kB SRAM memory block which also resides on chip; internal data memory shared between Special Function Register (SFR) and 256B RAM MCU operates at MHz. Instruction set is compatible with 8052 microcontrollers. One-byte instructions are performed in a single cycle. Processing throughput of more than 4 MIPS.

5 THE MICROCONTROLLER UNIT OVERVIEW The MCU peripherals: three 8-bit wide digital in-out ports two programmable UART modules serial port interface (SPI) for communication with external EEPROM memories LCD driver circuits capable to support up to 168 pixels LCD real-time clock In AMIS CMOS 0.35μm technology we don’t have available on-chip non-volatile memory blocks. Therefore, external EEPROM devices had to be used together with the Integrated Power Meter After resetting MCU, in the initialization mode, program memory (internal 8kB SRAM block) is automatically loaded from external EEPROM memory through SPI pins. In the special programming mode, the IPM has ability to receive MCU program through special UART input pin and store it into external EEPROM memory through SPI pins.

6 SERIAL PORT INTERFACE The communication between MCU and the external EEPROM requires data transfer during chip initialization, programming and normal operation mode. The interface between MCU and EEPROM is designed as an I2C-like serial port interface.The hardware module dedicated for this purpose is named MASTER SPI. Only two pins are required: SDA for data and SCL for clock. The serial clock frequency is 100 kHz. Internal communication with MCU employs two 8-bit Special Function Registers: EEDATA and EECTRL that are embedded into MASTER SPI block. Fig.3 MASTER SPI interface

7 SERIAL PORT INTERFACE Bit position NameDescription 7ErrorIllegal command received 6BusySerial Data Bus is busy 5Rx_ackAcknowledge received from EEPROM 4Tx_ackAcknowledge transmitted to EEPROM 3:0Cmd(3:0) 0No operation 2Receive a byte from EEPROM and send ACK 3Transmit a byte to EEPROM 5Issue a STOP sequence 6Receive a byte from EEPROM and do not send ACK 9Issue a START sequence Table 1. EECTRL register content

8 SERIAL PORT INTERFACE Fig.5 EECTRL(3:0)=0101 Issue a STOP sequence Fig. 4 EECTRL(3:0)=1001 Issue a START sequence Writing data into four least significant bits of EECTRL register commences the MASTER SPI actions.

9 MCU PROGRAMMING AND INITIALIZATION The main blocks are: MASTER SPI UART Finite State Machine (FSM) 8192-byte SRAM memory block 13-bit COUNTER that defines the address for SRAM Fig. 6 The part of chip dedicated for EEPROM programming and chip initialization

10 MCU PROGRAMMING AND INITIALIZATION Fig. 7 The structure of one data package sent to the EEPROM during programming mode During programming mode all data received from UART block are serially transmitted in form of 32-byte data packages through SDA pin to the EEPROM device. The 32-byte package begins with start bit, followed by device address byte, high memory address byte, low memory address byte, 32 data bytes and ends by stop bit. Bytes are separated by acknowledge bit received from EEPROM

11 Fig.8 Data package during SRAM initialization mode MCU PROGRAMMING AND INITIALIZATION Chip initialization begins after MCU reset. The FSM starts the communication with a dummy write operation (one with no data bytes) to load the EEPROM address counter. The LSB in the second device address byte signifies read operation. After receiveing 8192 bytes from EEPROM, FSM terminates the read operation.

12 SIMULATION AND SYNTHESIS The serial port interface as well as the whole digital part of a chip was described in VHDL. Digital synthesis was performed by Cadence tool named BuildGates. Logical verification is carried out in NCsim digital circuit simulator Digital blockArea (gates) MASTER SPI FSM UART COUNTER SRAM The used standard cell technology is AMIS CMOS 0.35μm. Behavioral model in VHDL is created for I2C EEPROM 24LC64 which is after used in test-benches for SPI verification. Table 2. Area of digital blocks

13 SIMULATION AND SYNTHESIS Fig. 9 EEPROM read operation

14 CONCLUSION MASTER SPI dedicated for communication with external EEPROM device has I2C-like interface that operates at 100kHz. External EEPROM is used for chip programming, SRAM program memory initialization and also for storing the important measurement results gathered during chip normal operating mode. MASTER SPI can be programmed by 8052 microcontroller through only two 8-bit Special Function Registers EEDATA and EECTRL MASTER SPI as well as the whole digital part of a IPM system-on-chip is coded in VHDL. The code was verified by simulations and synthesized by Cadence tools. AMI Semiconductor CMOS 0.35μm standard cell technology was used for chip implementation.