• Non ci sono risultati.

SISTEMI EMBEDDED

N/A
N/A
Protected

Academic year: 2021

Condividi "SISTEMI EMBEDDED"

Copied!
9
0
0

Testo completo

(1)

SISTEMI EMBEDDED AA 2012/2013

SOPC DE2 Basic Computer Parallel port

(2)

DE2 Basic Computer

• Nios II configuration provided by Altera University Program

– Core: Nios II/e

– Memory: SDRAM, RAM, On-chip memory – Parallel ports: Red_LEDs, Green_LEDs,

HEX3_HEX0, HEX7_HEX4, Slider_switches, Pushbuttons, etc.

– Other peripherals: JTAG UART, Serial_port, Interval_timer, sysid

(3)

DE2 Basic Computer (cont.)

(4)

Parallel port (1)

• Interface for general purpose I/O

– Based on Altera’s PIO core customized for DE-series boards

– Controlling LEDs, acquiring data from Switches, etc.

(5)

Parallel port (2)

• 4 32-bit memory-mapped registers

• n actual number of I/O pins

(6)

Parallel port (3)

• Managing PIO in C program:

– Use of pointers to int initialized with PIO base memory address (we’ll learn soon other ways!)

0x10000000 0x1000000C Red_LEDS 0x10000000

Red_LEDs_ptr

volatile int *red_LED_ptr = (int *) 0x10000000;// red LED address

volatile int *slider_switches_ptr = (int *) 0x10000040;// SW slider switch address

0x10000040 0x1000004C

Slider_switches 0x10000040

Slider_switches_ptr

(7)

Parallel port (4)

• Why volatile attribute?

– I/O registers may change even if the program does not modify them!

• The peripheral hardware may modify their contents

– volatile say to the compiler do not make any optimization to the code involving an object declared with the volatile attribute

(8)

Parallel port (5)

• Reading/Writing I/O registers:

*red_LED_ptr = *Slider_switches_ptr;

• Let’s start our first program with Nios II

– Control each DE2 red LED through the corresponding slider switch (LEDRi = SWi)

• To go on:

– Display the status of (SW15-SW0) on HEX3_HEX0 as a hexadecimal number

(9)

References

• Altera “Basic Computer System for the Altera DE2 Board”

• Altera “Parallel Port for Altera DE-Series Boards”

Riferimenti

Documenti correlati

In the present study, we determined histamine content and HDC activity in human colorectal cancer and correlated them with tumor stages and intratumor microvessel density

Adenocarcinoma is the most frequent primary cancer in the prostate with an incidence very variable in relation to different epidemiological data analyzed; however,

Using the results of the use cases workshops and integrating these with the best practices identified in the literature, interviews and surveys, the authors

The results demonstrated a strong discrimination of BAH individuals from all other groups (up to 60-fold difference from APA patients), and a striking difference

(a) Voltage output from one of the 16 tactile units; (b) result of the algorithm application using a 40 ms window for the ON/OFF signal computation; (c) result of the

paraplegic and quadriplegic patients; that patients suffering from chronic abdominal diseases must be carefully selected in order to avoid unnecessary radiation exposure; that chronic

As for the effective number of electoral lists in terms of seats, for the elections between 1994 and 2001, it was calculated taking into account, separately, all the parties

In the short term, it recommends strengthening the role of the council as coordinator of policy dialogue among the different international economic institutions; in the longer