Putting Altera MAX Series in Hibernation Mode Using User Flash Memory

Similar documents
Using Altera MAX Series as Microcontroller I/O Expanders

MAX II ISP Update with I/O Control & Register Data Retention

Using the Altera Serial Flash Loader Megafunction with the Quartus II Software

USB-Blaster Download Cable User Guide

9. Configuration, Design Security, and Remote System Upgrades in the Cyclone III Device Family

Using the On-Chip Signal Quality Monitoring Circuitry (EyeQ) Feature in Stratix IV Transceivers

Using the Agilent 3070 Tester for In-System Programming in Altera CPLDs

MAX 10 FPGA Configuration User Guide

Configuration via Protocol (CvP) Implementation in Altera FPGAs User Guide

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

PROFINET IRT: Getting Started with The Siemens CPU 315 PLC

Altera Error Message Register Unloader IP Core User Guide

White Paper Reduce Total System Cost in Portable Applications Using Zero-Power CPLDs

USB-Blaster II Download Cable User Guide

ModelSim-Altera Software Simulation User Guide

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

DS1821 Programmable Digital Thermostat and Thermometer

EC313 - VHDL State Machine Example

13. Publishing Component Information to Embedded Software

Quartus II Software and Device Support Release Notes Version 15.0

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

RETRIEVING DATA FROM THE DDC112

DS1621 Digital Thermometer and Thermostat

MAX 10 Analog to Digital Converter User Guide

MorphIO: An I/O Reconfiguration Solution for Altera Devices

Applying the Benefits of Network on a Chip Architecture to FPGA System Design

White Paper Utilizing Leveling Techniques in DDR3 SDRAM Memory Interfaces

MAX V CPLD Development Kit User Guide

CHAPTER 11: Flip Flops

MAX 10 Clocking and PLL User Guide

OTU2 I.7 FEC IP Core (IP-OTU2EFECI7Z) Data Sheet

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

Avalon Interface Specifications

Chapter 11. Using MAX II User Flash Memory for Data Storage in Manufacturing Flow

Quartus II Software Download and Installation Quick Start Guide

DS18B20 Programmable Resolution 1-Wire Digital Thermometer

PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

M25P05-A. 512-Kbit, serial flash memory, 50 MHz SPI bus interface. Features

USER GUIDE EDBG. Description

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

15. Introduction to ALTMEMPHY IP

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

Video and Image Processing Suite

Simulating Power Supply Sequences for Power Manager Devices Using PAC-Designer LogiBuilder

FPGAs for High-Performance DSP Applications

In-System Programmability

Providing Battery-Free, FPGA-Based RAID Cache Solutions

HANDLING SUSPEND MODE ON A USB MOUSE

White Paper Streaming Multichannel Uncompressed Video in the Broadcast Environment

Using Nios II Floating-Point Custom Instructions Tutorial

SPI Flash Programming and Hardware Interfacing Using ispvm System

Supply voltage Supervisor TL77xx Series. Author: Eilhard Haseloff

DS1621 Digital Thermometer and Thermostat

MicroMag3 3-Axis Magnetic Sensor Module

ADS9850 Signal Generator Module

What Determines FPGA Power Requirements?

DM Segment Decoder/Driver/Latch with Constant Current Source Outputs

Qsys System Design Tutorial

Intel 815 Chipset Platform for Use with Universal Socket 370

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

GTS-4E Hardware User Manual. Version: V1.1.0 Date:

7 OUT1 8 OUT2 9 OUT3 10 OUT4 11 OUT5 12 OUT6 13 OUT7 14 OUT8 15 OUT9 16 OUT10 17 OUT11 18 OUT12 19 OUT13 20 OUT14 21 OUT15 22 OUT16 OUT17 23 OUT18

Microprocessor & Assembly Language

DS2401 Silicon Serial Number

AN 588: 10-Gbps Ethernet Hardware Demonstration Reference Designs

Nios II Software Developer s Handbook

Single 2.5V - 3.6V or 2.7V - 3.6V supply Atmel RapidS serial interface: 66MHz maximum clock frequency. SPI compatible modes 0 and 3

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Designing with High-Density BGA Packages for Altera Devices

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

December 2002, ver. 1.0 Application Note 285. This document describes the Excalibur web server demonstration design and includes the following topics:

White Paper Increase Flexibility in Layer 2 Switches by Integrating Ethernet ASSP Functions Into FPGAs

Altera SoC Embedded Design Suite User Guide

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

Embedded Multi-Media Card Specification (e MMC 4.5)

Designing VM2 Application Boards

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

White Paper Military Productivity Factors in Large FPGA Designs

