MC9S08LG32 cannot change register value

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC9S08LG32 cannot change register value

944 次查看
navry
Contributor I

Hello everyone

 

I'm trayin setup SPI on MCU MC9S08LG16 and i cannot set any register from SPI registers. When i setting SPIC1 value to 0xD0 by code, nothing change. SPIC1 have 0x04 from begin program. When i traying change this value in debug mode in memory window or in register map, not work it. After hit on enter value stay on 0x04.

 

I use Codewarrior 6.1.

Please, can you help my anybody to explain this problem?

 

Thank you very much.

标签 (1)
0 项奖励
回复
3 回复数

640 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Michal Navratil:

Your question is in general space with very low visibility. Please move it to Classic/Legacy CodeWarrior to gain more attention.

About posting in the right place, check the next document by colleague Denisse: Where to post a Discussion?

Regards!

Jorge Gonzalez

0 项奖励
回复

640 次查看
navry
Contributor I

Hi Jorge Gonzalez

Thanks for the warning. A did it now :smileyhappy:

Greeting

Michal Navratil

0 项奖励
回复

640 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

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!

-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复