how to read a word in one clock cycle

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

how to read a word in one clock cycle

1,636 次查看
yklein
Contributor I
Hi,

I'm using MC9S12DP256, and in the Freescale manual it says when using PACA (16-bit pulse accumulator) "Full count register access should take place in one clock cycle. A
separate read/write for high byte and low byte will give a different result
than accessing them as a word."

My question is what's the command in C to read the word in one clock cycle?
标签 (1)
0 项奖励
回复
1 回复

756 次查看
Lundin
Senior Contributor IV
In your register map, the timer registers should be defined as

volatile unsigned int TC0;

Which will solve the problem.

If you don't have a proper register map, you would have to do something like:

#define TC0 (*(volatile unsigned int*)0x0050)
0 项奖励
回复