Engineering Change Order (ECO) Support in Programmable Logic Design

Arbitration and Switching Between Bus Masters

Dolphin In-Circuit programming Updating Firmware in the field

The Programming Interface

AN111: Using 8-Bit MCUs in 5 Volt Systems

Enhancing High-Speed Telecommunications Networks with FEC

RAM & ROM Based Digital Design. ECE 152A Winter 2012

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

EMC6D103S. Fan Control Device with High Frequency PWM Support and Hardware Monitoring Features PRODUCT FEATURES ORDER NUMBERS: Data Brief

(Refer Slide Time: 00:01:16 min)

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

M25P40 3V 4Mb Serial Flash Embedded Memory

How To Prevent Power Supply Corruption On An 8Bit Microcontroller From Overheating

A Lesson on Digital Clocks, One Shots and Counters

White Paper Understanding Metastability in FPGAs

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Section 14. Compare/Capture/PWM (CCP)

Transcription:

20160114 Putting Altera MAX Series in Hibernation Mode Using User Flash Memory AN-547 Subscribe The MAX II, MAX V, and MAX 10 devices can be used in this example application You can completely power down the device into hibernation mode during an inactive period The device powers down automatically, and allows the system to power it up again when the system requires the device to execute a task, while retaining the register data This example application shows the capability of the supported Altera device to store the register data into the non-volatile user flash memory (UFM) before self-powering-down after an idle period The device also reads back the data from the UFM and reloads the registers for the device to resume operation shortly after powering up Related Information User Flash Memory (ALTUFM) Megafunction User Guide Provides more information about the ALTUFM IP core Using User Flash Memory in MAX II Devices User Flash Memory in MAX V Devices MAX 10 User Flash Memory User Guide Design Example for MAX II Provides the MAX II design files for this application note (AN 547) Design Example for MAX 10 Provides the MAX 10 design files for this application note (AN 547) Design Example Description The following design examples show the capability of the supported Altera device in a self-power-down system MAX II and MAX V devices are different from MAX 10 devices due to different flash memory usage modes The registers data is retained to ensure that the system s operation is not affected by the power-down The example system consists of the design implemented in a MAX II, MAX V, or MAX 10 device as well as some external hardware circuitry The hardware circuitry and the design in the device work together to ensure the success of the self-power-down system In the example applications, a 4-bit binary up-counter is the user application module in which the counter s data must be retained when the supported Altera device is powered down after a predefined period of inactivity Upon power-up, the data is reloaded into the counter s registers, so the count operation resumes from the previous value 2016 All rights reserved ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of and registered in the US Patent and Trademark Office and in other countries All other words and logos identified as trademarks or service marks are the property of their respective holders as described at wwwalteracom/common/legalhtml Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services ISO 9001:2008 Registered wwwalteracom 101 Innovation Drive, San Jose, CA 95134

2 External Hardware Circuitry Supplying a trigger signal to the counter with a pushbutton (active low signal) increases the count value by one If the counter does not receive a trigger signal after a fixed duration, the design automatically stores the count value into the UFM before triggering the external circuitry to power down the supported Altera device For MAX II and MAX V devices, when the next trigger signal is received to increase the count, the device automatically powers up The design then reads back the data from the correct location in the UFM and reloads the counter s registers The count value is incremented by one from the read-back data For MAX 10 devices, pressing the trigger signal powers up the design and fetches the last value stored and puts the value out on the LED display, but doesn't increment the value You can also reset the counter by pressing the reset button that clears the count value AN-547 20160114 External Hardware Circuitry An external circuitry is used to control the power supply to the supported Altera device, as well as the input to the counter Figure 1: External Hardware Circuitry The VCCINT/VCCIO power supplies are applicable for MAX II and MAX V devices only The power supplies for MAX 10 single supply devices are VCC_ONE, VCCA, and VCCIO The power supplies for MAX 10 dual supply devices are VCC, VCCD_PLL, VCCINT, VCCA, VCCA_ADC, and VCCIO The VCCINT/VCCIO power supplies are for MAX II and MAX V devices only 33V PMOS Device VCCINT/VCCIO SW1 10 kω N1 R1 1 kω R2 10 kω Power-Down-Ready SW2 Count Reset Counter Output 4 A P-channel MOSFET is used to control the power supply to the supported Altera device If the gate of the P-channel MOSFET is at low-voltage level, the transistor is turned on to allow current to flow through from the power supply to the supported Altera device If the transistor's gate is at a high-voltage level, the transistor is turned off and the supported Altera device is in powered-down state The P-channel MOSFET can be steadily turned off with the 1-kΩ pull-up resistor R1 Besides, I/O pins of the device do not drive out when the device is powered down

