Loading ...
Sorry, an error occurred while loading the content.

Re: ML67Q4003 SIO port interrupt

Expand Messages
  • cdh_aiki
    I m familiar with the ML67Q5003 which should be very similar to the ML67Q4003. In your SIO_handler() function, you are probably reading SIOSTA and checking
    Message 1 of 3 , May 15 5:09 PM
    • 0 Attachment
      I'm familiar with the ML67Q5003 which should be very similar
      to the ML67Q4003. In your SIO_handler() function, you are
      probably reading SIOSTA and checking for SIOSTA_RVIRQ -- and
      then clearing the status after reading from SIOBUF by writing
      SIOSTA_RVIRQ to SIOSTA.

      If any of (SIOSTA_FERR | SIOSTA_PERR | SIOSTA_OERR) are set,
      you should also clear that status by writing to SIOSTA. They
      indicate serial receive errors.

      If SIOSTA_TRIRQ is asserted in SIOSTA, the interrupt indicates
      the transmitter is now idle. You need to clear the interrupt
      status (and stuff another output character if you are buffering
      output).

      Basically in your interrupt handler, if you are seeing any
      bits asserted in SIOSTA, they need to be handled or cleared
      or the interrupt will fire again.

      -Chris Hooper


      --- In OKI-ARM-mcus@yahoogroups.com, "edfeten" <Fetona@...> wrote:
      >
      > Hi All,
      > I have another question that I could use help on.
      >
      > In my application I use the SIO port (PIOB[6] and PIOB[7]) to receive and transmit data. That all works fine. So the port is setup for 9600 baud and everything is good. I was not using interrupts for receive or transmit.
      >
      > Well yesterday I decided that I needed to enable the SIO interrupt function for receiving data from the SIO port.
      >
      > I thought I setup everything properly.
      >
      > - I created a simple SIO_Handler() function.
      > - I added that function to the interrupt table
      > - I enabled the interrupt
      >
      > When data arrives at the SIO port my code does read it. However, when the data stops, my SIO interrupt handler keeps getting called as if there is more data coming in.
      >
      > I am clearing the RVIRQ bit of the SIO status register from inside of the interrupt function. I am clearing it by writting a 1 to it (as shown in the manual).
      >
      > Does anybody have any ideas as to why my SIO interrupt function is getting called when there is no data coming in?
      >
      > Thanks,
      > Ed
      >
    • edfeten
      Thanks! Ed
      Message 2 of 3 , May 21 7:10 PM
      • 0 Attachment
        Thanks!
        Ed

        --- In OKI-ARM-mcus@yahoogroups.com, "cdh_aiki" <cdh_aiki@...> wrote:
        >
        > I'm familiar with the ML67Q5003 which should be very similar
        > to the ML67Q4003. In your SIO_handler() function, you are
        > probably reading SIOSTA and checking for SIOSTA_RVIRQ -- and
        > then clearing the status after reading from SIOBUF by writing
        > SIOSTA_RVIRQ to SIOSTA.
        >
        > If any of (SIOSTA_FERR | SIOSTA_PERR | SIOSTA_OERR) are set,
        > you should also clear that status by writing to SIOSTA. They
        > indicate serial receive errors.
        >
        > If SIOSTA_TRIRQ is asserted in SIOSTA, the interrupt indicates
        > the transmitter is now idle. You need to clear the interrupt
        > status (and stuff another output character if you are buffering
        > output).
        >
        > Basically in your interrupt handler, if you are seeing any
        > bits asserted in SIOSTA, they need to be handled or cleared
        > or the interrupt will fire again.
        >
        > -Chris Hooper
        >
        >
        > --- In OKI-ARM-mcus@yahoogroups.com, "edfeten" <Fetona@> wrote:
        > >
        > > Hi All,
        > > I have another question that I could use help on.
        > >
        > > In my application I use the SIO port (PIOB[6] and PIOB[7]) to receive and transmit data. That all works fine. So the port is setup for 9600 baud and everything is good. I was not using interrupts for receive or transmit.
        > >
        > > Well yesterday I decided that I needed to enable the SIO interrupt function for receiving data from the SIO port.
        > >
        > > I thought I setup everything properly.
        > >
        > > - I created a simple SIO_Handler() function.
        > > - I added that function to the interrupt table
        > > - I enabled the interrupt
        > >
        > > When data arrives at the SIO port my code does read it. However, when the data stops, my SIO interrupt handler keeps getting called as if there is more data coming in.
        > >
        > > I am clearing the RVIRQ bit of the SIO status register from inside of the interrupt function. I am clearing it by writting a 1 to it (as shown in the manual).
        > >
        > > Does anybody have any ideas as to why my SIO interrupt function is getting called when there is no data coming in?
        > >
        > > Thanks,
        > > Ed
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.