Yahoo Groups archive

68300

Index last updated: 2026-04-29 00:01 UTC

Thread

TPU problems

TPU problems

2002-05-08 by Roy

Hi all

I am having nightmares getting the TPU to function.

In my current project I am running a 68376 at 25 Mhz,
   W = 1, X = 1 & Y = 24.

From this I have worked out that the TPU TCR1
frequency will be 6.3 Mhz if PSCK = 1 & TCR1 = 1,
giving me a Period of 160 Ns.

The TPU functions I am running are ITC channel 0, PMA
channel 1 and PSP on channels 2,3,4,5,6 & 7.

In my application I have 12 teeth on a sensor wheel
which equates to a spacing of 30\ufffd and at 500 RPM
which is the lowest rotational speed the time between
teeth is 10 Ms.

This gives 62,500 TCR1 counts between teeth, ( 10 Ms /
160Ns ).

Now the Motorola literature states that the TPU
measures this period to a 23 bit resolution,
so is the max count 65,536 or 8,388,608 ?

If it is 23 bit then why only pass a 16 bit parameter
" PERIOD LOW WORD " to functions runing PSP ?

My other question is the ERROR bit in the PMA
function, what is it's address ?  All other parameters
have
the format of 00FFFF channel number parameter number,
in my application I have taken it as being FFFF16.

All suggestions and advice welcomed

            thanks Roy




__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

RE: [68300] TPU problems

2002-05-08 by Melear Charles-rdph40

Now Roy,

I think you should be a little more careful here.  In the last line of your email, you said that any advice would be welcome.

That sure opens a fairly wide window.

Yes, indeed, when you are running the PMM/PMA - PSP - ITC function, you only pass a 24 bit parameter.  There is PPWA_Lower_Word and PPWA_Upper_Byte.  You DO NOT get 32-bit resolution here, you get 24-bit resolution.

I know a guy that has written a fairly good algorithm on the missing / additional tooth and I can turn you on to him if you like.

Regards,

Charlie
Show quoted textHide quoted text
-----Original Message-----
From: Roy [mailto:spectric@...]
Sent: Wednesday, May 08, 2002 6:02 AM
To: 68300@yahoogroups.com
Subject: [68300] TPU problems



Hi all

I am having nightmares getting the TPU to function.

In my current project I am running a 68376 at 25 Mhz,
   W = 1, X = 1 & Y = 24.

From this I have worked out that the TPU TCR1
frequency will be 6.3 Mhz if PSCK = 1 & TCR1 = 1,
giving me a Period of 160 Ns.

The TPU functions I am running are ITC channel 0, PMA
channel 1 and PSP on channels 2,3,4,5,6 & 7.

In my application I have 12 teeth on a sensor wheel
which equates to a spacing of 30? and at 500 RPM
which is the lowest rotational speed the time between
teeth is 10 Ms.

This gives 62,500 TCR1 counts between teeth, ( 10 Ms /
160Ns ).

Now the Motorola literature states that the TPU
measures this period to a 23 bit resolution,
so is the max count 65,536 or 8,388,608 ?

If it is 23 bit then why only pass a 16 bit parameter
" PERIOD LOW WORD " to functions runing PSP ?

My other question is the ERROR bit in the PMA
function, what is it's address ?  All other parameters
have
the format of 00FFFF channel number parameter number,
in my application I have taken it as being FFFF16.

All suggestions and advice welcomed

            thanks Roy




__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com


---------------------------------------------------
To unsubscribe from this group, send an email to:
68300-unsubscribe@yahoogroups.com

To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu

 

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

Re: [68300] TPU problems

2002-05-08 by John Donoghue

Melear Charles-rdph40 wrote:

