Altera_Forum
Honored Contributor
16 years agoHow do I make the SD card IP core work?
Hi,
I'm trying to use the new Altera UP SD card IP core on my DE2 board, but having some problems. Has anyone got it working yet? I've installed the University Program package (altera_upds_setup.exe) along with Quartus and Nios 9.0 on my PC. Then I created a SoPC with the new SD card IP core in it and wired them up. (Nios CPU, On-chip mem, SDRAM, PLL, JTAG UART, LED RED, Altera_UP_SD) Then in Nios, I run something similar to the code in the documentation. I can see the correct 390KHz clock output using an oscilloscope, but it never reports that my card is inserted. Can anyone help me?int main()
{
unsigned int *aux_status_register = ((unsigned int *)(ALTERA_UP_SD_BASE + 564));
unsigned int status;
printf("Hello from Nios II!\n");
printf("Address of aux_status_register: 0x%08x\n", (unsigned int) aux_status_register);
do { // wait for SD card to be inserted
status = *aux_status_register;
printf("%d %d\n", status, *aux_status_register);
*LED_RED = status; // display status on the board
} while ((status & 0x02) == 0);
printf("SD card inserted.\n");
return 0;
}