Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Embedded Systems The X-Board: Memory-Mapped I/O and Devices Lecture 7.

Similar presentations


Presentation on theme: "Introduction to Embedded Systems The X-Board: Memory-Mapped I/O and Devices Lecture 7."— Presentation transcript:

1 Introduction to Embedded Systems The X-Board: Memory-Mapped I/O and Devices Lecture 7

2 Introduction to Embedded Systems Summary of Previous Lecture The many levels of computer systems The CPU-Memory Interface The Memory Subsystem and Technologies –SRAM –DRAM CPU-Bus-I/O –I/O Register Basics Bus Protocols –Synchronous bus protocol –Asynchronous bus protocol –Bus arbitration

3 Introduction to Embedded Systems Quote of the Day Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it. –Lou Holtz

4 Introduction to Embedded Systems Outline of This Lecture The 18-349 lab X-Board hardware –80200 XScale Processor –Xilinx FPGA –Seven-segment display –Accessing flash memory Memory-Mapped I/O –Accessing the devices from C programs

5 Introduction to Embedded Systems The X-Board Reset button

6 Introduction to Embedded Systems A Look at the Sound Card

7 Introduction to Embedded Systems What’s Life Without Accessories?

8 Introduction to Embedded Systems The X-Board + Accessories

9 Introduction to Embedded Systems The 80200 Big Endian Evaluation Platform (BRH) Hardware SpecificationValue/Limit Processor XScale-based Intel 80200, 733 MHz SDRAM Memory128Mbyte, 100MHz Flash Memory4Mbyte, 100-150ns Ethernet – 2 Ports10/100 BaseT Serial – 2 PortsRS232, 115.2K PCISingle-slot, 64 bit, 33 MHz, 264 MBps Debug Support PROM-ICE Connector 80200 JTAG Connector

10 Introduction to Embedded Systems Ethernet Ports (10/100BT) Intel 80200 Processor PCI Backplane Serial Ports Power Supply Flash Memory Seven Segment Display “Mom”: The Mothership Reset Button Endianness Jumper Boot Image Selector

11 Introduction to Embedded Systems [ASIDE] Review of PCI (Peripheral Component Interconnect) Shared bus = same path from multiple devices to CPU/mem –Direct access to system mem –Bridge to CPU’s system bus –Single system IRQ for all devices – bus bridge Up to 133 MHz, 64-bit, 1GBps (X-Board differs) Potential replacements –Point-to-point channels –Infiniband (4 GBps) –HyperTransport (6.4 GBps)

12 Introduction to Embedded Systems

13 [ASIDE] Review of Ports Serial ports –Universal Asynchronous Receiver/Transmitter (UART): controller –Takes the computer bus’ parallel data and serializes it –Transfer rate of 115 Kbps –Example usage: Modems Parallel ports –Sends the 8 bits in parallel –50-100 KBps (standard), upto 2 MBps (enhanced) –Example usage: Printers, Zip drives Universal Serial Bus (USB) ports –Single way to connect upto 127 devices –Hot-swappable, “Plug-and-Pray” –Max bandwidth of 12 Mbps –Example usage: Digital cameras

14 Introduction to Embedded Systems The Serial Ports

15 Introduction to Embedded Systems More on Serial Ports Two asynchronous serial ports Dual UART connected to the peripheral bus RS232 pin information –Data lines: TX and RX –Handshake lines: CTS and RTS Part of Lab 2 –Write a pseudo-serial driver for Serial Port 2 –APIs provided in the library serial_lib.a –To initialize/finalize the serial device –To write characters to the UART (printing to the terminal display) –To capture input from the keypad (detecting keypad numeric input) Caution –Keypad will not work on the COM port of your computer –Serial Port 1 is reserved for use by the Angel debug monitor

16 Introduction to Embedded Systems Seven-Segment LED Seven-segment display on X-Board Controlled by the Board firmware Decimal point segment is special –Not controlled by firmware –“Power-On” indicator –Connected to 3.3V rail

