Profos, Georg wrote:
> In an ISR, you have to either (a) make sure the ISR and all subroutines
> that are called, are in unpaged flash, or (b), that the page register(s)
> are restored at the end of the ISR. The same consideration applies for
It's absulutely OK to call paged subroutines from ISR. Normally paged
routines are called with CALL instruction (this changes PPAGE), and return
from paged routine (to ISR) is normally made using RTC instruction. So no
worry about this. Using banked data from ISR of course doesn't restore PPAGE
by default, that's special case and you should be aware.
> RAM access, if you make any accesses to paged RAM areas, you must
Paged RAM in DP256?
> restore the page register(s) at the end of the ISR. By experience, I
> would suggest to do no paged accesses of any kind in ISR, that will also
> help keep ISR execution time low.
>
> Hope this helps. - I'm not sure if this is the cause of the problem that
> you are experiencing, but it's a matter worth looking into.
>
> Georg
>
To Robert:
could you be more specific how does your program crash? Could it be timing
issue? Reading misaligned words from flash takes a little longer than
reading aligned words. However, alignedness of the code shouldn't make any
difference.
Another shot. Is this crash related to flash/eeprom writing? If so then
probably you have some routine to be copied and executed from RAM? Could be
there a bug in allocating a space for function in RAM or a bug in
copy_func_to_RAM routine?
Edward
> ________________________________
>
> Von: 6...@yahoogroups.com [mailto:6...@yahoogroups.com] Im Auftrag
> von joncas04
> Gesendet: Freitag, 28. September 2007 11:33
> An: 6...@yahoogroups.com
> Betreff: [68HC12] procedure address alignment for HCS12
>
> Hello Group,
>
> i would be most grateful for advice on a strange issue:
> when the code-length of a procedure that gets called from an interrupt
> routine is odd, the program crashed when certain subroutines are called.
> Adding an assignment like "var = 1;" to the routine to make its
> code-length an even number of bytes, fixes the issue.
> Is there some option flag or pragma statement one could add to make
> the compiler or linker automatically make the code-length even?
> This is a MC9S12DP256B processor with CodeWarrior 3.1
>
> Many thanks in advance !
> Robert
> [Non-text portions of this message have been removed]
>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )