Memory organization. Memory blocks: Program memory (flash-type) 16 kword (32 kbyte) (instruction 16 bit wide) Data RAM 1536 byte (1.



Similar documents
Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Section 14. Compare/Capture/PWM (CCP)

How To Program A Microcontroller With Memory On A Microchip Microcontroller

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

Section 29. Instruction Set

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features:

10-bit Σ ADC from a PIC16F84

PIC16F84A Data Sheet. 18-pin Enhanced FLASH/EEPROM 8-bit Microcontroller Microchip Technology Inc. DS35007B

Real-Time Clock. * Real-Time Computing, edited by Duncan A. Mellichamp, Van Nostrand Reinhold

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

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

Using The PIC I/O Ports

PIC in Practice. A Project-Based Approach. D. W. Smith

AN727. Credit Card Reader Using a PIC12C509 DATA ENCODING INTRODUCTION FIGURE 1: POSITION OF ISO TRACKS 1, 2 AND 3. Andrew M Errington

PIC16F8X. 18-pin Flash/EEPROM 8-Bit Microcontrollers. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features:

PIC16F526 Data Sheet. 14-Pin, 8-Bit Flash Microcontroller Microchip Technology Inc. Preliminary DS41326A

Section 9. I/O Ports

SSPBUF. Shift Clock SSPSR. START bit, STOP bit, Acknowledge Generate

Microchip PIC18F452 Core Hardware. CPU, Memory, Interrupts, and I/O Ports

PIC12F519 Data Sheet. 8-Pin, 8-Bit Flash Microcontrollers

PIC12F629/675 Data Sheet

PIC Programming in Assembly. (

Section bit A/D Converter

PIC12F508/509/16F505 Data Sheet

1. The demonstration code is sending garbage to my terminal program. What are the recommended settings?

Analog-to-Digital Converters

AN585. A Real-Time Operating System for PICmicro Microcontrollers INTRODUCTION. Why do I Need a Real-Time Kernel? What is Multitasking Anyway?

PIC10F200/202/204/206 Data Sheet

DS1821 Programmable Digital Thermostat and Thermometer

HT1632C 32 8 &24 16 LED Driver

I 2 C Master Mode Overview and Use of the PICmicro MSSP I 2 C Interface with a 24xx01x EEPROM

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

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

Section 28. In-Circuit Serial Programming (ICSP )

8741A UNIVERSAL PERIPHERAL INTERFACE 8-BIT MICROCOMPUTER

Timer A (0 and 1) and PWM EE3376

The Programming Interface

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

AVR Timer/Counter. Prof Prabhat Ranjan DA-IICT, Gandhinagar

Special Lecture. Basic Stamp 2 Programming. (Presented on popular demand)

css Custom Silicon Solutions, Inc.

Section bit A/D Converter

Pololu P-Star 25K50 Micro User s

PIC16F627A/628A/648A Data Sheet

css Custom Silicon Solutions, Inc.

DS1621 Digital Thermometer and Thermostat

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

Flash Microcontroller. Memory Organization. Memory Organization

PIC16F62X. FLASH-Based 8-Bit CMOS Microcontrollers. Devices included in this data sheet: Special Microcontroller Features: High Performance RISC CPU:

LCM NHD-12032BZ-FSW-GBW. User s Guide. (Liquid Crystal Display Graphic Module) RoHS Compliant. For product support, contact

ADS9850 Signal Generator Module

CoE3DJ4 Digital Systems Design. Chapter 4: Timer operation

AT89C Bit Microcontroller with 1 Kbyte Flash. Features. Description. Pin Configuration

Lesson-16: Real time clock DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK

TB026. Calculating Program Memory Checksums Using a PIC16F87X ACCESSING MEMORY INTRODUCTION. PIC16C7X vs. PIC16F87X. Microchip Technology Inc.

TAC I/NETTM. Process Control Unit

PIC16F627A/628A/648A Data Sheet

LE25U81AMC. Advance Information

MicroMag3 3-Axis Magnetic Sensor Module

FEATURES DESCRIPTION. PT6321 Fluorescent Display Tube Controller Driver

Chapter 13. PIC Family Microcontroller

ET-BASE AVR ATmega64/128

Section 8. Interrupts

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

Lab 4: Pulse Width Modulation and Introduction to Simple Virtual Worlds (PWM) (PWM)

Fairchild Solutions for 133MHz Buffered Memory Modules

DS1621 Digital Thermometer and Thermostat

NJU6061. Full Color LED Controller Driver with PWM Control GENERAL DESCRIPTION PACKAGE OUTLINE FEATURES

c0003 A Simple PIC Application CHAPTER 3

Memory Basics. SRAM/DRAM Basics

Lab Experiment 1: The LPC 2148 Education Board

A N. O N Output/Input-output connection

AN851. A FLASH Bootloader for PIC16 and PIC18 Devices INTRODUCTION FIRMWARE. Basic Operation BOOTLOADER FUNCTIONAL BLOCK DIAGRAM COMMUNICATIONS

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

Section 19. Voltage Reference

USB-QUAD08. Eight-channel Quadrature Encoder Input Device. Specifications

8031AH 8051AH 8032AH 8052AH NMOS SINGLE-CHIP 8-BIT MICROCONTROLLERS

8254 PROGRAMMABLE INTERVAL TIMER

PIC Lab Manual. PIC Lab Manual. 1 Include CD-ROM 2010/2011

HD44780U (LCD-II) (Dot Matrix Liquid Crystal Display Controller/Driver)

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

DS18B20 Programmable Resolution 1-Wire Digital Thermometer

Atmel Norway XMEGA Introduction

Technical Description. Multifunctional Desk-Top Call Station Digital Version 8, 16 Keys L.No ,

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

Flexible Counter Series in DIN size 24 x 48 mm

Kurz Instruments Inc. Document AV Document Title: MFTB Event Code Definitions. MFT B-Series Event Codes

AN1229. Class B Safety Software Library for PIC MCUs and dspic DSCs OVERVIEW OF THE IEC STANDARD INTRODUCTION

CD4511BM CD4511BC BCD-to-7 Segment Latch Decoder Driver

CD4027BC Dual J-K Master/Slave Flip-Flop with Set and Reset

LC7218, 7218M, 7218JM

8051 MICROCONTROLLER COURSE

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

DS Real Time Clock FEATURES PIN ASSIGNMENT PIN DESCRIPTION

UNISONIC TECHNOLOGIES CO., LTD

Simple Alarm System WIRELESS AND REMOTE CONTROLLED PERSONAL APPLIANCE CODE WORD ORGANIZATION TRANSMISSION FORMAT

DATA SHEET. HEF40193B MSI 4-bit up/down binary counter. For a complete data sheet, please also download: INTEGRATED CIRCUITS

AN857. Brushless DC Motor Control Made Easy INTRODUCTION S 001 B. Anatomy of a BLDC SIMPLIFIED BLDC MOTOR DIAGRAMS. Microchip Technology Inc.

The modular concept of the MPA-3 system is designed to enable easy accommodation to a huge variety of experimental requirements.

Keil C51 Cross Compiler

Transcription:

TNE019 Mikrodatorer F2 1 Memory organization Memory blocks: Program memory (flash-type) 16 kword (32 kbyte) (instruction 16 bit wide) PC Reset Data RAM 1536 byte (1.5 kbyte) Data EEPROM 256 byte

TNE019 Mikrodatorer F2 2 Program memory for instructions. Instruction are stored as 2 bytes or 4 bytes. Least Significant Byte, LSB, stored on even address. Program counter,pc, increments in step of 2.

TNE019 Mikrodatorer F2 3 Read/Write from program memory. Not only programcode for instructions in memory. * One byte can be read. * One block min 64 byte can be erased. * One block min 8 byte can be programmed Read/Write Ex: Read one word and save it in RAM. movlw addressx ;TBLPTRU,TBLPTRH,TBLPTRL movwf TBLPTRx tblrd*+ movf TABLAT,W movwf Value_even tblrd*+ movf TABLAT,W movwf Value_odd

TNE019 Mikrodatorer F2 4 Data memory in static RAM Divided into 16 banks each contain 256 byte. Two parts General Purpose Registers, GPR Special Function Registers, SFR Address for each register is 12 bit. Bank Select Register, BSR<3:0> holds the upper 4 bits of address. Select which bank to be accessed.

TNE019 Mikrodatorer F2 5 Access to data memory in RAM, direct addressing Direct addressing

TNE019 Mikrodatorer F2 6 Access to data memory in RAM, indirect addressing Indirect addressing There are 3 indirect addressing registers FSR0, FSR1 and FSR2 INDF0, INDF1 and INDF2 Example: Clear RAM in Bank1 lfsr FSR0,0x100 Next clrf POSTINCO btfss FSR0H,1 goto Next. POSTINCn autoincrement FSRn after access POSTDECn- autodecrement FSRn after access PREINn autoincrement FSRn before access

TNE019 Mikrodatorer F2 7 Access to data EEPROM Used to store changeable parameters Example: Write to memory Not direct mapped in registers, instead It is indirect addressed through SFR. Involved registers in SFR are EECON1, EECON2, EEDATA and EEADR Example: Read from memory movlw movwf bcf bcf bsf movf ee_data EEADR EECON1,EEPGD EECON1,CFGS EECON1,RD EEDATA,W movlw movwf movlw movwf bcf bcf bsf bcf movlw movwf movlw movwf bsf bsf.. bcf ee_adr EEADR ee_data EEDATA EECON1,EEPGD EECON1,CFGS EECON1,WREN INTCON,GIE H 55 EECON2 H AA EECON2 EECON1,WR INTCON,GIE EECON1,WREN

TNE019 Mikrodatorer F2 8 Input/Output Ports Port A, B, C, D and E Each port has 3 registers for its operation: TRIS (data direction reg) PORT (reads level of pins) LAT (output latch) Bits in TRIS register: 0 makes corresponding bit an output and 1 makes it an input. You have to take care for multiple function on most bits.

TNE019 Mikrodatorer F2 9 Loads on in-/output ports Connecting LED to ports. In which case is current max? Ex: Determine the resistor for max LED current of 15 ma.

TNE019 Mikrodatorer F2 10 Protection of ports Input pins is protected against voltage over V DD and below V SS with clamping diodes. To limit the current to ports you had to use a protection resistor Rx.

TNE019 Mikrodatorer F1 11 Tangentbord Ett antal slutande återfjädrande kontakter. Tangentborden är konstruerade för att lätt kunna avkodas. Knapparna är placerade i ett koordinatsystem av ledare (rader och kolumner). Tangentbord kan avkännas på olika sätt Radavkänningsmetoden Linjeomvändningsmetoden

TNE019 Mikrodatorer F2 12 Radavkänningsmetoden.

TNE019 Mikrodatorer F2 13 Linjeomvändningsmetoden

TNE019 Mikrodatorer F2 14 Tangentbord med många tangenter.

TNE019 Mikrodatorer F2 15 Annat exempel på tangentbordsavkodning

TNE019 Mikrodatorer F2 16 Kontaktstudsar

TNE019 Mikrodatorer F2 17 Timer modules Four 16-bit timers. Timer0 can be used as a timer or a counter. Internal or external clock. Counts up. Edge select for external clock. Overflow from FF to 00. ;Timer delay with fosc = 20 MHz movlw B 11000011 movwf T0CON movlw D 206 movwf TMR0L bcf INTCON,TMR0IF Loop btfss INTCON,TMR0IF goto Loop. ;Count pulses on bit 4 porta, T0CKI movlw B 11100001 movwf T0CON clrf TMR0L ;Some delay. movlw TMR0L movwf Puls

TNE019 Mikrodatorer F2 18 Timer0 Control Register

TNE019 Mikrodatorer F2 19 Timer Module 1,2 and 3 Besides working as timers or counters it is possible to use them in Capture mode (Timer 1 and Timer 3) Compare mode (Timer 1 and Timer 3) PWM mode (Pulse Width Modulation) (Timer 2) PWM period = [(PR2)+1]*4*T oscillator *TMR2 prescaler PWM duty_cycle = (CCPR1L:CCP1CON<5:4>)* T oscillator *TMR2 prescaler PWM resolution = (log(f oscillator /f PWM )/log(2)) bits