- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I'm configuring a Cyclone IV E over serial interface with a rbf file that I have stored in my MCU's flash memory. It was working fine till I replaced the rbf for a new version (larger). Now the INIT_DONE pin of the fpga won't go high. I have no idea why. It there some sort of a example code how to configure these devices over serial interface? Here's the code that I'm using. It seems to comply with the documentation. Or what could be wrong with it? Thanks for any suggestions.void fpgaConfig(void){
int i;
int length;
uint16_t temp;
spiDAT1_t dataConfig;
uint32 PC0Backup;
gioSetBit(spiPORT1, SPI_PIN_SOMI, 0); // nConfig low
delay(0xffff); // wait
gioSetBit(spiPORT1, SPI_PIN_SOMI, 1); // nConfig high
while(gioGetBit(spiPORT1, SPI_PIN_ENA) == 0); // wait until nStatus is high
PC0Backup = spiREG1->PC0;
spiSetFunctional(spiREG1, PC0Backup | (1U << SPI_PIN_SOMI)); // set nCONFIG as SPI pin
dataConfig.CSNR = 0;
dataConfig.CS_HOLD = 0;
dataConfig.DFSEL = SPI_FMT_0;
dataConfig.WDEL = 0;
length = sizeof(designData);
for(i = 0; i < length; i++)
{
temp = designData;
spiTransmitData(spiREG1, &dataConfig, 1, &temp);
}
delay(0xfffff); // wait
while(gioGetBit(spiPORT2, SPI_PIN_CLK) == 0); // wait until CONF_DONE is high
while(gioGetBit(gioPORTB, 7) == 0); // wait until INIT_DONE is high
spiSetFunctional(spiREG1, PC0Backup); // put back the original value. This is important to make reconfiguration possible
}
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you give a number of extra clocks after all configuration data has been clocked in? I usually add 64 (or so) dummy configuration clocks with 'dummy' data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So it's turned out to be an error in the Device settings. The original project had different settings than the new one. It's working now again. Thanks
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page