Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Question for SPI

Altera_Forum
Honored Contributor II
847 Views

Hello! Please tell me how to check the status of the pin MISO. 

 

 

 

unsigned long int Get7794_Data(alt_u8 channel) 

unsigned long int data; 

alt_u8 cfg_reg; 

 

 

cfg_reg = (channel-1)&0xFF; 

 

 

spi_select_slave(0x21000,0); 

 

 

spi_send(0x21000,0x10); 

spi_send(0x21000,0x00); 

spi_send(0x21000,cfg_reg); 

//---------------- 

// ????????? DOUT/RDY - the line goes low when a new data-word is available in the output register 

//---------------- 

spi_send(0x21000,0x58); 

data = (unsigned)(spi_send(0x21000,0x58)) << 16; 

data |= (unsigned)(spi_send(0x21000,0x58)) << 8; 

data |= (unsigned)(spi_send(0x21000,0x00)); 

spi_deselect_slave(0x21000,0); 

return data; 

}
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
89 Views

One way is to add a PIO peripheral with an input connected to the MISO pin and monitor that directly. 

 

The code you pasted is just showing (normal) byte-wise access of the peripheral so there is no direct way to poll the MISO pin status.
Altera_Forum
Honored Contributor II
89 Views

Thanks for the reply!

Reply