how to read a word in one clock cycle

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to read a word in one clock cycle

1,207 Views
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?
Labels (1)
0 Kudos
1 Reply

327 Views
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 Kudos