Re: Help needed with SCI interrupts (HC12)



On Jun 30, 7:58 am, ryufr...@xxxxxxxxxxx wrote:

First, congratulations on getting it working.

My problem was caused by the various DEBUGOUT functions I set in my
code in order to monitor its progress in hyperterminal and locate
where it stops etc. As long as it works fine, there is no need anymore
to know the details within ;)

Yeah, that would do it. Unless the debug connection is at a baud rate
an order of magnitude faster than the data connection, I'd expect you
to lose characters. Strongly suggest getting a BDM pod... best $100
you will spend.

I don't know if it actually makes a difference, but I often due the
ISR as a while loop contingent on the character available flag; that
way if somehow I'm running far enough behind that reception of another
character completes while I'm storing the first, I can actually get
two characters from one interrupt.

So far I can notice that various other interrupts take place while
SCI1 interrupt is active, coming from broadcast packets on the
Ethernet port. I haven`t done much testing yet of the whole program,
but in case this causes me any problems, is there a way to increase
the SCI1 interrupt`s priority over the others?

I'm not sure that I'd agree that the SCI should have priority over the
ethernet. 10 MB/s is nearly 100 times 115200 baud, so at first glance
it looks like entire short packets could come in between serial
characters. Anyway, I've seen no problems with 115200 baud serial,
and ethernet.

As for priorities, disabling the interrupts during the ISR (if that's
not happening automatically), consult the data sheet. It's long, but
informative even if you only read the applicable section to your
problem-of-the-day.

.



Relevant Pages

  • Re: Is interrupt priority supported ?
    ... Imagine a table with interrupt IDs, in my example they are in decreased priority order: ... Then, when one interrupt happen, lets say the Ethernet, the OS disable all lower priority interrupts, but allow the Serial interrupt nest into the Ethernet interrupt. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
    (Linux-Kernel)
  • [PATCH 1/2] Fix spelling of "occur" and similar words in comments.
    ... Occurrences were found with cscope and then manually corrected. ... the change caused that line to exceed 80 characters. ... These two patches fix around 250 errors located throughout the kernel. ... The irb that is handed to the device driver when an interrupt occurs. ...
    (Linux-Kernel)
  • Dont need to be kid-friendly...
    ... everyone that kid-friendly is not a priority in my movies. ... If you don't mind showing the youngsters violence ... having that character keep trying to get other characters to kill ... Derek's recommendation of "Slayers". ...
    (rec.arts.anime.misc)
  • Re: Linux serial port dropping bytes
    ... characters at something like 20 per us. ... takes virtually the same time to read 128 bytes out the buffer ... during one interrupt, as to read 1 byte from the buffer during ... test for more in FIFO ...
    (comp.arch.embedded)
  • Re: Linux serial port dropping bytes
    ... the cost of handling each character is peanuts - even if the ... UART is on a slow bus, you should be able to read out ... characters at something like 20 per us. ... during one interrupt, as to read 1 byte from the buffer during ...
    (comp.arch.embedded)