Re: tpu3 pmm/psp tcr2 problem

"ratell01" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
Hi,

I've got the same problem.  I'm trying the demo with PMM/PSP function. 
 The QOM functions outputs the right thing on the oscillo. but when I 
connect the PSP and tcr2clk on the QOM crank signal, nothing comes out 
from the PSP function.  Does anybody know the problem and the solution 
to it?

Thanks
Jonathan
Laval University

--- In [email protected], "John Lee" <j_leemail@y...> wrote:
>
> 
> Hi guys 
> 
> Were having some trouble getting the code below working. 
> 
> Its the PMM/PSP engine crank Simulator example but slightly modified 
> as we don't need a CAM signal input. 
> 
> The QOM signal generated on TPUB to simulate a crank signal works 
> fine and we can see this on an oscilliscope it produces 34 teeth and 
> one missing transition. 
> 
> This generated signal is then inputted into the TPUA TCR2 clock pin 
> and also the PMM. 
> 
> The trouble is we have no output from the PSP and therefore think 
> something is wrong with either TPUMCR setup or the PMM.
> 
> The tpua TPUMCR is set to 0x0460 which sets tc2g and t2csl to 0 
> therefore using rising transition for tcr2clk.
> 
> If we set this to 0x7e20 and the max missing parameter of the pmm to 
> 0xFF we get an unrelated pulse out of the psp so we know emulation 
> mode is working .
> 
> also tpua TPUMCR3 is set to 0x005f which uses ESPCK we are a bit 
> unsure whether this is the correct way to set the prescaler for 
tcr2. 
> 
> The board we are using is a MPC566EVB.
> 
> Any help or advice would be greatly appreciated.
> 
> Thanks
> 
> John Lee
> University of Sussex
> 
> the code is as Follows:
> 
> 
> /
*********************************************************************
> *****/
> #define Main_Program		/* needed by mpc555 header files. */
> 
> #include "mpc565.h"             /* define all mpc555 registers */
> #include "mpc500_util.h"            /* untilities defines for the 
> mpc555 */
> #include "tpurom.h"             /* custom TPU microcode image */
> 
> #define TPU_ITC 0xa
> #define TPU_PMM 0xb
> #define TPU_PSP 0xc
> #define TPU_QOM 0xe
> 
> void main ()
> {
>     struct TPU3_tag *tpua = &TPU_A;
>     struct TPU3_tag *tpub = &TPU_B;
> 
> /****************************************************
>  * Configure and copy new TPU microcode into DPTRAM *
>  ****************************************************/
> 
>    DPTRAM6K.RAMBAR.R = 0xffa0; 
> 
>     memcpy (0x302000, tpurom, 2048);
> 
> /*************************************************
>  * Configure TPU_A and start using new microcode *
>  *************************************************/
> 
>    tpua->TPUMCR.R = 0x460; 			//460   /* enable 
> emulation mode */
>    tpua->TPUMCR3.R = 0x005F;		/* TCR1 = sys/64   <-this is 
> true.      */
> 
> 
>     tpu_func(tpua, 4, TPU_PMM);
>     tpu_hsq(tpua, 4, 3);			//  2=10=Bank Mode   
> 3=11=Count Mode
>     tpua->PARM[4][0].R = 0x0004;	//4=trig. on rising edge 
> 8=trig. on falling edge
>     tpua->PARM[4][1].R = 0x0122;	//0022 MAX_MISSING=01 
> NUM_OF_TEETH=34
>     tpua->PARM[4][3].R = 0xa0FF;	//ao22   
>     							
> 	//Ratio=$80=1 $ff=1.99 A$0=1.25  
>     							
> 	//TCR2_max_value=34 
>     tpu_hsr(tpua, 4, 1);
>     
>     
>     tpu_func(tpua, 5, TPU_PSP);
>     tpu_hsq(tpua, 5, 0);
>     tpua->PARM[5][0].R = 0x4A01;
>     tpua->PARM[5][4].R = 0x3001;
>     tpua->PARM[5][5].R = 0x5002;
>     tpu_hsr(tpua,5, 2);
>     
> 
> /* TPU B */
>     tpub->TPUMCR3.R = 0x005F;		//TCR1 = sys/64
> 
>   
>     tpu_func(tpub, 1, TPU_QOM);
>     tpu_hsq (tpub, 1, 2);
>     tpub->PARM[1][0].R = 0x009e;//
>     tpub->PARM[1][1].R = 0x0000;
>     tpub->PARM[1][2].R = 0x0410;
>     tpub->PARM[1][3].R = 0x0420;//	Missing Tooth
>     tpub->PARM[1][4].R = 0x0410;	
>     tpub->PARM[1][5].R = 0x0411;//1
>     tpub->PARM[1][6].R = 0x0410;
>     tpub->PARM[1][7].R = 0x0411;//2
>     tpub->PARM[2][0].R = 0x0410;
>     tpub->PARM[2][1].R = 0x0411;//3
>     tpub->PARM[2][2].R = 0x0410;
>     tpub->PARM[2][3].R = 0x0411;//4
>     tpub->PARM[2][4].R = 0x0410;
>     tpub->PARM[2][5].R = 0x0411;//5
>     tpub->PARM[2][6].R = 0x0410;
>     tpub->PARM[2][7].R = 0x0411;//6
>     tpub->PARM[3][0].R = 0x0410;
>     tpub->PARM[3][1].R = 0x0411;//7
>     tpub->PARM[3][2].R = 0x0410;
>     tpub->PARM[3][3].R = 0x0411;//8
>     tpub->PARM[3][4].R = 0x0410;
>     tpub->PARM[3][5].R = 0x0411;//9
>     tpub->PARM[3][6].R = 0x0410;
>     tpub->PARM[3][7].R = 0x0411;//10
>     tpub->PARM[4][0].R = 0x0410;
>     tpub->PARM[4][1].R = 0x0411;
>     tpub->PARM[4][2].R = 0x0410;
>     tpub->PARM[4][3].R = 0x0411;
>     tpub->PARM[4][4].R = 0x0410;
>     tpub->PARM[4][5].R = 0x0411;
>     tpub->PARM[4][6].R = 0x0410;
>     tpub->PARM[4][7].R = 0x0411;
>     tpub->PARM[5][0].R = 0x0410;
>     tpub->PARM[5][1].R = 0x0411;//15
>     tpub->PARM[5][2].R = 0x0410;
>     tpub->PARM[5][3].R = 0x0411;
>     tpub->PARM[5][4].R = 0x0410;
>     tpub->PARM[5][5].R = 0x0411;
>     tpub->PARM[5][6].R = 0x0410;
>     tpub->PARM[5][7].R = 0x0411;
>     tpub->PARM[6][0].R = 0x0410;
>     tpub->PARM[6][1].R = 0x0411;
>     tpub->PARM[6][2].R = 0x0410;
>     tpub->PARM[6][3].R = 0x0411;//20
>     tpub->PARM[6][4].R = 0x0410;
>     tpub->PARM[6][5].R = 0x0411;
>     tpub->PARM[6][6].R = 0x0410;
>     tpub->PARM[6][7].R = 0x0411;
>     tpub->PARM[7][0].R = 0x0410;
>     tpub->PARM[7][1].R = 0x0411;
>     tpub->PARM[7][2].R = 0x0410;
>     tpub->PARM[7][3].R = 0x0411;
>     tpub->PARM[7][4].R = 0x0410;
>     tpub->PARM[7][5].R = 0x0411;//25
>     tpub->PARM[7][6].R = 0x0410;
>     tpub->PARM[7][7].R = 0x0411;
>     tpub->PARM[8][0].R = 0x0410;
>     tpub->PARM[8][1].R = 0x0411;
>     tpub->PARM[8][2].R = 0x0410;
>     tpub->PARM[8][3].R = 0x0411;
>     tpub->PARM[8][4].R = 0x0410;
>     tpub->PARM[8][5].R = 0x0411;
>     tpub->PARM[8][6].R = 0x0410;
>     tpub->PARM[8][7].R = 0x0411;//30
>     tpub->PARM[9][0].R = 0x0410;
>     tpub->PARM[9][1].R = 0x0411;//31
>     tpub->PARM[9][2].R = 0x0410;
>     tpub->PARM[9][3].R = 0x0411;//32
>     tpub->PARM[9][4].R = 0x0410;
>     tpub->PARM[9][5].R = 0x0411;//33
>     tpub->PARM[9][6].R = 0x0410;
>     tpub->PARM[9][7].R = 0x0411;//34
>     tpu_hsr (tpub, 1, 1);
> 
> 
>     tpu_enable (tpub, 1, TPU_PRIORITY_HIGH);
>     tpu_enable (tpua, 4, TPU_PRIORITY_HIGH);
>     tpu_enable (tpua, 5, TPU_PRIORITY_HIGH);
>     
>  
> 	
> 	while(1)
> 		{
>    					// Increment loopctr for 
> something to do
> 		}
> }
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/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/
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.