Главная » Все файлы » Просмотр файлов из архивов » PDF-файлы » Руководство пользователя для Altera DE0-Nano

Руководство пользователя для Altera DE0-Nano (Лабораторная работа 2), страница 9

PDF-файл Руководство пользователя для Altera DE0-Nano (Лабораторная работа 2), страница 9 Математические модели и методы синтеза СБИС (39915): Лабораторная работа - 6 семестрРуководство пользователя для Altera DE0-Nano (Лабораторная работа 2) - PDF, страница 9 (39915) - СтудИзба2019-05-12СтудИзба

Описание файла

Файл "Руководство пользователя для Altera DE0-Nano" внутри архива находится в папке "Лабораторная работа 2". PDF-файл из архива "Лабораторная работа 2", который расположен в категории "". Всё это находится в предмете "математические модели и методы синтеза сбис" из 6 семестр, которые можно найти в файловом архиве МГУ им. Ломоносова. Не смотря на прямую связь этого архива с МГУ им. Ломоносова, его также можно найти и в других разделах. .

Просмотр PDF-файла онлайн

Текст 9 страницы из PDF

The Build Project dialog box appears and the IDE begins compiling theproject. When compilation completes, a message ‘Build complete’ will appear in the Console tab, asshown in Figure 7-57.Figure 7-57 Nios II IDE hello_world_0 Build CompletedNote: If there appears in the console tab, an error, “region onchip_memory2 isfull(hello_world_0.elf section .text). Region needs to be XXX bytes larger.” , please right-clickhello_world_0 , select System Library Properties menu, then pop a window. In the System LibraryProperties window, select Small C Library, then click OK to close the window.

Rebuild the project.123After a successful compilation, right-click the hello_world_0 project, select Run As > NIOS IIHardware. The IDE will download the program to the target FPGA development board and beginexecution. When the target hardware begins executing the program, the message ’Hello from NiosII!’ will appear in the NIOS II IDE Console tab, as shown in Figure 7-58 for an example.Figure 7-58 Hello_World_0 Program OutputNow you have created, compiled, and run your first software program based on NIOS II.

And youcan perform additional operations such as configuring the system properties, editing and re-buildingthe application, and debugging the source code.7.6 Edit and Re-Run the ProgramYou can modify the hello_world.c program file in the IDE, build it, and re-run the program toobserve your changes, as it executes on the target board. In this section you will add code that willmake the green LEDs, on the DE0-Nano board, blink.Perform the following steps to modify and re-run the program:1. In the hello_world.c file, add the text shown in blue in the example below:#include <stdio.h>124#include "system.h"#include "altera_avalon_pio_regs.h"int main(){printf("Hello from Nios II!\n");int count = 0;int delay;while(1){IOWR_ALTERA_AVALON_PIO_DATA(PIO_LED_BASE, count & 0x01);delay = 0;while(delay < 2000000){delay++;}count++;}return 0;}2.

Save the project.3. Recompile the project by right-clicking hello_world_0 in the NIOS II C/C++ Projects tab andchoosing Run > Run As > Nios II Hardware.Note: You do not need to build the project manually; the Nios II IDE automatically re-builds theprogram before downloading it to the FPGA.4. Orient your development board so that you can observe LEDs blinking.1257.7 W hy the LED BlinksThe Nios II system description header file, system.h, contains the software definitions, name,locations, base addresses, and settings for all of the components in the Nios II hardware system. Thesystem.h file is located in the in the hello_world_0_syslib\Debug\system_description directory,and is shown in Figure 7-59.Figure 7-59 The system.h fileIf you look in the system.h file for the Nios II project example used in this tutorial, you will noticethe pio_led function.

This function controls the LEDs. The Nios II processor controls the PIO ports(and thereby the LEDs) by reading and writing to the register map. For the PIO, there are fourregisters: data, direction, interruptmask, and edgecapture. To turn the LED on and off, theapplication writes to the PIO’s data register.The PIO core has an associated software file altera_avalon_pio_regs.h.

This file defines the core’sregister map, providing symbolic constants to access the low-level hardware. Thealtera_avalon_pio_regs.h file is located in the directory,altera\10.1\ip\sopc_builder_ip\altera_avalon_pio.When you include the altera_avalon_pio_regs.h file, several useful functions that manipulate thePIO core registers are available to your program. In particular, the macroIOWR_ALTERA_AVALON_PIO_DATA(base, data)126can write to the PIO data register, turning the LED on and off. The PIO is just one of many SOPCperipherals that you can use in a system. To learn about the PIO core and other embedded peripheralcores, refer to Quartus II Version 10.1 Handbook Volume 5: Embedded Peripherals.When developing your own designs, you can use the software functions and resources that areprovided with the Nios II HAL. Refer to the Nios II Software Developer’s Handbook for extensivedocumentation on developing your own Nios II processor-based software applications.7.8 Debugging the ApplicationBefore you can debug a project in the NIOS II IDE, you need to create a debug configuration thatspecifies how to run the software.

