I've a problem with the expert code generator and SPI, I've setted SM1 SyncroMaster in this way:
My problem is that I don't see any event triggerd or any output on the pins (SCK, MOSI, MISO) and I am using for testing:
SM1_SendChar(0); // Send zero
After 8 bit the senChar() function reply with ERR_TXFULL error. So No data is trasferred from the TX buffer.
There is something wrong in my settings?
I think I find the problem: if I enable Interrupt service, the output doesn't works and no event (or SM1 interruput) is triggered.
There is a way to fix it? Or only by registers?
I recommend you a few options: disable interrupts for the SM1 component or you can look at the S12ZVC SPI example (attached) which uses the different PE component or you can write your own code.
Also, I would like to mention that the PE is not already supported and it won't be fixed.
Let me explain the behavior of SM1 component:
When you enable interrupt in SM1 component the Processor Expert generates SM1_SendChar() function where is set the SerFlag. But this flag is cleared only in the ISR(SM1_Interrupt) routine. This interrupt is generated when the SPI Transmit Empty Interrupt Flag (SPTEF) is set.
So, in the case, the SPI Transmit Interrupt is disabled (SPTIE), you will always get the ERR_TXFULL because the SerFlag is not cleared anymore.
In case, the SPI Transmit Interrupt is enabled (SPTIE), it will always go to the ISR(SM1_Interrupt) routine (whenever the data register is empty and ready to accept new data). Therefore, SPTIE should be disabled in the ISR(SM1_Interrupt), but we cannot change the generated code. So, that is why it is working only when you disable SPI interrupt.
I hope it helps.