need help QSCI(urgent)

"ijam001" <[email protected]> Fri, 15 Sep 2006 08:30:32 -0000
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
hi all

I'm having problem with my sci interrupt. it continue to execute
without stopping(looping) eventhough the program should execute once
on each charater received from the receiver.

do i have to disable/clear any flag in sci registers to avoid this to
heappen?

hope anyone can help me on this.maybe i had missed anything since iam
really new with this mpc555.

...below are the codes...maybe you can see the problem clearer

best regard.
nizam
//////////////////////////
//	Project Stationery  //
//////////////////////////

#include <stdio.h>
#include "mpc555.h"



   UINT32 counter = 0 ;		// Global for ISR to hold the 
   							// number of PIT interrupts
   UINT32 loopctr = 0 ;		// Loop counter for main loop



void SCI_Int (void);

void init555()				// Simple MPC555 Initialization
{
   USIU.SYPCR.R = 0xffffff03; // Disable watchdog timer 
   USIU.PLPRCR.B.MF = 0x009; // Run at 40MHz for 4MHz crystal
   while(USIU.PLPRCR.B.SPLS == 0);	// Wait for PLL to lock	
   UIMB.UMCR.B.HSPEED = 0;	// Run IMB at full clock speed				       
}



void initSci() 
{
							// STEP 1: MODULE SPECIFIC INITIALIZATION
							// Initialize the SCI for simple operation
    QSMCM.SCC1R0.B.SC1BR = 40000000/32/57600;	// Set baud rate
    QSMCM.SCC1R1.B.TE = 1;	// Transmitter enable
    QSMCM.SCC1R1.B.RE = 1;	// Receiver enable
							// Initialize buffer variables

							// STEP 2: LEVEL ASSIGMENT
    QSMCM.QDSCI_IL.B.ILDSCI = 5;	// define SCIIRQ at level 5

							// STEP 3: ENABLE INTERRUPT
    QSMCM.SCC1R1.B.RIE = 1;	// Enable receive interrupts only

							// STEP 4: SET APPROPRIATE SIMASK BITS
    USIU.SIMASK.R = 0x00100000; // Enable level 5; others disabled 
    
    
} 



main()
{
	init555();				
	initSci();			
 	asm(" mtspr EIE, r3");	// FINAL STEP: SET MSR[EE], MSR[RI] 

  	while(1)					
   	{
   	loopctr++;   			
   	}			     
}

void SCI_Int (void)			
{ 

	while(QSMCM.SC1SR.B.TDRE ==0); // check transmit data reg 
	QSMCM.SC1DR.R = 'X';          // not using Q:data to be 

 }  








-----------------------------------------------------------
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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/MPC500/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> 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/