To set up a debug configuration, perform the following steps:1. In the hello_world.c , double-click the front of the line where you would like to set breakpoint,as shown in Figure 7-60.Figure 7-60 Set Breakpoint2. To debug your application, right-click the application, hello_world_0, and select Debug as >Nios II Hardware.3. If the Confirm Perspective Switch message box appears, click Yes.After a moment, the main() function appears in the editor. A blue arrow next to the first line of codeindicates that execution stopped at that line.1275. Select Run > Resume to resume execution.When debugging a project in the Nios II IDE, you can pause, stop or single step the program, setbreakpoints, examine variables, and perform many other common debugging tasks.Note: To return to the Nios II C/C++ project perspective from the debug perspective, click the twoarrows >> in the top right corner of the GUI.7.9 Configure System Librar yIn this section you will learn how to configure some advanced options in the Nios II IDE.

Byperforming the following steps, you can change all the available settings:1. In the Nios II IDE, right-click hello_world_0 and select System Library Properties. TheProperties for hello_world_0_syslib dialog box opens.2. Click System Library in the tree on the left side. The System Library page contains settingsrelated to how the program interacts with the underlying hardware.

The settings have names thatcorrespond to the targeted NIOS II hardware.3. In the Linker Script box, observe which memory has been assigned for Programmemory(.text), Read-only data memory(.rodata), Read/write data memory(.rwdata), Heapmemory, and Stack memory, see Figure 7-61. These settings determine which memory is used tostore the compiled executable program. You can also specify which interface you want to use forstdio , stdin, and stderr. You can also add and configure an RTOS for your application and configurebuild options to support C++, reduced device drivers, etc.4. Select onchip_memory2 for all the memory options in the Linker Script box, as shown inFigure 7-61.128Figure 7-61 Configuring System Library Properties5.

Click OK to close the Properties for hello_world_0_syslib dialog box and return to the IDEworkbench.Note: If you make changes to the system properties you must rebuild your project. To rebuild,right-click the hello_world_0 project in the Nios II C/C++ Projects tab and select Build Project.129Chapter 8DE0DE0-Nano Demonstrations8.1 System RequirementsMake sure Quartus II and NIOS II are installed on your PC.8.2 Breathing LEDsThis demonstration shows how to use the FPGA to control the luminance of the LEDs by means ofpulse-width modulation (PWM) scheme.

The LEDs are divided into two groups, while one groupdims the other group brightens, vice versa. Users can change the PWM wave's duty ratio andfrequency to control the LED luminance and repetition rate.Figure 8-1 Shows a diagram of PWM signals to drive LED.130Figure 8-2 Pulse Width ModulationFigure 8-2 shows the relationship between duty cycle and LED luminance.Demonstration Source Code• Project directory: DE0_NANO_Default• Bit stream used: DE0_NANO.sofDemonstration Batch FileDemo Batch File Folder: DE0_NANO_Default\demo_batchThe demo batch file includes the following files:• FPGA Configure File: DE0_NANO.sofDemonstration Setup• Make sure Quartus II and Nios II are installed on your PC.• Connect USB cable to the DE0-Nano board and install the USB Blaster driver if necessary.• Execute the demo batch file “DE0_NANO.bat” under the batch file folder,DE0_NANO_ Default \demo_batch.

This will load the demo into the FPGA.1318.3 ADC ReadingThis demonstration illustrates steps which can be used to evaluate the performance of the 8-channel12-bit A/D Converter. The DC 3.3V on the 2x13 header is used to drive the analog signals and byusing a trimmer potentiometer, the voltage can be adjusted within the range of 0~3.3V. The 12-bitvoltage measurements are indicated on the 8 LEDs.

Since there are only 8 LEDs, only bit-4 throughbit-11 from the ADC are represented on the LEDs.Design ConceptThis section describes the design concepts for this demo. Figure 8-3 shows the block diagram.Figure 8-3 ADC Reading Block DiagramThe ADC Controller reads the voltage from the A/D converter through a serial interface anddisplays its measurement on the LEDs. The on-board dip-switch determines which channel to readfrom. Table 8-1 lists the DIP Switch settings and its corresponding ADC channel.132Table 8-1DIP Switch SettingsDIP Switch (SW1) SettingADC Channel0000Analog_In00001Analog_In10010Analog_In20011Analog_In30100Analog_In40101Analog_In50110Analog_In60111Analog_In7Figure 8-4 depicts the pin arrangement of the 2X13 header.

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
5259
Авторов
на СтудИзбе
420
Средний доход
с одного платного файла
Обучение Подробнее