Hi Michal Navrátil,
Maybe the SPI registers cannot be set because the Bus clock to the SPI module was not enabled, please try to enable it with the next instruction and then try to set the SPI registers:
SCGC2_SPI =1; // This bit controls the clock gate to the SPI module
You can find more information about the System Clock Gating Control 2 Register (SCGC2) on the page 91 of the User Manual:
http://cache.freescale.com/files/microcontrollers/doc/ref_manual/MC9S08LG32RM.pdf
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------