Nios ii--Experiment 3--led 100M software section

Source: Internet
Author: User

Software development

Referring to experiment two (LED), this experiment and experiment two (LED) difference is that the system clock from 50M to become 100M. Run the result, output hello from Nios ii! in the Debug window, and the four LED lights on the board flow display, indicating the test was successful! This experiment confirmed that the board support Operation frequency is high enough to reach 100M.

Experiment Code

/*

* "Hello World" example.

*

* This example prints ' Hello from Nios II ' to the STDOUT stream. It runs on

* The Nios II ' standard ', ' full_featured ', ' fast ', and ' low_cost ' example

* Designs. It runs with or without the microc/os-ii RTOS and requires a STDOUT

* Device in your system ' s hardware.

* The memory footprint of this hosted application are ~69 Kbytes by default

* Using the standard reference design.

*

* For a reduced footprint version of the This template, and the explanation of how

* To reduce the memory footprint-a given application, see the

* "Small_hello_world" template.

*

*/

#include "system.h"

#include "Altera_avalon_pio_regs.h"

#include <stdio.h>

#include <unistd.h>

int Main ()

{

int I ;

printf ("Hello from Nios ii!\n");

while (1)

{

For ( I=0;I<4;I++)

{

IOWR _altera_avalon_pio_data ( led_pio_base , 1 << i );

Usleep (1000000); //each one 0.5s delay

}

}

return0;

}

?

Nios ii--Experiment 3--led 100M software section

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.