AN-547 20160114 Design in the MAX II Device 3 To turn on the P-channel MOSFET, press the pushbutton SW1 Pressing pushbutton SW1 causes the voltage level at the transistor's gate to low and allows the transistor to power up the supported Altera device again After power-up, the supported Altera device goes into user mode, at the maximum of 450 µs The supported Altera device drives the P-channel MOSFET's gate low through its Power-Down-Ready output pin to allow continuous operation even though pushbutton SW1 is released If the supported Altera device detects that the counter is not active for a pre-defined period of time, the device then drives the Power-Down-Ready ouput pin high Driving the Power-Down-Ready output pin high turns off the P- channel MOSFET, thus self powering down the supported Altera device Pushbutton SW1 is also used for incrementing the count value The system uses a single pushbutton for powering up the device, as well as incrementing the count value, so you do not need to know whether the device is powered down when you want to increment the count As the device recognizes a low pulse as the trigger to increment the count value, resistors R1 and R2 are used as a voltage divider Even though the device forces the P-channel MOSFET's gate low using the Power-Down-Ready output pin, the node N1 that connects to the Count input pin still has a voltage higher than V IH(min) for the input pin to recognize node N1 as high It also allows count operation when pushbutton SW1 is pressed, because the voltage level must be lower than V IL(max) to be recognized as low Use pushbutton SW2 to reset the counter so that it starts from zero Note: The external hardware circuitry described uses the same 33-V power supply for V CCINT and V CCIO Modification to the external hardware circuitry is needed for designs that require V CCIO to be at a different level than V CCINT Note: To use the hot-socketing feature when the device is powered down, connect the VCCINT and VCCIO pins to ground Design in the MAX II Device The MAX II design consists of four modules: 4-bit binary up-counter Data controller Timer UFM instantiation module

4 4-Bit Binary Up-Counter Figure 2: Modules in the Design AN-547 20160114 Reset Count 4-Bit Binary Up-Counter 4 Counter Output Timer Data Controller Power-Down- Ready Signal UFM Instantiation Module 4-Bit Binary Up-Counter The 4-bit binary up-counter is the user application module that counts from four bits of zeros to four bits of ones The Reset and Count input pins of the device go to the input ports of the counter, while the output of the counter goes to four output pins Every low pulse to the Count input pin increments the count value by one When the count value reaches its maximum value (four bits of ones), the next low pulse to the Count input port resets the count value to four bits of zeros To reset the count value to all zeros at any time, assert the Reset signal Data Controller When the data controller receives the signal from the timer indicating that the device does not have any activity for a pre-defined duration, the controller automatically reads the data from the counter and writes the data into the UFM Upon completion of the task, the data controller then asserts the Power-Down- Ready signal high for the external circuitry to power down the device When the device powers up, the data controller automatically goes to the location in the UFM where the data from the counter is stored, and reads back the data before the device powers down again The controller then reloads the registers of the counter with the data The data controller interfaces with the module that instantiates the UFM through the Altera proprietary interface protocol The controller writes the data to a blank location in the UFM every time before the device is powered down, and reads back the data from the correct location when the device is powered back up

AN-547 20160114 Timer 5 Timer The controller uses almost all the addresses in sector 0 of the UFM for data storing purposes The erase operation takes additional time to complete, so when the UFM sector is full, the controller automatically erases that sector Related Information User Flash Memory Data Save and Retrieval Method on page 6 Provides detailed information about how the controller determines the location in the UFM for data storage and the retrieval method You can use the timer to determine the maximum idle time allowed before the supported Altera device is powered down Timer is a counter in which the most significant bit (MSB) signal is used to trigger the process of saving the counter data into the UFM and powering down the supported Altera device Figure 3: Wait Timer Equation The following equation shows how to calculate the wait time where T is wait time, n is the width of the counter, and f is the frequency of the internal oscillator that clocks the counter, typically 5 MHz The width of the counter determines the wait time For a longer wait time, increase the counter's width The signal from the pushbutton that increments the 4-bit binary up-counter resets the timer and prevents the supported Altera device from being powered down For this example application, the width of the counter is 26 bits wide, so the wait time is approximately 7 seconds You can also implement the timer outside of the supported Altera device using other external components to reduce logic element (LE) usage User Flash Memory Instantiation Module This module instantiates the UFM of the device and all communications with the UFM goes through this module This example application is using the Altera Serial Interface (NONE) of the user flash memory (ALTUFM_NONE) IP core The data controller is created based on the interface protocol of this IP core The UFM has two sectors The example application uses sector 0 of the UFM for data storage purposes You can use sector 1 for storing other user data Erasing sector 0 does not affect the data in sector 1 Using this IP core, you can also utilize the internal oscillator of the supported Altera device Other modules in the design use the oscillator output as the clock source The frequency of the oscillator output is between 33 MHz and 55 MHz Related Information User Flash Memory (ALTUFM) Megafunction User Guide Provides more information about the ALTUFM IP core Using User Flash Memory in MAX II Devices Provides more information about user flash memory