> Now Roy,
>
> I think you should be a little more careful here.  In the last line of your email, you said that any advice would be welcome.
>
> That sure opens a fairly wide window.
>
> Yes, indeed, when you are running the PMM/PMA - PSP - ITC function, you only pass a 24 bit parameter.  There is PPWA_Lower_Word and PPWA_Upper_Byte.  You DO NOT get 32-bit resolution here, you get 24-bit resolution.
>
> I know a guy that has written a fairly good algorithm on the missing / additional tooth and I can turn you on to him if you like.
>
> Regards,
>
> Charlie
>
> -----Original Message-----
> From: Roy [mailto:spectric@...]
> Sent: Wednesday, May 08, 2002 6:02 AM
> To: 68300@yahoogroups.com
> Subject: [68300] TPU problems
>
> Hi all
>
> I am having nightmares getting the TPU to function.
>
> In my current project I am running a 68376 at 25 Mhz,
>    W = 1, X = 1 & Y = 24.
>
> >From this I have worked out that the TPU TCR1
> frequency will be 6.3 Mhz if PSCK = 1 & TCR1 = 1,
> giving me a Period of 160 Ns.
>
> The TPU functions I am running are ITC channel 0, PMA
> channel 1 and PSP on channels 2,3,4,5,6 & 7.
>
> In my application I have 12 teeth on a sensor wheel
> which equates to a spacing of 30? and at 500 RPM
> which is the lowest rotational speed the time between
> teeth is 10 Ms.
>
> This gives 62,500 TCR1 counts between teeth, ( 10 Ms /
> 160Ns ).
>
> Now the Motorola literature states that the TPU
> measures this period to a 23 bit resolution,
> so is the max count 65,536 or 8,388,608 ?
>
> If it is 23 bit then why only pass a 16 bit parameter
> " PERIOD LOW WORD " to functions runing PSP ?
>
> My other question is the ERROR bit in the PMA
> function, what is it's address ?  All other parameters
> have
> the format of 00FFFF channel number parameter number,
> in my application I have taken it as being FFFF16.
>
> All suggestions and advice welcomed
>
>             thanks Roy
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
>
> ---------------------------------------------------
> To unsubscribe from this group, send an email to:
> 68300-unsubscribe@yahoogroups.com
>
> To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
> ---------------------------------------------------
> To unsubscribe from this group, send an email to:
> 68300-unsubscribe@yahoogroups.com
>
> To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

From what I can see, this group move to Yahoo has been a success. I didn't get any spam, and aside from the new E-mail address, it's the same.

John Donoghue
jdsb@...

The TPU

2002-07-08 by Roy

Hi all

Has anybody succeeded in getting the ITC, PMA and PSP
functions working ?

I have drawn a blank and have spent far to long
checking code and trying possible fixes without
success and it seems this list has shrunk, either due
to the move over to Yahoo or I suspect the TPU has
driven them to insanity.

I got the CTM module running with no hassle and the
QADC but not the TPU.  Is there a known problem with
the microcode for these functions.

              thanks Roy




__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

Re: The TPU

2002-07-09 by scandle34

I used the TPU2 in the '916Y3.
I nearly went batty because the chip I was using had a defective TPU!
Here is a square wave function with some testing code added.
Besides toggling pins, this also periodically places numbers in 
unused prm locations, so there are footprints of TPU execution when 
you pause the MCU in BDM mode...

I can also post the '916Y3 initialization code if it will help.


(*********************************************************************
*)
(* TPUawdt.UC                                                         
*)
(* Master file for awdt 916y3 eprom.                                  
*)
(* *** MUST be /srectype 2 for PEMICRO programmer!                    
*)
(*********************************************************************
*)
%type tpu2,512.
%org 0.

