Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TPU Programming

0 views
Skip to first unread message

Scott Selman

unread,
Oct 30, 1997, 3:00:00 AM10/30/97
to

Hi :

I have been trying to get the TPU working, so far without
success. All I am trying to do at this point is to get TPUCH8
running in PWM mode at the lowest frequency available. According to the
manual, with TCR1=11 and PSCK=0 and a 16MHz system clock I should get a 16
ms period square wave output on pin 18B of connector J1. This should give
me a 62.5Hz 0-5V square wave. Since I am just trying to generate
an output, I don't need interrupts but the TPU channel should function
even though I don't have interrupts enabled. Is this a correct
assumption?

Anyway, when I initialize the TPU channel, I get ground plus a little bit
of noise (< 1volt). Can you see anything I am doing wrong? Below I have
included relevant output listing from the assembler. Any assistance would
be appreciated.

Paul K. McKneely


#include <TPU.HDR>
;<<<<<<<<<<<<<<<<<<<<<<< TPU Time Processor Unit
Module >>>>>>>>>>>>>>>>>>>>>>
<FFFFFE00> TPU_MCR: EQU $FFFFFE00 ;
<FFFFFE02> TPU_TCR: EQU $FFFFFE02 ;
<FFFFFE04> TPU_DSCR: EQU $FFFFFE04 ;
<FFFFFE06> TPU_DSSR: EQU $FFFFFE06 ;
<FFFFFE08> TPU_TICR: EQU $FFFFFE08 ;
<FFFFFE0A> TPU_CIER: EQU $FFFFFE0A ;
<FFFFFE0C> TPU_CFSR0: EQU $FFFFFE0C ;
<FFFFFE0E> TPU_CFSR1: EQU $FFFFFE0E ;
<FFFFFE10> TPU_CFSR2: EQU $FFFFFE10 ;
<FFFFFE12> TPU_CFSR3: EQU $FFFFFE12 ;
<FFFFFE14> TPU_HSQR0: EQU $FFFFFE14 ;
<FFFFFE16> TPU_HSQR1: EQU $FFFFFE16 ;
<FFFFFE18> TPU_HSRR0: EQU $FFFFFE18 ;
<FFFFFE1A> TPU_HSRR1: EQU $FFFFFE1A ;
<FFFFFE1C> TPU_CPR0: EQU $FFFFFE1C ;
<FFFFFE1E> TPU_CPR1: EQU $FFFFFE1E ;
<FFFFFE20> TPU_CISR: EQU $FFFFFE20 ;
<FFFFFE22> TPU_LR: EQU $FFFFFE22 ;
<FFFFFE24> TPU_SGLR: EQU $FFFFFE24 ;
<FFFFFE26> TPU_DCNR: EQU $FFFFFE26 ;

;Define Short Addresses of TPU Registers
<FFFFFF00> TPU_PAR0: EQU $FFFFFF00 ;
<FFFFFF80> TPU_PAR8: EQU $FFFFFF80 ;

;<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Initialize TPU
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

;Clear the TPU Parameter RAM
00020A 41F8FF00 LEA.L (TPU_PAR0).W,A0
00020E 303C0080 MOVE.W #128,D0
000212 30FC0000 TPU_clear: MOVE.W #0,(A0)+
000216 5340 SUBQ.W #1,D0
000218 6EF8 BGT.B TPU_clear

;Setup TPU Channel 8 as PWM output
00021A 31FC6008FE00 MOVE.W #$6008,(TPU_MCR).W ;Prescale by
32
000220 31FC0000FE08 MOVE.W #$0000,(TPU_TICR).W ;CIRL=0,
CIBV=0
000226 31FC0000FE0A MOVE.W #$0000,(TPU_CIER).W ;No
Interrupts Enabled
00022C 31FC0009FE0E MOVE.W #$0009,(TPU_CFSR1).W ;PWM output
000232 31FC0091FF80 MOVE.W #$0091,(TPU_PAR8).W ;Match TCR1,
Toggle on match
; MOVE.W #$008D,(TPU_PAR8).W ;Match
TCR1, Toggle on match
000238 31FC1000FF84 MOVE.W #$1000,(TPU_PAR8+4).W ;Transition
00023E 31FC2000FF86 MOVE.W #$2000,(TPU_PAR8+6).W ;Period
000244 31FC0002FE18 MOVE.W #$0002,(TPU_HSRR0).W ;Initialize
00024A 31FC0001FE1C MOVE.W #$0001,(TPU_CPR0).W ;Channel
Priority Lo


Paul K. McKneely

unread,
Nov 1, 1997, 3:00:00 AM11/1/97
to

In message <01bce570$83c5afc0$2f01...@sselman.fluid-data.com>, "Scott Selman"
<sse...@fluid-data.com> writes:

>I have been trying to get the TPU working, so far without

>success. Can you see anything I am doing wrong?

I have since solved my dilema. The PWM mode is only in the Mask A version of
the chip. I have discovered that I have the Mask G version.

Paul K. McKneely

0 new messages