🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.asm
Article #426

problems with interrups on a 68HC12

#426
From: Seb
Date: Wed, 13 Feb 2002 14:09
74 lines
2952 bytes
hello,

i'm programming a 68HC12, and i want to switch 0/1 (and 1/0) on the PortP
with the Real-Time Interrupt. The PortP is inverted only one  time, and stay
at the level one. I think that the program goes only one time in the
interrupt subroutine (call BBB).
On the 68HC12's datasheet, it's writting that we should write $80 in the
RTIFLG register to clear the flag.
We tried a program with the polling method on the RTIFLG register: when the
RTIFLAG is set we call a subroutine with JSR, and we return back with RTS
instruction. This method is working very well, that's mean also that the
STACK is working correctly.
With this program (with interrupts), it looks like that the STACK doesn't
work correctly, that explain that it change the portP only one time.
Help me, what do think about it?
And why my program with interrupts doesn't work correctly?
THX

My .asm:
    XDEF DEBUT
    XDEF BBB

    STACK  EQU $0BFF
    DDRP  EQU $0054
    PORTP  EQU $0056
    RTICTL EQU $0014
    RTIFLG EQU $0015
    COPCTL EQU $0016

DEBUT:
     LDS #STACK     ;load Stack Pointer
     CLRA
     CLRB
     MOVB #$87,RTICTL     ;config RTICTL
     MOVB #$00,COPCTL   ;disable COP
     LDAA #$FF
     STAA DDRP     ;PortP -> Output
     LDAA #$00
     STAA PORTP   ;PortP = 0000 0000
     CLI

AAA:
    NOP
    BRA AAA

BBB:
    MOVB #$80,RTIFLG    ;reset RTIFLG
    COMA   ;invert A
    STAA PORTP
    RTI

My .prm:
LINK hc12_e.abs

NAMES
  hc12_e.o
END


SEGMENTS
  MY_RAM  = READ_WRITE  0x0800 TO 0x0AFF;
  MY_ROM  = READ_ONLY   0x8000 TO 0xFFBF;
  MY_STK   = READ_WRITE 0x0B00 TO 0x0BFF;
END

PLACEMENT
.data   INTO MY_RAM;
.text   INTO MY_ROM;
.stack  INTO MY_STK;
END

INIT DEBUT
VECTOR ADDRESS 0xFFF0 BBB
VECTOR ADDRESS 0xFFFE DEBUT
Technical Details
Message-ID: <a4drgb$jpr$1@reader1.imaginet.fr>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news-x2.support.nl!newsgate.cistron.nl!fr.clara.net!heighliner.fr.clara.net!fr.colt.net!writer!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: feb3e,fa63cd6deb65b373,start
X-Google-Attributes: gidfeb3e,public
X-Google-Thread: 111deb,fa63cd6deb65b373,start
X-Google-Attributes: gid111deb,public
X-Google-Thread: f7d8d,fa63cd6deb65b373,start
X-Google-Attributes: gidf7d8d,public
X-Google-ArrivalTime: 2002-02-13 06:08:38 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news-x2.support.nl!newsgate.cistron.nl!fr.clara.net!heighliner.fr.clara.net!fr.colt.net!writer!not-for-mail
From: "Seb" <Seb@moi.fr>
Newsgroups: alt.lang.asm,comp.sys.m68k,fr.sci.electronique
Subject: problems with interrups on a 68HC12
Date: Wed, 13 Feb 2002 15:09:31 +0100
Organization: ImagiNET / Colt Internet
Lines: 79
Message-ID: <a4drgb$jpr$1@reader1.imaginet.fr>
NNTP-Posting-Host: 195.68.79.133
X-Trace: reader1.imaginet.fr 1013608779 20283 195.68.79.133 (13 Feb 2002 13:59:39 GMT)
X-Complaints-To: abuse@imaginet.fr
NNTP-Posting-Date: 13 Feb 2002 13:59:39 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200