I am using for the time LDD Components. For SPIMaster_LDD Component , I
am getting the following Issue. Could somebody help. Thank you.
Issue :
SPI-SIN directly connected to SPI_SOUT. NO signal on this
commun pin.
Samething
if open, or connected to a slave SPI terminal
Signal = SPI_PCS : Ok One negative gate
Signal = SPI_SCK : OK 2 time 8 clocks
Schematic :
MKV10Z32LC7
Pins directly connected
SPI_PCS : PTC4
SPI_SCK: PTC5
SPI_SOUT : PTC6
SPI_SIN : PTC7
Emulator :
PE MICRO MULTILINK UNIVERSAL
Software :Kinetis
Design Studio 3.0.0 IDE Components
BitIO_LDD Component : working fine
ADC_LDD Component : working fine
SPIMaster_LDD Component
Detail Software SPIMaster
//Main
//Variables
SPI
LDD_TDeviceData*Pointeur_SPI_KV10;
volatileLDD_SPIMASTER_TError ComError = 0U;
volatile bool DrapeauEnvoiSPIkv10 = FALSE;
/*lint
-save -e970 Disable MISRA rule (6.3) checking. */
int
main(void)
/*lint
-restore Enable MISRA rule (6.3) checking. */
{
/*
Write your local variable definition here */
/***
Processor Expert internal initialization. DON'T REMOVE THIS CODE!!!
***/
PE_low_level_init();
Pointeur_SPI_KV10
= SPI_KV10_Init(NULL);
for(;;)
{
DrapeauEnvoiSPIkv10 = FALSE;
#defineBLOCK_SIZE 2
uint8 Donnees_Sortie[2]="12";
Erreur= SPI_KV10_SendBlock(Pointeur_SPI_KV10, Donnees_Sortie, BLOCK_SIZE);
while (!DrapeauEnvoiSPIkv10) {};
}
//end for(;;)
//Events.c
/*
===================================================================*/
void
SPI_KV10_OnBlockSent(LDD_TUserData*UserDataPtr)
{DrapeauEnvoiSPIkv10 = TRUE; /* Set Data Sent flag */
}
void
SPI_KV10_OnError(LDD_TUserData*UserDataPtr)
{
Erreur = SPI_KV10_GetError(Pointeur_SPI_KV10, (LDD_SPIMASTER_TError*)&ComError);
}
Hi
The MKV10Z32LC7 product PTC6 and PTC7 pins are true open drain pins. These pins cannot drive a logic one without a pull-up resistor.
So, customer need to use external pull-up resistor (typical 10Kohm) connect with PTC6 and PTC7, if using both pins as SPI function.
Wish it helps.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------