RE: Queued SCI with Interrupts on MPC555

"David Eicher" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
Hmmm, okay, it works if I take the test  out that checks to see if I've
gotten 5 interrupts       if (data[0]< 6)  /* stop after 5 interrupts */

With that removed and just setting QTE and TE it transmits reliably and
continuously. I'm beginning to think my intermittent behaviour could be
related to not saving context and restoring context. The CW pragma interrupt
is suppose to get that done for me. I don't know how to check and see if it
is working. Does anyone know how to make CW save intermediate files so I can
see the assembly source it is generating?

 

Thanks,

 

Dave

 

 

  _____  

From: [email protected] [mailto:[email protected]] On Behalf Of
David Eicher
Sent: Thursday, December 08, 2005 6:51 AM
To: [email protected]
Subject: RE: [MPC500] Queued SCI with Interrupts on MPC555

 

This morning I got up, fired up the machine, and ran this again. Now it does
not work..., it ran several times last night but after being powered down
all night, it does not. I must have had the hardware in some state that
allowed it to work, which I can't duplicate this morning. So, I'm still
trying to figure out a combination of "start transmit" code and ISR that
will keep the queue transmitting reliably. Does anyone have an suggestions
about what is wrong/missing from this code?



Thanks,



Dave





  _____  

From: [email protected] [mailto:[email protected]] On Behalf Of
David Eicher
Sent: Wednesday, December 07, 2005 6:58 PM
To: [email protected]
Subject: RE: [MPC500] Queued SCI with Interrupts on MPC555



Hi Allan,



Well, I made a few adjustments, and found a combination that seems to work.
The first group of code here is the code that initiates the transmit (QBHEI
is already set). The second group of code is the code of the ISR that keeps
the transmit running. I need to experiment more and verify that I actually
need the wrap bit set, I doubt it because I'm not actually wrapping. I'll
keep working at it. Thanks again for your help.



Dave



--------------------------------------------------------- start transmit
-----------------------------------------------------------------



            for (i=0;i<16;i++) scratch[i] = 'a';

            

            ioctl(QSMCM_QSCI1, QSCI_ENABLE_TX_WRAP, SCI_ENABLE); 

            ioctl(QSMCM_QSCI1, QSCI_WRITE_QUEUE_TX_SIZE, 16);

            

            /* read SR with TC set */

            while(!(ioctl(QSMCM_SCI1, SCI_GET_FLAGS, SCI_TX_COMPLETE))) {;}


            



              /* fill the whole buffer */  

              write(QSMCM_QSCI1, QUEUE_TOP_HALF, scratch, 16);



              /* Clear top half and bottom half flags QTHE/QBHE */

              ioctl(QSMCM_QSCI1, QSCI_CLEAR_QUEUE_FLAGS, QSCI_TX_TOP_HALF);

              ioctl(QSMCM_QSCI1, QSCI_CLEAR_QUEUE_FLAGS, QSCI_TX_BOT_HALF);

            

              /* Set queued enable flag in control register QTE */


              ioctl(QSMCM_QSCI1, QSCI_QUEUE_TX, SCI_ENABLE);

              /* Set QSCI transmit enable flag in control register TE */

              ioctl(QSMCM_SCI1, SCI_TRANSMITTER, SCI_ENABLE);





--------------------------------------------------------- ISR
----------------------------------------------------------------------------
---



  if (ioctl(QSMCM_QSCI1, QSCI_GET_QUEUE_FLAGS, QSCI_TX_BOT_HALF))

  {

      ioctl(QSMCM_QSCI1, QSCI_ENABLE_TX_WRAP, SCI_ENABLE); 

              ioctl(QSMCM_QSCI1, QSCI_WRITE_QUEUE_TX_SIZE, 16);

                                    

              /* read SR with TC set */

              while(!(ioctl(QSMCM_SCI1, SCI_GET_FLAGS, SCI_TX_COMPLETE)))
{;}  



              for (i=0;i<14;i++) scratch[i] = 'c';

              scratch[14] = (u_char)13;

              scratch[15] = (u_char)10;

              write(QSMCM_QSCI1, QUEUE_TOP_HALF, scratch, 16);



              ioctl(QSMCM_QSCI1, QSCI_CLEAR_QUEUE_FLAGS, QSCI_TX_TOP_HALF);
/* clear QBHE */

              ioctl(QSMCM_QSCI1, QSCI_CLEAR_QUEUE_FLAGS, QSCI_TX_BOT_HALF);

            

              if (data[0]< 6)  /* stop after 5 interrupts */

              {

                ioctl(QSMCM_QSCI1, QSCI_QUEUE_TX, SCI_ENABLE);

                ioctl(QSMCM_SCI1, SCI_TRANSMITTER, SCI_ENABLE);

              }

              else

              {

                ioctl(QSMCM_QSCI1, QSCI_QUEUE_TX, SCI_DISABLE);

                ioctl(QSMCM_SCI1, SCI_TRANSMITTER, SCI_DISABLE);

            }

   }











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



-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu







  _____  

YAHOO! GROUPS LINKS 



*      Visit your group "MPC500 <http://groups.yahoo.com/group/MPC500> "
on the web.
  
*      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!
<http://docs.yahoo.com/info/terms/>  Terms of Service. 



  _____  



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



-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu







SPONSORED LINKS 


Freescale
<http://groups.yahoo.com/gads?t=ms&k=Freescale+semiconductor+inc&w1=Freescal
e+semiconductor+inc&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+micr
oprocessor&c=4&s=106&.sig=K2HGv-zFlv5OYUv_QxIq_Q>  semiconductor inc 

Microcontrollers
<http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Freescale+semicondu
ctor+inc&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&
c=4&s=106&.sig=SYHwNJjjGQXRvtt_GybT4g>  

Pic
<http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Freescale+semic
onductor+inc&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microproces
sor&c=4&s=106&.sig=umVbbnUwsPzEzKKD_pQfUw>  microcontrollers 


8051
<http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Freescale+semico
nductor+inc&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocess
or&c=4&s=106&.sig=NO-nSKjHoAlh9XtZ8LB1_A>  microprocessor 

 

 

 

  _____  

YAHOO! GROUPS LINKS 

 

*	 Visit your group "MPC500 <http://groups.yahoo.com/group/MPC500> "
on the web.
  
*	 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!
<http://docs.yahoo.com/info/terms/>  Terms of Service. 

 

  _____  



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



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/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.