Re: TPU TCR2 Test
Eric McRae <[email protected]> Wed, 05 Jul 2006 10:58:31 -0700
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
Hi Joy,
Some of your description may have gotten confused in translation. From
what I read, it seems like the function's purpose is to determine the
state of the T2CLK input. Is the hardware already implemented? If not,
just route that signal to a TPU input pin and read it directly. If the
hardware is already fixed, than your approach is basically good.
I think you are using RWTPIN as the reporting mechanism but if you are
writing your own microcode, it is very easy to drive any channel pin
directly. Your (TPU) initialization code will have to configure the
desired channel as an output, then you can just do "au chan_reg := X.
chan pin := X."
The HSR bits are cleared by the TPU when the function starts running the
associated entry point. If you don't wait for them to clear back to
zero, you have no guarantee that the function ran the original HSR.
joydeep roy wrote:
>
> 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
>
--
Eric McRae, Electro-Logic Machines, Inc.
511 Root St., Port Townsend WA, 98368
Phone/Fax: 360.379.0969, http://www.elmi.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
Great things are happening at Yahoo! Groups. See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/dN_tlB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------------
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/