TPU TCR2 Test

joydeep roy <[email protected]> Wed, 5 Jul 2006 01:52:05 -0700 (PDT)
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
Hi all,

i am writing a function. 
When this function is called, the external T2CLK pin
on the respective TPU module (B or C) shall be set to
function as a gate of the DIV8 clock. Before and while
the function is called, it is expected that the test
board will supply the respective T2CLK pin with a
constant high or low voltage input. According to the
MPC565 Reference Manual, when the T2CLK pin is high,
TCR2 is incremented at the DIV8 clock frequency. When
it is low, the DIV8 clock is blocked prevented from
incrementing TCR2. 

After this function is called and the TCR2 prescaler
control settings are made, the value of TCR2 for the
respective TPU shall be read. A brief delay later,
that gives the TCR2 count value sufficient time to
increment in case a changing clock signal is the
source, TCR2 shall be read again. If there is no
change in the readings, then the function shall
transmit "0\n". If TCR2 has incremented due to the
clock source, then the function shall transmit "1\n". 

i am using the RWTPIN function for this.i am also
setting the ETBANK bit in TPUMCR2. 

i am first setting the bit for T2CG. Then i am
disabling the channel 0 of the module and then setting
the RWTPIN function no. 
Then i am waiting for the hsr bits to become 00 and
then writing hsr = 01.for that channel.Then i am
finally enabling the channel. 

I am then reading the TCR2 parameter from the PRAM and
after a breief delay again reading it and then
comparing the two values for my response. 
Since i have to revert back to the initial settings, i
am clearing the T2CG bit, disabling the channel and
setting function no to RESET value. 

Do i need to do anything else for my requirement? 

Do we always have to wait for the hsr bits to become
00 before changing them? 

Can we use any channel for RWTPIN function here as we
just want to read the TCR2 value? 

What should we write in the CHAN_CNTRL parameter for
RWTPIN function? 

i couldnt find the answers in the User Manual. 

Any help is appreciated.
Thanks and regards,
Joy

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/