End_of_phase:                    end.
End_of_link:     chan neg_lsl;   end.
(*********************************************************************
*)
(* Function:    SQW2 -   SQUARE WAVE                                  
*)
(* Creation Date: 26/Sep/01                 From: SQW                 
*)
(* Author:  Jeffrey C. Andle                                          
*)
(* Description:                                                       
*)
(* ------------                                                       
*)
(* SQW2 produces a continuous wave after initialization. The   	      
*)
(* user chooses the period by writing the parameters HIGH_TIME        
*)
(* and LOW_TIME in ram as prm0 and prm1.                              
*)
(* (High time and low time are NOT the same.)                         
*)
(* HIGH_TIME must be between $0000-$8000.                             
*)
(*                                                                    
*)
(* Updates:   By:   Modification:                                     
*)
(* --------   ---   -------------                                     
*)
(*--------------------------------------------------------------------
*)
(* Standard Exits Used:-   End_Of_Phase: N         End_Of_Link: Y     
*)
(* External Files included: NONE                                      
*)
(* CODE SIZE excluding standard exits = 1? LONG WORDS                 
*)
(*--------------------------------------------------------------------
*)
(*********************************************************************
*)
(*()()()()()()()()()()() DATA STRUCTURE ()()()()()()()()()()()()()()()
*)
(*                                                                    
*)
(* name:               Written By:            Location  Bits:         
*)
(* -----               -----------            ---------------         
*)
(* prm0                CPU                     Parameter0  0..15      
*)
(*                                             Low time of period.    
*)
(*                                             prm0 <= $8000          
*)
(* prm1                CPU                     Parameter1  0..15      
*)
(*                                             High time of period.   
*)
(*                                             prm0 <= $8000          
*)
(* prm2                TPU                     period as verification 
*)
(*                                                                    
*)
(* hsr1   hsr0         Action                                         
*)
(* ----   ----         ------                                         
*)
(*  1       1          Initialize continuous square wave              
*)
(*                     return PERIOD                                  
*)
(*                                                                    
*)
(* Links Accepted: NO              Links Generated: NO                
*)
(*                                                                    
*)
(* Interrupts Generated After:     No interrupts generated            
*)
(*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
*)

(*====================================================================
*)
(*|||||||||||||||||||||  MICROCODE STARTS BELOW  
|||||||||||||||||||||*)
(*VVVVVVVVVVVVVVVVVVVVV--------------------------
VVVVVVVVVVVVVVVVVVVVV*)

(*********************************************************************
*)
(* ENTRY name:  INIT_SQW                                              
*)
(* STATE(S) ENTERED: S1                                               
*)
(* PRELOAD PARAMETER : prm1                                           
*)
(* ENTER WHEN : HSR = %11                                             
*)
(*                                                                    
*)
(* ACTION: set time base as TCR1, set pin high, and pac to toggle     
*)
(*         pin after each match.  Write the current time + the        
*)
(*         HIGH_TIME to the mer.  Negate latches.  Enable service     
*)
(*         requests.  Write prm2 = prm0 + prm1.                       
*)
(*********************************************************************
*)
%entry name = INIT_SQW; function = $F; start_address *; disable_match;
cond hsr1=1,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <- prm1.

        chan    TBS:= out_m1_c1,         (* pin is output, use TCR1 *)
                PAC:= toggle,            (* toggle pin on match *)
                pin:= high,              (* initialize pin as high *)
                enable_mtsr.             (* enable m/tsr requests *)
					 (* format 3 command *)

	chan	match_gte.		 (* TPU2 format 5. *)


        au      ert:= tcr1+p;            (* write cur time + high 
time*)
        chan    write_mer,               (*  to mer *)
                neg_mrl,
		neg_tdl,
		neg_lsl;                (* negate latches *)
                end.                    (* end of S1 *)
				(* format 2  merges addition and 
chan*)

(*********************************************************************
*)
(* ENTRY name:  LOW_SQW                                               
*)
(* STATE(S) ENTERED: S2                                               
*)
(* PRELOAD PARAMETER : prm0                                           
*)
(* ENTER WHEN : HSR = %00 m/tsr=1 lsr=X flag0=X pin=0                 
*)
(*                                                                    
*)
(* ACTION: Write prm0 + last match time to mer, neg_mrl.              
*)
(*                                                                    
*)
(*********************************************************************
*)
%entry name = LOW_SQW; function = $F; start_address *; enable_match;
cond hsr1=0,hsr0=0,lsr=x,m/tsr=1,pin=0,flag0=x;
ram p <- prm0.