6 User Flash Memory Data Save and Retrieval Method User Flash Memory in MAX V Devices Provides more information about user flash memory AN-547 20160114 User Flash Memory Data Save and Retrieval Method The design writes the data into the UFM before the device is powered down, and reads back the data from the UFM when the device is powered up again The challenge is to determine which location or address in the UFM the design should write the data into, and then be able to go back to the same address upon power-up to read back the data The erased UFM has all 1 s as the content When you write any data to the UFM, the data is written to the existing content in the UFM through an AND logic In other words, if a 0 is written into a location that has 1, the content becomes 0 If a 1 is written into a location that has 1, the content remains 1 When the content becomes 0, you cannot write 1 to that location again, except when the entire sector of the UFM is erased Alternatively, the controller uses only one address in the UFM for data storage Every time before the device is powered down, the controller writes the data to a fixed address in the UFM When the device is powered up, the controller goes directly to that address to read back the data Using the same address allows the address to be hard-coded in the design, thus making the design simpler However, one drawback is that every time before the write operation occurs, the entire sector of the UFM must be erased before new data can be written into it This process slows down the operation as erase time is much longer as compared to the duration for read or write operations Because the supported Altera device is SRAM-based, any data not stored in the flash memory is lost when a power cycle occurs Although the data is safely stored in the UFM, the device cannot recall the location in the UFM where the data is stored Searching all of the addresses in the UFM is time-consuming and does not actually tell the controller which data is the most recent data written into the UFM In this example application, a new method is used Instead of using only one address from the total of 256 addresses from sector 0 of the UFM, this method uses 240 addresses for data storage, and another 15 addresses to store header information

AN-547 20160114 User Flash Memory Data Save and Retrieval Method 7 Figure 4: Addresses in UFM Used for the Header and Data Storage The UFM described in this figure is applicable for MAX II and MAX V devices For the size of the UFM and data length of the MAX 10 devices, refer to the MAX 10 User Flash Memory User Guide 0x000 Header (15 Addresses x 16 Bits) 0x00E 0x00F 0x010 0x0FF Unused Location (1 Address x 16 Bits) Data (240 Addresses x 16 Bits) Sector 0 of UFM: 256 Addresses The header section is used to keep track of the most recent address into which the controller has written Upon power-up, the controller only checks the header section to determine the location where the data is stored just before the device is powered down The header section spans from address 0x000 to address 0x00E 15 addresses total Each bit in the header section represents the validity of the data in one address in the data section The first bit in the header section, which is the least significant bit (LSB) of address 0x000, represents address 0x010 in the data section, and so on If the header bit is 0, this means that the address in the data section contains valid data Header bit 1 means the address in the data section is blank

8 User Flash Memory Data Save and Retrieval Method Figure 5: Header Section and Data Section AN-547 20160114 Header Address 0x000 Header 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 Data Addresses 0x010 0x011 0x012 0x013 Data Programmed Programmed Programmed Not Programmed During power-up, the controller reads the header address one by one Data is written into addresses in the data section sequentially, from address 0x000 to address 0x015, from LSB to MSB of each address The controller can determine which addresses in the data section has been used based on the number of 0 s in the header section If the controller identifies that the MSB in a particular header address is 0 s, it recognizes that the header address contains 16 bits of 0 s and proceeds to read from the next header address If the controller identifies that the MSB in the header address is 1, the controller then proceeds to check how many 0 s are in that header address to determine the exact location in which the data is stored However, if the data in this header address is all 1 s, the controller recognizes that the previous header address has all 0 s By checking the header section, the controller can determine the exact location where the data was stored before the device was powered down Figure 6: Data Address The following figure shows how the controller obtains the data address for the controller from which to read the data, based on the information from the header bits N is the number of 0 s in the header address last read by the controller Bit 8 Bit 74 Bit 3 0 Data Address = 0 Header Address + 1 N - 1 When the device is powered down, the controller writes the counter data into the next blank data address, and then writes a 0 in the subsequent header bit location If the UFM sector is full, the controller first erases the sector before writing the data into the first address in the data section, and then writes 0 into the first bit in the header section

