Help needed with SCI interrupts (HC12)

Started by Unknown June 27, 2007
On Jun 30, 7:58 am, 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.