AnsweredAssumed Answered

Modify SPI register

Question asked by on Nov 27, 2017
Latest reply on Dec 8, 2017 by Vyacheslav Azarov

Hello Everyone,


I am working on the STM8AL3166 and try modify the SPI register. 

My simple code is as below :

int main() {

   SPI_CR1 |= 0b00100100;      /* Configure as master and 500 kHz com speed


As read in the datasheet, I made a library.h with the correct address :

#define SPI_CR1 *(unsigned char*) 0x5200       //SPI Control Register 1   


But when I go in the debug session, the register does not change his value after executing the instruction



Is someone has encountered this problem? When I do the same for GPIO port A for instance, I have no problem.

May I am missing one configuration somewhere?


Please help.

Thank you for your time,