(* This code was tested and fails...*)
(* THIS entry is not called!            *)
	ram	diob <- prm1.
	au	diob := diob + p.
	ram	diob -> prm3.

        au      ert:= ert + p;           (* write last match + prm0  
*)
        chan    write_mer,               (* write to mer *)
                neg_mrl,
		neg_tdl,
		neg_lsl;     		 (* negate latches *)
                end.                     (* end of S2 *)
(*********************************************************************
*)
(* ENTRY name:  HIGH_SQW                                              
*)
(* STATE(S) ENTERED: S3                                               
*)
(* PRELOAD PARAMETER : prm1                                           
*)
(* ENTER WHEN : HSR = %00 m/tsr=1 lsr=X flag0=X pin=1                 
*)
(*                                                                    
*)
(* ACTION: Write prm1 + last match time to mer, neg_mrl.              
*)
(*                                                                    
*)
(*********************************************************************
*)
%entry name = HIGH_SQW; function = $F; start_address *; enable_match;
cond hsr1=0,hsr0=0,lsr=x,m/tsr=1,pin=1,flag0=x;
ram p <-prm1.

(* This code was tested and works...*)
(* THIS entry is called!            *)
	ram	diob <- prm0.
	au	diob := diob + p.
	ram	diob -> prm4.

        au      ert:= ert + p;           (* write last match + prm0  
*)
        chan    write_mer,               (* write to mer *)
                neg_mrl,
		neg_tdl,
		neg_lsl;                 (* negate latches *)
                end.                     (* end of S3 *)

(*********************************************************************
*)
(*                       UNUSED STATES                                
*)
(*********************************************************************
*)

%entry name = UNUSED_SQW; function = $F; start_address END_OF_LINK; 
enable_match;
cond hsr1=0,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <-none.

%entry name = UNUSED_SQW; function = $F; start_address END_OF_LINK; 
enable_match;
cond hsr1=1,hsr0=0,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <-none.

%entry name = UNUSED_SQW; function = $F; start_address END_OF_LINK; 
enable_match;
cond hsr1=0,hsr0=0,lsr=1,m/tsr=0,pin=x,flag0=x;
ram p <-none.




(*********************************************************************
*)
(* Function:    high -   set pin 
high                                  *)
(* Creation Date: 26/Sep/01                 From: SQW                 
*)
(* Author:  Jeffrey C. Andle                                          
*)
(* Description:                                                       
*)
(* ------------                                                       
*)
(*                                                                    
*)
(* Updates:   By:   Modification:                                     
*)
(* --------   ---   -------------                                     
*)
(*--------------------------------------------------------------------
*)
(* Standard Exits Used:-   End_Of_Phase: N         End_Of_Link: Y     
*)
(* External Files included: NONE                                      
*)
(* CODE SIZE excluding standard exits = 1? LONG WORDS                 
*)
(*--------------------------------------------------------------------
*)
(*********************************************************************
*)
(*()()()()()()()()()()() DATA STRUCTURE ()()()()()()()()()()()()()()()
*)
(*                                                                    
*)
(* name:               Written By:            Location  Bits:         
*)
(* -----               -----------            ---------------         
*)
(* prm0                TPU                     Parameter0  0..15      
*)
(*                                             ert.    *)
(*                                                                    
*)
(* hsr1   hsr0         Action                                         
*)
(* ----   ----         ------                                         
*)
(*  1       1          Initialize continuous square wave              
*)
(*                     return PERIOD                                  
*)
(*                                                                    
*)
(* Links Accepted: NO              Links Generated: NO                
*)
(*                                                                    
*)
(* Interrupts Generated After:     No interrupts generated            
*)
(*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
*)

