Re: Help needed with SCI interrupts (HC12)



On Jun 28, 11:49 am, ryufr...@xxxxxxxxxxx wrote:
On Jun 28, 4:54 pm, cs_post...@xxxxxxxxxxx wrote:

On Jun 28, 10:43 am, ryufr...@xxxxxxxxxxx wrote:

What exactly do you mean by "crashed" ?

When the board reaches the point to call the SCI1in function to read
in data over the RS232 link, any further functions taking place at
that time freeze (Ethernet protocols` initialization etc).

But what is the processor doing? Frozen? Executing from unprogrammed
memory? Or stuck in a loop within your program? If it's stuck in a
loop, determine which instructions are actually being executed - I
think you posted something before that included a function call within
the loop.

- Examine memory at location 0xFF80 and you should see the vector
table. Check that the address of your handler appears at the right
location in it. (You may want to examine the linker map file too, it
shows you a lot)

In the linker map file i found that my interrupt is on the wrong
address i think.

Name Addr hSize dSize Ref Section
SCI1Interrupt 506D 5 5 1 NON_BANKED

From the MC9S12NE64`s datasheets:

Vector No Vector Address Name Source
21 $FFD4, $FFD5 Vsci1 SCI1

The 16 bit value at $FFD4 should contain the address of your ISR,
which according to the map file would be $506D. Use the memory
window in the debugger to examine it. But it's probably okay.

You should also make sure that interrupts are enable (assembler
instructions SEI and CLI or whatever, can't remember which is which),
that the SCI RX interrupt bit is enabled (use the debugger to examine
the memory mapped SCI register), and that the port module is leaving
the relevant IO pins for SCI and not making GPIO's out of them.

Another thing you could try: make your program periodically call the
ISR, so that in effect you are polling the serial port (and leave out
the time consuming UDP calls). Does it work then?

.


Quantcast