[Efi332] Queued SCI transmit with interrupts on MPC555

David Eicher sailors3
Thu Dec 8 15:11:22 UTC 2005


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: efi332-bounces at diy-efi.org [mailto:efi332-bounces at diy-efi.org] On
Behalf Of David Eicher
Sent: Thursday, December 08, 2005 6:53 AM
To: efi332 at diy-efi.org
Subject: RE: [Efi332] Queued SCI transmit with interrupts on MPC555

 

Hi John,

 

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 you or anyone have an
suggestions about what is wrong/missing from this code?

 

Thanks,

 

Dave

 

 

 

  _____  

From: efi332-bounces at diy-efi.org [mailto:efi332-bounces at diy-efi.org] On
Behalf Of David Eicher
Sent: Wednesday, December 07, 2005 9:25 PM
To: efi332 at diy-efi.org
Subject: RE: [Efi332] Queued SCI transmit with interrupts on MPC555

 

Hi John,

Thanks for your response. Yep, I'm trying to get the QSCI to work on the
MPC555 for transmit. I've just got a block of data I need to transmit.

I've implemented the code per the demo code in the quickstart package, it
just flat does not work for me. I've tried both use the two interrupts (QBHE
and QTHE), and tried just using the QBHE interrupt alone (filling queue with
16 bytes each time), and had no success for many hours.

Just earlier tonight I finally managed to get one approach to the point it
appears it is working (more testing required yet though). I'm using just the
QBHE interrupt and flag, filling the queue with 16 bytes each time. The demo
code does not include a "set QTE and TE" in the ISR after the queue is
loaded, but it doesn't seem to transmit without it. There is nothing I've
found in the users manual for MPC555 that indicates that this is required,
but I've had to keep turning the queue on over and over again to keep it
transmitting. 

Is this correct? Or am I just bandaiding some error in my code with the
setting of QTE and TE?

I"ll include the code I've found that works, I'd appreciate your comments on
it:

Thanks much,

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);

      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);

      }

   }

 

 

-----Original Message-----
From: efi332-bounces at diy-efi.org [mailto:efi332-bounces at diy-efi.org] On
Behalf Of John Honnold
Sent: Wednesday, December 07, 2005 1:31 PM
To: efi332 at diy-efi.org
Subject: Re: [Efi332] Queued SCI transmit with interrupts on MPC555

David:

   What seems to be the problem?  I work for Freescale

with the MCUs, so I may be able to help.  Let me know

some specifics.

Regards,

John Honnold

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.diy-efi.org/pipermail/efi332/attachments/20051208/3b5347b2/attachment.html 



More information about the Efi332 mailing list