(*====================================================================
*)
(*|||||||||||||||||||||  MICROCODE STARTS BELOW  
|||||||||||||||||||||*)
(*VVVVVVVVVVVVVVVVVVVVV--------------------------
VVVVVVVVVVVVVVVVVVVVV*)

(*********************************************************************
*)
(* ENTRY name:  
INIT_HIGH                                              *)
(* STATE(S) ENTERED: S1                                               
*)
(* PRELOAD PARAMETER : prm1                                           
*)
(* ENTER WHEN : HSR = %11                                             
*)
(*                                                                    
*)
(* ACTION: set time base as TCR1, set pin high, and pac to toggle     
*)
(*         pin after each match.  Write the current time + the        
*)
(*         HIGH_TIME to the mer.  Negate latches.  Enable service     
*)
(*         requests.  Write prm2 = prm0 + prm1.                       
*)
(*********************************************************************
*)
%entry name = INIT_HIGH; function = $E; start_address *; enable_match;
cond hsr1=1,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <- none.

        chan    TBS:= out_m1_c1,         (* pin is output, use TCR1 *)
                PAC:= no_change,            (* toggle pin on match *)
                pin:= high,              (* initialize pin as high *)
                disable_mtsr.             (* enable m/tsr requests *)

(* This code is tested and ...*)
	au	diob := tcr1.
	ram	diob -> prm0.

        chan    neg_mrl, neg_tdl, neg_lsl;      (* negate latches *)
                end.                            (* end of S1 *)


(*********************************************************************
*)
(*                       UNUSED STATES                                
*)
(*********************************************************************
*)

%entry name = UNUSED_HIGH; function = $E; start_address END_OF_LINK; 
enable_match;
cond hsr1=0,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <-none.

%entry name = UNUSED_HIGH; function = $E; start_address END_OF_LINK; 
enable_match;
cond hsr1=1,hsr0=0,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <-none.

%entry name = UNUSED_HIGH; function = $E; start_address END_OF_LINK; 
enable_match;
cond hsr1=0,hsr0=0,lsr=1,m/tsr=x,pin=x,flag0=x;
ram p <-none.

%entry name = UNUSED_HIGH; function = $E; start_address END_OF_LINK; 
enable_match;
cond hsr1=0,hsr0=0,lsr=0,m/tsr=1,pin=x,flag0=x;
ram p <-none.


(*********************************************************************
*)
(* Function:    low -   set pin low                                  
*)
(* Creation Date: 26/Sep/01                 From: SQW                 
*)
(* Author:  Jeffrey C. Andle                                          
*)
(* Description:                                                       
*)
(* ------------                                                       
*)
(*                                                                    
*)
(* Updates:   By:   Modification:                                     
*)
(* --------   ---   -------------                                     
*)
(*--------------------------------------------------------------------
*)
(* Standard Exits Used:-   End_Of_Phase: N         End_Of_Link: Y     
*)
(* External Files included: NONE                                      
*)
(* CODE SIZE excluding standard exits = 1? LONG WORDS                 
*)
(*--------------------------------------------------------------------
*)
(*********************************************************************
*)
(*()()()()()()()()()()() DATA STRUCTURE ()()()()()()()()()()()()()()()
*)
(*                                                                    
*)
(* name:               Written By:            Location  Bits:         
*)
(* -----               -----------            ---------------         
*)
(* prm0                TPU                     Parameter0  0..15      
*)
(*                                             ert.    *)
(*                                                                    
*)
(* hsr1   hsr0         Action                                         
*)
(* ----   ----         ------                                         
*)
(*  1       1          Initialize continuous square wave              
*)
(*                     return PERIOD                                  
*)
(*                                                                    
*)
(* Links Accepted: NO              Links Generated: NO                
*)
(*                                                                    
*)
(* Interrupts Generated After:     No interrupts generated            
*)
(*()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
*)