17 Introduction to Embedded Systems More on the Seven-Segment LED LED is a memory-mapped I/O device –Mapped to 0x20200000 LED Character Map –Look in header file brh.h Keypad + LED demo in Lab 2 –Display on the LED the number entered on the keypad Quirks: Except for the first key press of any run, each key press returns two values – (i) the value of the last key pressed and (ii) the value of the current key pressed.

18 Introduction to Embedded Systems Jumper-Configurable Little/Big Endian

19 Introduction to Embedded Systems Flash Memory on the Board What is flash memory? X-Board contains 4MB of flash memory Can store programs (and data) in a block structure Flash library –Divides the flash memory structure into blocks BOOT Portion of Flash Memory –Contains the boot monitor, Angel debug client, system self-tests Application portion (use this for Lab 2) –Where the user keeps applications and associated data Do not set the BOOT portion as your default flash device! [ASIDE] Example of flash memory (not on X-Board, though)

20 Introduction to Embedded Systems Flash Library Image Storage Layout Image Area Logical block boundary (high memory) Unused Image Information Header Footer Logical block boundary (low memory)

21 Introduction to Embedded Systems Details of the Layout Image area –All of the code and read-only data segments of the image. Header information –Any file header information from the downloaded file Image information –Image identification & code operations (added by flash lib code) Unused flash Footer information (five-word information block) –Address of the information block for this image –Base address of the data (the start might be at the beginning of a previous block rather than at the start of this block) –Unique 32-bit value to aid in fast searching –Image type (a block, an image, a SIB, or data) –Checksum for the footer information (over the first four words only)

22 Introduction to Embedded Systems Accessing Flash Memory (Flash APIs) Flash libraries supplied –flash_lib.a, ActivateFlash.a –APIs defined in flash_lib.h APIs in these libraries allow you to –Initialize/finalize the flash device –Check that flash memory exists at a given location –Mark a part of the flash memory as active –Read a 32-bit word out of a location in flash memory –Examine/verify the footer information (calculate checksum) APIs also allow you to perform file processing –Open/close a file on the host –Read bytes from the open file –Write bytes to the open file Please see Lab 2 handout for more details

23 Introduction to Embedded Systems Software Addressing of Devices Memory­mapped I/O –Devices are mapped in memory address space, e.g., the 7-segment LED –Standard load and store instruction can manipulate devices Isolated I/O (I/O­mapped I/O) –Devices are not kept in memory address space –Special processor instructions request data from devices Example IN REG, PORT OUT REG, PORT Which one is better? –Memory­mapped I/O uses the same load/store paradigm, but costs some of the address space –Full address space is available for Isolated I/O, but requires extra instructions and control signals from the CPU

24 Introduction to Embedded Systems Writing Code to Access the Devices Writing assembly code to access devices can be cumbersome LDR R0,=0x20200000 MOV R1,#0xFF STRB R1,[R0] Should use “EQU” assembler directive BASE EQU 0x20200000 LDR R0, =BASE Can also access devices using C programs

25 Introduction to Embedded Systems Accessing Devices from C Programs C pointers can be used to write to a specific memory location unsigned char *ptr; ptr = (unsigned char *) 0x18000000; *ptr = (unsigned char) 0xFF; ??????????? 0x18000000 ptr

26 Introduction to Embedded Systems The X-Team’s “Xplanation”

27 Introduction to Embedded Systems Summary of Lecture The 18-349 lab 80200 Big-Endian Evaluation Board –80200 XScale processor –Xilinx FPGA The X-Board and accessories –Seven-segment LED, Serial ports Preparing you for Lab 2  Flash memory  Serial ports –Timers (stay tuned for the next lecture)


Download ppt "Introduction to Embedded Systems The X-Board: Memory-Mapped I/O and Devices Lecture 7."

Similar presentations


Ads by Google