Trying to run Nios LED code ?

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Visit site
Activity points
9,442
Guys,

I tried to run a code on NIOS,

Here's the log :
Code:
Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Resetting and pausing target processor: OK
Reading System ID at address 0x00001810: 
    ID value verified
    Timestamp value was not verified: value was not specified
Initializing CPU cache (if present)
OK

Downloading 04000020 ( 0%)
Downloaded 62KB in 2.6s (23.8KB/s)

Verifying 04000020 ( 0%)
Verified OK                         
Starting processor at address 0x040001B4

but I didn't see any response on the board, anything missing here ?

Thanks

the code :

Code:
#include <io.h>
#include <unistd.h>
#include <system.h>
#include "altera_avalon_pio_regs.h"

#include <stdio.h>
#define msleep(ms)  usleep(1000*ms)
#define DIRECTION_PA(data)  IOWR_ALTERA_AVALON_PIO_DIRECTION(LED_BASE, data)
#define DATA_PA(data)  IOWR_ALTERA_AVALON_PIO_DATA(LED_BASE, data)

int main()
{   printf("hello world");
    DIRECTION_PA(0xFF);
    alt_u8 tmp = 0X01;
    unsigned char i;
    printf("hello");
    while(1)
    {   tmp = 0X01;
        for(i=0;i<4;i++)
        {
        DATA_PA(tmp);
        tmp=tmp<<1;
        msleep(50);
        };
    }

    return 0;
}

- - - Updated - - -

How can I save NIOS code into EPCS16, everytime power supply is gone, I need to burn NIOS again from Quartus II programmer ???
 

You really need to learn how to go about debugging something. Did you every try setting the LEDs permanently first?

As written the LEDs are going to be dim as you have them cycling on for 50ms out of 200ms.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…