8 Pages

lecture18

Course: EE 2801, Fall 2009
School: Uni. Worcester
Rating:
 
 
 
 
 

Word Count: 602

Document Preview

of Foundations Embedded Systems A Term Fall 2005 Lecture #18: Memory Organization in the PIC 16F877 Reading for Today: Reading for Next Class: Homework #4 is on web: PIC Lab #1: PIC Data sheet Sect 12, PIC Ref. Manual 46 Data sheet Sect 4,1415, PIC Ref. Manual 29, 32, 9 Due Monday 10/03/05 Signoff and Report due in you lab section next Weds. (Remember: Bonus points for Early Signoff/Submission!) Last...

Register Now

Unformatted Document Excerpt

Coursehero >> United Kingdom >> Uni. Worcester >> EE 2801

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
of Foundations Embedded Systems A Term Fall 2005 Lecture #18: Memory Organization in the PIC 16F877 Reading for Today: Reading for Next Class: Homework #4 is on web: PIC Lab #1: PIC Data sheet Sect 12, PIC Ref. Manual 46 Data sheet Sect 4,1415, PIC Ref. Manual 29, 32, 9 Due Monday 10/03/05 Signoff and Report due in you lab section next Weds. (Remember: Bonus points for Early Signoff/Submission!) Last class: Introduced PIC 16F87X Microcontroller family This class: Discuss memory organization, data memory access, registers Organization of Program Memory PC is13 bits wide PC = Holds address of next instruction to be fetched PIC16F874A has 4K program memory. Only needs 12 of the address bits. (MSB ignored) PIC16F877A has 8K program memory. Needs all 13 address bits Special Addresses in Program Memory: 0000h = RESET Vector = 1st instruction executed on powerup/reset Within first 4 instructions (00000003h) >> Will likely be a jump (GOTO) or branch to start of Main Code 0004h = INTERRUPT Vector = When interrupt occurs PC is set to 0004h >> From here it can jump to Interrupt Service Routine (ISR) Program Memory is Paged >> Program memory subdivided in to 2048 byte (2KB) pages >> Bits 4 and 3 of PCLATH register selects code memory page >> PC will automatically increment across page boundaries in sequential operations Programmer DOES NOT have to set high bits in PCLATH >> For jumps/calls that cross page boundaries the PROGRAMMER MUST MODIFY bits <4:3> of PCLATH Example: Structure of a general instruction and a call/goto instruction HW Stack is 8 (and only 8!) instructions deep Calls and Interrupts copy 13 bit address of next instruction (after call) from PC onto stack and pop it upon Return >> No direct programmer access to stack (i.e. no push or pop instructions) >> Stack is a Circular Buffer! >> If more than 8 addresses are pushed, the most recent will overwrite oldest! Data memory organization: Spec >> Sheet a bit confusing.... says 16F877 has 368 bytes of data memory (RAM) >> Actually has 512 bytes of RAM but only 368 bytes available for user data (i.e. General Purpose Registers, GPR ) >> Other 144 bytes are reserved for special function registers (SFR) >> REMEMBER: Except for W, all registers actually locations in RAM! >> Even PC (i.e. PCL & PCLATH) and STATUS Data memory is arranged into four 128 byte BANKS Need 9 address bits to access 512 data memory locations 2 bits to select bank | 7 bits to index from 0 to 128 (007Fh) within bank >> Banks selected by using bits RP1: RP0 and IRP in the STATUS register (see Ref. Manual pg 57 for other STATUS bit definitions) STATUS: Example: Direct Addressing ; define a variable named Temp in Bank0 cblock Bank0Ram Temp ; is at 0x20 = 20h in Bank0 endc CLRF STATUS ; Clear STATUS register (RP1:RP0=0 0 selects Bank0) ; Set RP0=1 and select Bank1 ; Clear RP0 and select Bank0 again ; MOV contents of W register to address 20h in Bank0 ; Clear RP0 and select Bank0 again ; Set RP1 = 0 and select Bank2 ; Both RP1:PR0 = 00 selects Bank3 ; selects Bank2 again BSF STATUS, RP0 BCF STATUS, RP0 MOVWF Temp BCF STATUS, RP0 BSF STATUS, RP1 BSF STATUS, RP0 BCF STATUS, RP0 Indirect Addressing: >> INDF register not a physical register. Just flags indirect addressing to be used. >> When INDF used in an instruction, the PIC forms the 9 bit address of the operand using the IRP bit from STATUS register and contents of File Select Register (FSR) BCF MOVLW MOVWF CLRF INCF .... BSF CLRF MOVLW MOVWF STATUS, IRP ; IRP = 0, select Bank0/1 for indirect addr 0x30 ; move 30h into W FSR ; move 30h into FSR INDF ; sets contents of addr 30h (Bank0) to 0 INDF ; increments contents at address 030h to 1 STATUS, IRP ; IPR = 1 select Bank2/3 INDF ; clears register at addr 1 00110000 = 130h 0x05 ; W = 5 INDF ; register at address 130h now equals 5
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Uni. Worcester - EE - 2801
Foundations of Embedded Systems A Term Fall 2005 Lecture #8: Programming Examples Reading for Today: Reading for Next Class: Homework #2 is on web: Lab #1: Exam #1 (Ch 25): 6.46.6 Review Ch 25 Due Tomorrow 9/9/05 at BEGINNING of class (Make copy to
Uni. Worcester - EE - 2801
Laboratory Assignment #4LED Control via Interrupt Driven TimersDate: _Lab Partner Name #1 email@wpi.edu ECE box numberLab Partner Name #2 email@wpi.edu ECE box numberLaboratory #4 Assignment Sign Off: _ Date: __ Comments: Binary Blink Patter
UMass (Amherst) - MECH - 4820
UMass (Amherst) - MECH - 4820
Western Michigan - ECE - 552
ECE 552 Fall 2006 SeveranceOpportunity Three1. [25 points] A 3-mode counter is controlled by three momentary switches named ABLE, BAKER and CHARLIE. Each time ABLE is pushed, the counter progresses through the sequence 3, 2, 6, 5 repeatedly. If BA
Western Michigan - ECE - 552
ECE 552 Severance Fall 2006Opportunity One1. [20 points]: Consider the algebra defined by the binary operations following tables: a. b. c. Derive the table of compliments Draw the associated Hasse diagram Is this algebra a. S totally ordered set?
Western Michigan - ECE - 552
ECE 552 Severance Fall 2007Assignment SevenDue 08 October 20071Analyze the synchronous circuit shown below. Assume that the clock, while not shown explicitly, is present. a. b. c. Write the state and output equations Form the state table and d
Western Michigan - ECE - 552
ECE 552 Severance Fall 2007Assignment NineDue December 041.Consider the FSM defined by the following state table. Find an equivalence partition and put the corresponding reduced machine in standard form. Show your work by showing the partition
Western Michigan - ECE - 552
ECE 552 Severance Fall 2007Assignment TenDue December 061.Consider a fundamental mode asynchronous circuit with inputs x1, and x2 and output z and the following specifications: If x2=0, any change in x1 will toggle z (and if x1 doesn't change,
Western Michigan - ECE - 552
ECE 5520 Fall 2007 SeveranceComputer TwoDue November 2006This assignment is to apply your knowledge about state-machine-programming to identify code sequences in a strand of DNA. Toward this end, recall that DNA (a nucleotide) acts as the reposi
Western Michigan - ECE - 552
Western Michigan - ECE - 552
Western Michigan - ECE - 552
Western Michigan - ECE - 552
ECE 552 Fall 2006 SeveranceAssignment ThreeDue 28 September 20061Using a four-variable Karnough may, derive minimal SOP and POS expressions for the function2Given the expression a. b. c. Find a minimal SOP function representing f. Find a m
Western Michigan - ECE - 552
ECE 552 Fall 2006 SeveranceAssignment NineDue 02 November 2006This assignment is to apply your knowledge about state-machine-programming to a genetic system, namely the recognition of each of the 20 amino acids encoded in an RNA molocule base-pa
Western Michigan - ECE - 552
ECE 552 Severance Fall 2006Assignment FourteenDue 05 December 2006Recall that the linear machine used in the cryptography example considered in lecture was based on five bits, a &quot;key&quot; of 10101 and used modulo two arithmetic. In an analogy with t
UMass (Amherst) - MECH - 4820
Western Michigan - ECE - 552
ACTGAATCTATACGATATAGCAT
Western Michigan - ECE - 552
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;Error&gt;&lt;Code&gt;NoSuchKey&lt;/Code&gt;&lt;Message&gt;The specified key does not exist.&lt;/Message&gt;&lt;Key&gt;de3636167aae1dba3ca2de7ba41ca5c6131abe7e.txt&lt;/Key&gt;&lt;RequestId&gt;B6CD8DE21690CE76&lt;/RequestId&gt;&lt;HostId&gt;6fGkwd6Tqi+Oon2p+TXbEGBJA8JE
USC - ITP - 460
Raul Rodriguez Christine Kang ITP 460Q/A ReportHTML On the main page: http:/dev.laeducationcorps.org/ The About, How To Help, and Board are all directed to the same page. I think that there should be new designs for those sections since they do
USC - ITP - 460
Christine Kang ITP 460 2/7/07 Website Redesign The site I pick is: http:/www.designoutpost.com/ 1) Five things that work a. Clean layout b. Appropriately labeled navigational options c. Links within the body content of the page (Understanding Navigat
Rose-Hulman - PH - 113
Physics III Homework I Chapter 32; 12, 24, 32, 35, 38, 46, 66, 68, 7432.12.Model:The magnetic field is that of a current loop.Solve:From Example 32.5, the on-axis magnetic field of a current loop is Bloop =CJ0 IR 2 2 z2 + R2()3/ 2 Bloop
Rose-Hulman - PH - 113
PH113-03 Dr. Joenathan HW #1 CM411 CM423 CM441 CM465 CM470 CM478 CM479 CM488 CM495 CM528 CM555 CM561 CM596 CM615 CM632 CM647 CM677 CM707 CM710 CM726 CM757 CM764 CM765 CM2464 CM774 CM775 CM837 CM852 CM880 CM898 CM902 CM909 BenjaminLawrenceAtkinson Aar
Rose-Hulman - PH - 113
Physics III Homework IV Chapter 33; 60, 72, 73, 74 and Chapter 23; 4, 9, 14, 16 33.60.Model:Assume the magnetic field is uniform over the loop. Visualize:The motion of the eye will change the orientation of the loop relative to the fixed field direct
Rose-Hulman - PH - 113
Physics III Homework VI Chapter 22; 3, 6, 12, 18, 22, 36, 47, 58 22.3.Model:Two closely spaced slits produce a double-slit interference pattern. Visualize:The interference pattern looks like the photograph of Figure 22.3(b). It is symmetrical with th
Rose-Hulman - PH - 113
Physics IIIHomework VII Chapter 21; 68, 73, 26, 60, 62, 64 CJ21.68.Model:The changing sound intensity is due to the interference of two overlapped sound waves.Visualize:Please refer to Figure P21.68. Solve:Minimum intensity implies destructive in
Rose-Hulman - PH - 113
vti_encoding:SR|utf8-nl vti_author:SR|JOENATHA-3\joenatha vti_modifiedby:SR|JOENATHA-3\joenatha vti_timelastmodified:TR|25 Apr 2007 23:42:02 -0000 vti_timecreated:TR|25 Apr 2007 23:42:02 -0000 vti_cacheddtm:TX|25 Apr 2007 23:42:02 -0000 vti_filesize:
Rose-Hulman - PH - 113
vti_encoding:SR|utf8-nl vti_author:SR|JOENATHA-3\joenatha vti_modifiedby:SR|JOENATHA-3\joenatha vti_timelastmodified:TR|25 Apr 2007 23:42:03 -0000 vti_timecreated:TR|25 Apr 2007 23:42:03 -0000 vti_cacheddtm:TX|25 Apr 2007 23:42:03 -0000 vti_filesize:
Rose-Hulman - PH - 113
vti_encoding:SR|utf8-nl vti_author:SR|JOENATHA-3\joenatha vti_modifiedby:SR|JOENATHA-3\joenatha vti_timelastmodified:TR|25 Apr 2007 23:42:03 -0000 vti_timecreated:TR|25 Apr 2007 23:42:03 -0000 vti_cacheddtm:TX|25 Apr 2007 23:42:03 -0000 vti_filesize:
Rose-Hulman - PH - 113
vti_encoding:SR|utf8-nl vti_author:SR|JOENATHA-3\joenatha vti_modifiedby:SR|JOENATHA-3\joenatha vti_timelastmodified:TR|07 May 2007 21:50:01 -0000 vti_timecreated:TR|07 May 2007 21:50:01 -0000 vti_cacheddtm:TX|07 May 2007 21:50:01 -0000 vti_filesize:
University of Texas - I - 385
Advanced Usability Fall, 2004 First day stuff1 Please complete an index card, with: Name Email address Phone number Previous usability experience Reason for taking this class. 2 Once around the room Name Program (e.g., iSchool?) Year in the
University of Texas - I - 385
Content UsabilityApresentationoncreatingusablecontentforthe onlineenvironment.ByJohnStubbeContent UsabilityAnanecdoteaboutcarseatsSuchmanualsarewrittenatatenthgradereadinglevelon average,accordingtoanewstudy,whiledatasuggestthatnearly a
University of Texas - I - 385
Analysis of Windows XP and SUSE Linux 9.1 Operating SystemsA Usability StudyJohn Stubbe Advanced Usability INF 385G Dr. Randolph BiasContentIntroduction Methodology Results and Analysis ConclusionsIntroductionOrigin of the Project Evolut
Rose-Hulman - ME - 501
Rose-Hulman Institute of Technology Department of Mechanical Engineering ME 501 Advanced Thermodynamics Homework Problem HW5_3Using only p-v-T data from the steam tables, approximate the change in specific entropy of superheated steam as it undergoe
Rose-Hulman - ME - 501
Rose-Hulman Institute of Technology Department of Mechanical Engineering ME 501 Advanced Thermodynamics Homework Problem HW6_1 The isothermal compressibility of water at 50oC is given by = 0.125 x 10-3/[v(p + 2740)], where p is in bars, v is in m3kg
Rose-Hulman - ES - 202
ROSE-HULMAN Institute of Technology Foundation Coalition Sophomore Engineering Curriculum ES202 Fluid &amp; Thermal Systems EXAMPLEWater at 35oC discharges into the atmosphere at standard sea-level pressure as shown in the figure. (Patm = 2116 lbf/ft2,
Rose-Hulman - ES - 202
ROSE-HULMAN INSTITUTE OF TECHNOLOGY Foundation Coalition Sophomore Engineering Curriculum ES202 Fluid &amp; Thermal Systems EXAMPLEA manometer is a device used to measure fluid pressure. Its operating principle is based on pressure variations within st
St. John Fisher - KEEP - 06654
MSTI 131 Spring 2008 April 3, 2008Chelsea Gadd Ann Fisher Allie DeJoseph Easy access to information Global communication tool Appeal to different learning styles Students control there learning by using hands on activities. Multiple perspec
Cal Poly Pomona - FRL - 315
FRL 315 Financial Institutions and MarketsCRN: 72405 Section 2 Tuesday &amp; Thursday: 3:00 4:50 p.m. Fall Quarter 2008 Building 24B- Room 1421P. Sarmas www.csupomona.edu/~psarmasCATALOG DESCRIPTION: Focus on financial markets and institutional man
Cal Poly Pomona - FRL - 353
FRL 353 Section 1 Multinational Financial MarketCRN # 72109 Tuesday &amp; Thursday: 10:00-11:50 a.m. Fall Quarter 2004 Building 6 Room 107 P. Sarmaswww.csupomona.edu/~psarmasCatalog Description:Institutional overview of structure and application f
Cal Poly Pomona - GBA - 546
Profession MBA Program GBA 546 Fundamentals of Financial ManagementSection P200CRN: 13778Winter Quarter 2006 Tuesday: 6:00 - 9:50 p.m.P. Sarmas www.csupomona.edu/~psarmasCATALOG DESCRIPTION: Theoretical and conceptual framework for financial d
Cal Poly Pomona - GBA - 610
Graduate Business Administration 610 Financial Markets and InstitutionsCRN 10912 P. Sarmas Building 66 Room 201 Winter Quarter 2007 Monday: 6:00-8:50www.csupomona.edu/~psarmasCATALOG DESCRIPTION: The structure and role of the financial system, i
Cal Poly Pomona - GBA - 610
Graduate Business Administration 610 Financial Markets and InstitutionsCRN 10912 P. Sarmas Building 66 Room 201 Winter Quarter 2007 Monday: 6:00-8:50www.csupomona.edu/~psarmasCATALOG DESCRIPTION: The structure and role of the financial system, i
Georgia Tech - CS - 4451
Rendering Equation 1 OverviewThe rendering equation attempts to describe the energy transport that happens by means of visible light. It neglects the wave nature of light (at least in the form discussed here), but is considered a sufficient approxi
Georgia Tech - CS - 4451
10 3 25S.5 .5 0.451 0 0S.5 -.5 0.450 1 0S-.5 .5 0.450 0 1S-.5 -.5 0 .451 1 1S0 0 0.41 1 0
Georgia Tech - CS - 4451
10 10 101S0 0 011 1 0
Georgia Tech - CS - 4451
1.5 .5 1.110S-0.262939 0.0424805 0.6730960.1042110.0791016 0.249023 0.0722656S0.577148 -0.592529 -0.1501460.1068120.916992 0.486328 0.745117S0.39624 0.51123 0.659180.1258540.0820312 0.992188 0.776367S0.392578 -0.356689 0.08422850.1324
Georgia Tech - CS - 4451
1.5 .5 1.150S-0.262939 0.0424805 0.6730960.1042110.0791016 0.249023 0.0722656S0.577148 -0.592529 -0.1501460.1068120.916992 0.486328 0.745117S0.39624 0.51123 0.659180.1258540.0820312 0.992188 0.776367S0.392578 -0.356689 0.08422850.1324
Georgia Tech - CS - 4451
1.5 .5 1.110S-0.227881 0.0368164 0.583350.1280760.0791016 0.249023 0.0722656S0.500195 -0.513525 -0.1301270.145410.916992 0.486328 0.745117S0.343408 0.443066 0.5712890.2723630.0820312 0.992188 0.776367S0.340234 -0.309131 0.0729980.3163
Georgia Tech - CS - 4451
1.5 .5 1.120S-0.227881 0.0368164 0.583350.1280760.0791016 0.249023 0.0722656S0.500195 -0.513525 -0.1301270.145410.916992 0.486328 0.745117S0.343408 0.443066 0.5712890.2723630.0820312 0.992188 0.776367S0.340234 -0.309131 0.0729980.3163
Georgia Tech - CS - 4451
1.5 .5 1012T.99 -1 -1-.99 -1 -1-.99 1 -11 1 1T.99 -1 -1-.99 1 -1.99 1 -11 1 1S-0.227881 0.0368164 0.583350.1280761 1 0S0.500195 -0.513525 -0.1301270.145410 1 1S0.343408 0.443066 0.5712890.2723631 0 1S0.340234 -0.309131 0.0729
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 05Programmation systme@Pierre Marchand, 20011Plan de la rencontre Retour sur la semaine prcdente Programmation virgule flottante Programmation MMX@Pierre Marchand, 20012Retour sur la semaine prcdente Comparaison
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 05Programmation systme@Pierre Marchand, 2001289Plan de la rencontre Retour sur la semaine prcdente Programmation virgule flottante Programmation MMX@Pierre Marchand, 2001290Retour sur la semaine prcdente Compara
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 06Programmation systme@Pierre Marchand et Martin Dubois, 20021Plan de la rencontre Retour sur la semaine prcdente Programmation SIMD Programmation SIMD2 Mmoire virtuelle@Pierre Marchand et Martin Dubois, 20022Retou
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 07Programmation systme@Pierre Marchand, 2001461Plan de la prsentation Prsentation du corrig du travail pratique 1 Retour sur la semaine prcdente Prsentation du travail pratique 2 Codage des instructions Interruptions
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 09Programmation systme@Pierre Marchand et Martin Dubois, 20021Cette semaine Retour sur la semaine prcdente Interruptions matrielles Bus PCI Port d'entr / sortie Adressage mmoire Priphrique Polling vs Interrupt P
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 09Programmation systme@Pierre Marchand et Martin Dubois, 2002461Cette semaine Retour sur la semaine prcdente Interruptions matrielles Bus PCIPort dentr / sortie Adressage mmoire Priphrique Polling vs Interrupt Port
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 10Programmation systme@Martin Dubois, 20011Plan de la rencontre Retour sur la semaine dernire Pilote de priphrique Linux Compilation Lien entre le pilote et le monde extrieure Entr dans /dev Enregistrement La structur
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 10Programmation systme@Martin Dubois, 2001578Plan de la rencontre Retour sur la semaine dernire Pilote de priphrique LinuxCompilation Lien entre le pilote et le monde extrieure Entr dans /dev Enregistrement La structure
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 11Programmation systme@Martin Dubois, 2001578Plan de la rencontre Retour sur la semaine dernire Pilote de priphrique LinuxGestion des interruptions Techniques de dverminages spcifiques Les tasklets Les modes d'excutions d
Northwestern State University of Louisiana - IFT - 17584
IFT-17584 Semaine 12Programmation systme@Martin Dubois, 2001578Plan de la rencontre Retour sur la semaine dernire Pilote de priphrique Windows 2000! ! ! ! ! Architecture WDM Les modes d'excution La structure IRP La vie d'un IRP Les dlais d