(*====================================================================
*)
(*|||||||||||||||||||||  MICROCODE STARTS BELOW  
|||||||||||||||||||||*)
(*VVVVVVVVVVVVVVVVVVVVV--------------------------
VVVVVVVVVVVVVVVVVVVVV*)

(*********************************************************************
*)
(* ENTRY name:  
INIT_HIGH                                              *)
(* STATE(S) ENTERED: S1                                               
*)
(* PRELOAD PARAMETER : prm1                                           
*)
(* ENTER WHEN : HSR = %11                                             
*)
(*                                                                    
*)
(* ACTION: set time base as TCR1, set pin high, and pac to toggle     
*)
(*         pin after each match.  Write the current time + the        
*)
(*         HIGH_TIME to the mer.  Negate latches.  Enable service     
*)
(*         requests.  Write prm2 = prm0 + prm1.                       
*)
(*********************************************************************
*)
%entry name = INIT_LOW; function = $D; start_address *; enable_match;
cond hsr1=1,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <- none.

        chan    TBS:= out_m1_c1,         (* pin is output, use TCR1 *)
                PAC:= no_change,            (* toggle pin on match *)
                pin:= low,              (* initialize pin as high *)
                disable_mtsr.             (* enable m/tsr requests *)

(* This code is tested and ...*)
	au	diob := tcr1.
	ram	diob -> prm0.

        chan    neg_mrl, neg_tdl, neg_lsl;      (* negate latches *)
                end.                            (* end of S1 *)


(*********************************************************************
*)
(*                       UNUSED STATES                                
*)
(*********************************************************************
*)

%entry name = UNUSED_LOW; function = $D; start_address END_OF_LINK; 
enable_match;
cond hsr1=0,hsr0=1,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <-none.

%entry name = UNUSED_LOW; function = $D; start_address END_OF_LINK; 
enable_match;
cond hsr1=1,hsr0=0,lsr=x,m/tsr=x,pin=x,flag0=x;
ram p <-none.

%entry name = UNUSED_LOW; function = $D; start_address END_OF_LINK; 
enable_match;
cond hsr1=0,hsr0=0,lsr=1,m/tsr=x,pin=x,flag0=x;
ram p <-none.


%entry name = UNUSED_LOW; function = $D; start_address END_OF_LINK; 
enable_match;
cond hsr1=0,hsr0=0,lsr=0,m/tsr=1,pin=x,flag0=x;
ram p <-none.

RE: [68300] The TPU

2002-07-09 by Godiska, Jim

Roy,
 
I have used the ITC, QOM, UART, FQD, and PTA functions on a 68376 G-mask
chip.  It took a little time to figure out some things, but I eventually got
them working.  The only real problem I came across was a typo in the
documentation for setting up the UART for TX or RX.  The documents had a
couple of bits defined incorrectly in the HSRR for activating a TPU channel
as TX or RX.
 
Jim
Show quoted textHide quoted text
-----Original Message-----
From: Roy [mailto:spectric@...]
Sent: Monday, July 08, 2002 4:53 PM
To: 68300@yahoogroups.com
Subject: [68300] The TPU


Hi all

Has anybody succeeded in getting the ITC, PMA and PSP
functions working ?

I have drawn a blank and have spent far to long
checking code and trying possible fixes without
success and it seems this list has shrunk, either due
to the move over to Yahoo or I suspect the TPU has
driven them to insanity.

I got the CTM module running with no hassle and the
QADC but not the TPU.  Is there a known problem with
the microcode for these functions.

              thanks Roy




__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com <http://sbc.yahoo.com> 

---------------------------------------------------
To unsubscribe from this group, send an email to:
68300-unsubscribe@yahoogroups.com

To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu <http://www.motorola.com/mcu> 



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




[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.