Re: TPU Problem

Eric McRae <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
Your link code (which is commented out) is running on channel 1 and is 
also asserting a link to channel 1 so be careful if you enable that.

I think you may also be leaving yourself open to a match occurring due 
to whatever hardware state existed before starting this function.  If a 
match does occur, the TPU will spin on calling TRANS_MES since MRL is 
not negated there.  Still, that shouldn't prevent channel 0 from running.

BTW, zeroing the priority of a function only prevents it from starting 
but will not stop a function if it happens to already be running.

It looks like your transition detection function shouldn't run forever.  
My first suspicion is that the configuration registers aren't set up 
correctly for channel 1.  Typically, the only way a normally running 
channel ceases to function is when a function on another channel 
clobbers the normal channel's data or that other function never releases 
the TPU Engine by hitting an end instruction.  You don't show 
END_OF_LINK but I presume it is a "chan neg_lsl; end"  Take a look at 
the scheduler registers if you can they may tell you something.

spw_lotus wrote:

> Hi All
>
> I am having problems testing out a few VERY basic TPU functions on my
> MPC555. I have written 2 custom TPU functions but whenever I enable
> the channel running my second function the whole TPU appears
> to 'hang'.
>
> My first function is a simple square wave generator and this works
> fine. My second function was to be a channel that detected any
> transition in the input pin and then link to another channel to carry
> out some other function. But I have not got that far yet!
>
> I have assigned my square wave function (function 14) to channel 0
> and set this as high priority. I then assigned my transition detect
> function (function 15) to channel 1, however as soon as I enable the
> channel 1 by setting it's priority to high (I have also tried low)
> then my square wave function on channel 0 no longer outputs a square
> wave. Even if I then subsequently disable channel 1 by setting
> priority to 0, the channel 0 function still does not work.
>
> I have run both functions on the Ashware simulator and they both run
> with no problems.
>
> Note that I am running the TPU3 in TPU1 mode.
>
> I am sure I am doing something very silly but I am new to this stuff
> and I just can't see what!
>
> Below I copy my code for function that 'hangs' the tpu. I hope you
> can help me solve this.
>
> Many thanks
>
> Steve
>
> CODE FOLLOWS:
>
> %macro MSR_PERIOD      'prm3'.
>
> %entry name = INIT_MES; start_address *; disable_match;
> cond hsr1=1, hsr0=1, lsr=x, m/tsr=x, pin=x, flag0=x.
>
>       chan      TBS := in_m1_c1,
>                   PAC := any_trans,
>                   enable_mtsr.
>       chan      neg_mrl, neg_tdl, neg_lsl;
>                   end.
>
> %entry name = TRANS_MES; start_address *; disable_match;
> cond hsr1=0, hsr0=0, m/tsr=1, lsr=x, pin=x, flag0=x;
> ram p <- @MSR_PERIOD.
>
>       au             diob := ert;
>       chan      neg_tdl;
> (*      ram            diob -> @MSR_PERIOD;*)
> (*      au            link := #$10;*)
>             end.
>
> (*********************************************************************
> *)
> (* UNUSED ENTRIES  - execute an end       1 & 2 were
> END_OF_PHASE                            *)
> (*********************************************************************
> *)
> %entry  name = MESSAGE_UNUSED;
>       start_address END_OF_LINK;
>       cond hsr1 = 0, hsr0 = 1,lsr=x, m/tsr=x, pin=x, flag0=x.
>
> %entry  name = MESSAGE_UNUSED;
>       start_address END_OF_LINK;
>       cond hsr1 = 1, hsr0 = 0, lsr=x, m/tsr=x, pin=x, flag0=x.
>
> %entry  name = MESSAGE_UNUSED;
>       start_address END_OF_LINK;
>       cond hsr1 = 0,hsr0 = 0,m/tsr = 0,lsr =1, pin=x, flag0=x.
>
>
>
>
>
>
> -----------------------------------------------------------
> 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]
>       <mailto:[email protected]?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>

-- 
Eric McRae, Electro-Logic Machines, Inc.
511 Root St., Port Townsend WA, 98368
Phone/Fax: 360.379.0969, http://www.elmi.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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.