I'm using a PIC24FJ256GA108 with 3 SPI buses, on one of them an SD card. I'm not quite clear how I can 'attach' the MMC functions to a specific SPI bus.
Now it seems to be dependant on the initialization sequence of the ports. Last initialized SPI bus gets the MMC functions and SD card.
That's not workable. The SPI buses often get re-initialized, and then the SD card suddenly moves to another bus. (on which it's not connected)
How do I make a fixed connection between SD card/MMC functions and an SPI bus?
For now it seems fuzzy logic. The SD card is randomly connected to one f the three SPI buses. Not very useful at all...
Mmc_Init() and SPI port
Mmc_Init() and SPI port
Regards,
Peter.
Peter.
- dusan.poluga
- mikroElektronika team
- Posts: 780
- Joined: 02 Feb 2017 14:21
Re: Mmc_Init() and SPI port
Hi,
MMC library uses the SPI interface that is last initialized.
Regards,
MMC library uses the SPI interface that is last initialized.
Regards,
Dusan Poluga.
Re: Mmc_Init() and SPI port
After using MMC_Init(), will it keep using that SPI port? It must be possible to use a fixed port for MMC.
This 'Russian roulette' isn't very useful...
This 'Russian roulette' isn't very useful...
Regards,
Peter.
Peter.
- dusan.poluga
- mikroElektronika team
- Posts: 780
- Joined: 02 Feb 2017 14:21
Re: Mmc_Init() and SPI port
Hi,
When you call for example SPI1_Init(); and then after that MMC_Init(); MMC function should grab pointers from that spi.
After that it should remain on that spi interface. You can then initialize rest of the spi interfaces.
If you do something like this:
The MMC_Init(); will grab the last spi interface that was initialized. So instead of having it on SPI1 you will have it initialized for SPI3.
Regards,
When you call for example SPI1_Init(); and then after that MMC_Init(); MMC function should grab pointers from that spi.
After that it should remain on that spi interface. You can then initialize rest of the spi interfaces.
If you do something like this:
Code: Select all
SPI1_Init();
MMC_Init();
SPI2_Init();
SPI3_Init();
MMC_Init();
Regards,
Dusan Poluga.