OK, I'm still playing with various TFT displays (at this exact moment an ST7735 128x160 one), along with the SD card slot mounted on the display, using a PIC 24FJ64GA002.
It was all working happily, displaying BMP pictures from SD card to the TFT, but I'd basically just 'thrown values' at the SPI prescalers.
So as the FatFs files I'm using specify that the startup for SD cards should only be 100Khz to 400Khz, I thought I'd check it - so I stuck a veropin on the clock line, and clipped my scope to it. I was surprised to find it was running at 16MHz at all times, and that my clock speed switching routine didn't appear to be working - so I modified that so it did, but as I was only changing the secondary prescaler, it wouldn't go below 2MHz anyway. So more mods, and I now specify both secondary and primary prescalers in my speed change routine, 5 and 1 give 333KHz for the SD card start, and 6 and 3 give 8MHz afterwards.
My reason for this post is to query the maximum SPI speed, as it works perfectly at 16MHz - even the SD startup, but I'm using a modern micro-SD card, which perhaps doesn't need the slow startup?. But the 24F datasheet says that 16MHz is 'invalid', as shown below - so is 16MHz above the maximum guaranteed speed for SPI devices?, and presumably not a limitation of the PIC?.
I'm running at 8MHz at the moment, as moving to 16MHz seems to make little speed difference, presumably the limiting factor is the 'de-optimised' free version of the XC16 compiler?.
It was all working happily, displaying BMP pictures from SD card to the TFT, but I'd basically just 'thrown values' at the SPI prescalers.
So as the FatFs files I'm using specify that the startup for SD cards should only be 100Khz to 400Khz, I thought I'd check it - so I stuck a veropin on the clock line, and clipped my scope to it. I was surprised to find it was running at 16MHz at all times, and that my clock speed switching routine didn't appear to be working - so I modified that so it did, but as I was only changing the secondary prescaler, it wouldn't go below 2MHz anyway. So more mods, and I now specify both secondary and primary prescalers in my speed change routine, 5 and 1 give 333KHz for the SD card start, and 6 and 3 give 8MHz afterwards.
My reason for this post is to query the maximum SPI speed, as it works perfectly at 16MHz - even the SD startup, but I'm using a modern micro-SD card, which perhaps doesn't need the slow startup?. But the 24F datasheet says that 16MHz is 'invalid', as shown below - so is 16MHz above the maximum guaranteed speed for SPI devices?, and presumably not a limitation of the PIC?.
I'm running at 8MHz at the moment, as moving to 16MHz seems to make little speed difference, presumably the limiting factor is the 'de-optimised' free version of the XC16 compiler?.