Hello,
I use PIC18F67K2 microcontroller. Can you tell the library MMC_FAT_16 to use a specific SPI interface, provided that use both and initialize both interfaces. SD card is connected to SPI1 and order
Init_SPI2
Init_SPI1
everything works, but can be specified explicitly.
The same applies for the RS485 library when used both UART interface.
Hristo
MMC_Fat_16 library and two SPI interfaces
- darko.minic
- Posts: 747
- Joined: 01 Dec 2014 11:10
Re: MMC_Fat_16 library and two SPI interfaces
Hi,
If I understand you correctly you can initialize MMC_FAT_16 to use a specific SPI interface:
For example:
For more information please refer help from our compiler:
mikroPascal PRO for PIC Libraries > Hardware Libraries > Multi Media Card Library
Regards,
Darko
If I understand you correctly you can initialize MMC_FAT_16 to use a specific SPI interface:
For example:
Code: Select all
// MMC module connections
var Mmc_Chip_Select : sbit at RC0_bit;
var Mmc_Chip_Select_Direction : sbit at TRISC0_bit;
// MMC module connections
error = Mmc_Init(); // Init with CS line at RC.0
var i : byte;
...
SPI1_Init();
i = Mmc_Init();
mikroPascal PRO for PIC Libraries > Hardware Libraries > Multi Media Card Library
Regards,
Darko
Re: MMC_Fat_16 library and two SPI interfaces
Hello Darko,
When you initialize the two SPI interfaces in the following order
Mmc_Chip_Select : sbit at LATB5_bit;
Mmc_Chip_Select_Direction : sbit at TRISB5_bit;
SPI2_Init;
SPI1_Init;
error := MMC_Fat_Init;
everything works normally.
When you initialize the two SPI interfaces in the following order
Mmc_Chip_Select : sbit at LATB5_bit;
Mmc_Chip_Select_Direction : sbit at TRISB5_bit;
SPI1_Init;
SPI2_Init;
error := MMC_Fat_Init;
procedure using predefined MMC_Chip_Select, but trying to work with SPI2.
My question to the developers - can you tell the procedure MMC_Fat_Init which interface to use and it does not depend on the order of initialization of the interfaces.
Please do not propose to read HELP, because there is no such thing.
Best regards,
Hristo
When you initialize the two SPI interfaces in the following order
Mmc_Chip_Select : sbit at LATB5_bit;
Mmc_Chip_Select_Direction : sbit at TRISB5_bit;
SPI2_Init;
SPI1_Init;
error := MMC_Fat_Init;
everything works normally.
When you initialize the two SPI interfaces in the following order
Mmc_Chip_Select : sbit at LATB5_bit;
Mmc_Chip_Select_Direction : sbit at TRISB5_bit;
SPI1_Init;
SPI2_Init;
error := MMC_Fat_Init;
procedure using predefined MMC_Chip_Select, but trying to work with SPI2.
My question to the developers - can you tell the procedure MMC_Fat_Init which interface to use and it does not depend on the order of initialization of the interfaces.
Please do not propose to read HELP, because there is no such thing.
Best regards,
Hristo
Re: MMC_Fat_16 library and two SPI interfaces
Use SPI_Set_Active before MMC_Fat_Init.
Regards
Regards
Re: MMC_Fat_16 library and two SPI interfaces
Thank you, aCkO
This is OK.
Best regards,
Hristo
This is OK.
Best regards,
Hristo