AN-547 20160114 Design in the MAX 10 Device 9 The benefits of using header data include the following: The controller does not need to search all the addresses in sector 0 of the UFM to find the correct data The header section only occupies a total of 15 addresses in sector 0 of the UFM The controller does not have to search for more than 15 addresses to determine where the most recent data is located The header indicates to the controller whether the data in a particular location is valid If the data written into an address is coincidentally all 1 s, it will appear that the address is blank, because erasing the UFM sets all the data in all addresses to all 1 s In this case, the header bit shows that the data is valid Design in the MAX 10 Device The MAX 10 design consists of four major modules: 4-bit binary counter 16-bit binary slow counter Main controller, which instantiates the UFM module within it Random start block which initiates a power-on reset (POR) Figure 7: Modules in the MAX 10 Design Count Slow Counter Main Controller pwr_dn_ready UFM Random Start Reset 4-Bit Binary Up-Counter counter_out[3:0] 4-Bit Binary Up-Counter The 4-bit binary up-counter is the user application module that counts from four bits of zeros to four bits of ones The Reset and Count input pins of the device go to the input ports of the counter, while the output of the counter goes to four output pins to drive LEDs

10 16-Bit Binary Slow Counter Every low pulse to the Count input pin increments the count value by one When the count value reaches its maximum value (four bits of ones), the next low pulse to the Count input port resets the count value to four bits of zeros To reset the count value to all zeros at any time, assert the Reset signal Upon power-up, the Main Controller fetches the UFM stored counter value and sends it to the 4-bit binary up-counter to write out the value to the output pins When a shut down is initiated by the 16-bit binary slow counter module, the main controller fetches the current stored count value from the 4-bit binary up-counter to write into the UFM before asserting pwr_dn_ready signal 16-Bit Binary Slow Counter The 16-bit binary up-counter is the user application module that counts from 16 bits of zeros to 16 bits of ones It is triggered upon the first Count signal received after the main controller has fetched the UFM stored counter value and written it to the 4-bit binary up-counter display After the first Count signal is received, the counter counts to all ones When a new Count signal is received, the counter resets all zeros and resumes counting again The Reset signal clears the slow counter and waits till a new Count signal is received before counting again When the 16-bit slow counter reaches the maximum value, it sends a signal to the main controller to begin the shut-down sequence of fetching the current counter value from the 4-bit binary up-counter, storing it in the UFM, and asserting pwr_dn_ready signal which shuts down the power supply to the device as shown in the Modules in the MAX 10 Design figure The 16-bit slow counter, as shown in the Modules in the MAX 10 Design figure, is clocked by the internal oscillator, which can operate up to a maximum frequency of 116 MHz in the 10M08 device used in this design example The 16-bit resolution is used to make simulation time short, but in real-time operation, this counter will reach the maximum count value in a fraction of a second (2^16*862 ns), which is not ideal for testing on an evaluation kit Everytime you press the Count button, the device would power off before you could press it again To change the design for board-level testing, replace the design file /core/slow_counterv with the alternate design file provided /core/slow_counter_30bitv to be used in the qsf assignments for compilation This will increase the number of bits used to an acceptable value for real-time operation A counter of 30-bits will extend the slow counter to take approximately 9 seconds before issuing a shut-down request Main Controller The main controller is the heart of the design The main controller instantiates the UFM which has an Avalon Memory-Mapped (MM) Slave interface and controls all of the reading and writing to the UFM At power-up, the random start block issues a POR cycle and then sends a signal to the main data controller to read the UFM stored counter value at a static address and sends it to the 4-bit binary upcounter AN-547 20160114 After the power-up fetch process completes, the main controller sits idle until the Reset signal is asserted or when it receives a signal from the 16-bit binary slow counter to initiate the power-down sequence When the main controller receives the power-down signal from the 16-bit binary slow counter, the main controller reads the current 4-bit binary up-counter value, removes the write protection of the UFM, writes the 4-bit binary up-counter value to the static address hard-coded in the design, turns back on the write protection for the UFM, and then sends the pwr_dwn_ready signal out of the device, which shuts off the power supply to the MAX 10 device

AN-547 20160114 Random Start Block 11 Random Start Block At power-up, the random start block issues a POR cycle and then sends a fetch request signal to the main controller to read the UFM stored counter value at a static address and sends it to the 4-bit binary upcounter When the Reset signal is asserted, it clears the system and reissues the fetch request to the main controller Document Revision History Date Version Changes January 2016 20160114 Removed the User Flash Memory Data Save and Retrieval Method in MAX 10 Devices section The UFM in MAX 10 devices must be erased before you write new data November 2014 20141107 Added MAX V and MAX 10 devices January 2009 10 Initial release