EmbeddedRelated.com
Forums

Input/Output using port A

Started by cheol1217 August 21, 2004
Q) You are required to read the 8 switches and control the
LEDs using port A in real time. You need to control the LEDs
in at least 3 different ways of circulation in real time,
which should be selected by pushing different pushbuttons.
You need to consider hardware connection yourself

Can anyone help me to solve this task? I have just started
learning assembly language for 68HC11 and needs some of your
help.

thnx
Ryan



First step is figure out the steps in plain english. You can read 8 switches
with a LDAA PORTA instruction, and you can set 8 leds with the STAA PORTA
instruction. Now you need to describe what you want to happen. Example, when
you poush switch one, all 8 flash on and off once. When you push sw 2, all 8
flash one at a time, when you push switch 3, they reverse direction. Now you
need to write a 'read the switch' subroutine.... hint... switch 1 is just
getting pushed when bit one is all of a sudden lo, and it was hi last pass... you
need to save the state last pass..... you need to write a loop that will
delay 1ms... you can call that 100 times to delay 100ms, etc. Take a stab at it
and come back in a couple hrs with something that 'almost works' and we'll
help you debug it....



--- In , "cheol1217" <cheol1217@y...> wrote:
> Q) You are required to read the 8 switches and control the
> LEDs using port A in real time. You need to control the LEDs
> in at least 3 different ways of circulation in real time,
> which should be selected by pushing different pushbuttons.
> You need to consider hardware connection yourself
>
> Can anyone help me to solve this task? I have just started
> learning assembly language for 68HC11 and needs some of your
> help.

Is this the extent of the description of the program you wish to
create? It would help me if you could provide a more complete
description, as Bob Gardner suggested in his response.

If you are using a 68HC11A or E series device, you will not be able
to drive 8 LEDs with it - not all of the Port A lines can be
configured as outputs. Lines PA3 thru PA7 can be configured as (or
are permanantly set as) outputs, but PA0, PA1 and PA2 are input-
only. This is not the case with all HC11's - for example, the
MC68HC11F1 can be configured to use all 8 Port A lines as outputs.

If you are just getting started, you should go to the
Motorola/Freescale website and download the M68HC11 Reference Manual
and assimilate as much of its contents as you can.. It sounds like
you have already started to study the instruction set, which is a
good thing. The next thing you should read about are the
descriptions of the way the I/O ports work and perhaps the timer
subsystem. Don't worry too much about the 'handshake modes' offered
for Port B and Port C - these modes are not often used and probably
would not be of much use to you in your application.

Break down the task you want to perform into small sub-sections,
small enough so the solution for each is fairly obvious. Don't
worry too much if there are some tasks you do not know how to do,
like "how do I delay a tenth of a second" or "how do I read my
pushbuttons reliably". These are topics that we can help you with.
But we can't write the entire program for you, and even if we could,
it would do you little benefit to have someone else do it for you,
as you would not learn nearly as much.

It would be helpful if you could describe for us what sort of
hardware platform you are using. Will you be building the entire
system, including the HC11 and support hardware yourself? Or are
you using a pre-built 'evaluation board' that you only need to add
your LEDs and switches to? Will you be using (or does your eval
board have) external RAM and ROM/EEPROM/FLASH, or will you be using
the HC11 in 'single chip' mode? Will you be using the MC68HC(7)11Ex
device, or a different HC11 variant, like the MC68HC11F1? Answers
to these questions will help us help you.



thnx so much.
got some ideas of how to start now.



> Is this the extent of the description of the program you wish to
> create? It would help me if you could provide a more complete
> description, as Bob Gardner suggested in his response.
>
> If you are using a 68HC11A or E series device, you will not be able
> to drive 8 LEDs with it - not all of the Port A lines can be
> configured as outputs. Lines PA3 thru PA7 can be configured as (or
> are permanantly set as) outputs, but PA0, PA1 and PA2 are input-
> only. This is not the case with all HC11's - for example, the
> MC68HC11F1 can be configured to use all 8 Port A lines as outputs.
>
> If you are just getting started, you should go to the
> Motorola/Freescale website and download the M68HC11 Reference
Manual
> and assimilate as much of its contents as you can.. It sounds like
> you have already started to study the instruction set, which is a
> good thing. The next thing you should read about are the
> descriptions of the way the I/O ports work and perhaps the timer
> subsystem. Don't worry too much about the 'handshake modes'
offered
> for Port B and Port C - these modes are not often used and probably
> would not be of much use to you in your application.
>
> Break down the task you want to perform into small sub-sections,
> small enough so the solution for each is fairly obvious. Don't
> worry too much if there are some tasks you do not know how to do,
> like "how do I delay a tenth of a second" or "how do I read my
> pushbuttons reliably". These are topics that we can help you
with.
> But we can't write the entire program for you, and even if we
could,
> it would do you little benefit to have someone else do it for you,
> as you would not learn nearly as much.
>
> It would be helpful if you could describe for us what sort of
> hardware platform you are using. Will you be building the entire
> system, including the HC11 and support hardware yourself? Or are
> you using a pre-built 'evaluation board' that you only need to add
> your LEDs and switches to? Will you be using (or does your eval
> board have) external RAM and ROM/EEPROM/FLASH, or will you be using
> the HC11 in 'single chip' mode? Will you be using the MC68HC(7)
11Ex
> device, or a different HC11 variant, like the MC68HC11F1? Answers
> to these questions will help us help you.
Yeah I have just started learning the assembly language from my
college 5 weeks ago. Since I am only a beginner I am not quite sure
what system we are running this. I did not know there were different
series of 68HC11 such as A or E.

I programme using a software package called "THRsim11". I am using a
pre-built 'evaluation board' that only need LEDs and switches. This
is run using single mode, using the built in rams.

This is the information I know for now
But I got some ideas from reply that Bob Gardner has written.
Thnx for your time. I appreciate it.
Ryan



--- In , "cheol1217" <cheol1217@y...> wrote:
> Yeah I have just started learning the assembly language from my
> college 5 weeks ago. Since I am only a beginner I am not quite
> sure what system we are running this. I did not know there were
> different series of 68HC11 such as A or E.
>
> I programme using a software package called "THRsim11". I am using
> a pre-built 'evaluation board' that only need LEDs and switches.
> This is run using single mode, using the built in rams.

Ok, thanks for the info.

Based on what you've described above, I would recommend that you use
PORT B to control your LEDs and PORT E (or perhaps PORT C) for your
switches. PORT A is not a good choice for control of 8 LEDs, for
reasons I discussed earlier.

Note that the HC11 cannot source or sink sufficient current on its
output pins to drive LEDs directly, so you will need to use
transistors or some other power-driver IC (such as a ULN2803) to
interface the LEDs to the HC11 port. Let me know if you are having
any difficulties on the hardware side.

Follow Bob's (and my) advice, try to solve at least some of your
problems in small pieces, and get back to us if you encounter any
problems.

-- Mark


Hi, I managed to get input from three different switches and control
the LEDS without using interrupt. When I run this program step by
step there is no problem, however if I run the program automatically
I can press a switch only in the first time and programme just ends
somehow. I think I need some kind of time control using time
interrupts, but it seems so hard understand. Can you plz give me some
hints how to do it.
thnx!
Ryan

----below are main part of the code---------------

LIST FCB $9E,$9D,$9B,$97,$8F,$BF,$DF,$1F
LIST2 FCB $1E,$DD,$BB,$87,$87,$BB,$DD,$1E
LIST3 FCB $9F,$60,$9F,$60,$9F,$60,$9F,$60
START LDX #REGBS ; register base
address

BCLR SPCR,X,%00100000 ; disable WOM outputs
LDAA #%11111111 ; enable SRAM (CE2)
and select banks
STAA BANKSR ; select banks (Flash
and RAM)

; RTI vector to 00EB: 7E,00,00 (for Buffalo)

LDD #RTI ; setup interrupt
vector in RAM
STD $00EC ; just part of
Buffalo
LOOP LDAA #%11111000 ; make 3 lower bit of
Port-A inputs
STAA DDRA,X

BRCLR PORTA,X 1 MODE1
BRCLR PORTA,X 2 STOP
BRCLR PORTA,X 4 STOP
BRA LOOP

MODE1 LDAA #%11111111 ; make ALL bits output
STAA DDRA,X
LDY #LIST
RUN1 LDAA 0,Y
STAA PORTA,X

LDX #$00FF ; delay
T1 DEX
BNE T1 ; delay loop

INY
CPY #$3008
BNE RUN1
BRA LOOP

STOP JMP $8000

----this is the whole code-------------------- ; EQUATES - SYSTEM - RAM - ROM -
EEPROM *
;
*
;********************************************************************
****
;
SYSTEM ; *
REGBS EQU $1000 ; START OF REGISTERS x000
to x05F
CSIO1 EQU $1600 ; bank select address x600
to x7FF
CSIO2 EQU $1800 ; external chip select x800
to xFFF
RAM EQU $0000 ; START OF CPU RAM 0000
to 3FFF
FLS_SA EQU $8000 ; START OF FLASH 8000
FLS_EA EQU $0FDFF ; END OF FLASH FDFF
EEP_SA EQU $0FE00 ; START OF EEPROM FE00
EEP_EA EQU $0FFFF ; END OF EEPROM FFFF

;********************************************************************
****
; REGISTER
* *
;********************************************************************
****

PORTA EQU $00 ; PORT A
DDRA EQU $01 ; PORT A DDR
PORTG EQU $02 ; PORT G
DDRG EQU $03 ; PORT G DDR
PORTB EQU $04 ; PORT B
PORTCL EQU $05 ; PROT C LATCHED DATA REG.
DDRC EQU $07 ; DATA DIRECTION REGISTER C
PORTD EQU $08 ; PORT D
DDRD EQU $09 ; DATA DIRECTION REGISTER D
PORTE EQU $0A ; PORT E
CFORC EQU $0B ; TIMER COMPARE FORCE REG.
OC1M EQU $0C ; O/P COMPARE 1 MASK REG.
OC1D EQU $0D ; O/P COMPARE 1 DATA REG
TCNT EQU $0E ; TIMER COUNT H
TCNTL EQU $0F ; L
TIC1 EQU $10 ; TIMER O/P COMPARE 1 H
TIC1L EQU $11 ; 1 L
TIC2 EQU $12 ; 2 H
TIC2L EQU $13 ; 2 L
TIC3 EQU $14 ; 3 H
TIC3L EQU $15 ; 3 L
TOC1 EQU $16 ; TIMER O/P COMPARE 1 H
TOC1L EQU $17 ; 1 L
TOC2 EQU $18 ; 2 H
TOC2L EQU $19 ; 2 L
TOC3 EQU $1A ; 3 H
TOC3L EQU $1B ; 3 L
TOC4 EQU $1C ; 4 H
TOC4L EQU $1D ; 4 L
TOC5 EQU $1E ; 5 H
TOC5L EQU $1F ; 5 L
TCTL1 EQU $20 ; TIMER CONTROL REG 1
TCTL2 EQU $21 ; TIMER CONTROL REG 2
TMSK1 EQU $22 ; TIMER MASK 1
TFLG1 EQU $23 ; TIMER FLAG 1
TMSK2 EQU $24 ; TIMER MASK 2
TFLG2 EQU $25 ; TIMER FLAG 2
PACTL EQU $26 ; PULSE ACCUMULATOR CONT. REG.
PACNT EQU $27 ; PULSE ACCUMULATOR COUNT REG.
SPCR EQU $28 ;
SPSR EQU $29 ;
SPDR EQU $2A ;
BAUD EQU $2B ; SCI BAUD REG
SCCR1 EQU $2C ; SCI CONTROL 1 REG
SCCR2 EQU $2D ; SCI CONTROL 2 REG
SCSR EQU $2E ; SCI STATUS REG
SCDR EQU $2F ; SCI DATA REG
ADCTL EQU $30 ;
ADR1 EQU $31 ;
ADR2 EQU $32 ;
ADR3 EQU $33 ;
ADR4 EQU $34 ;
BPROT EQU $35 ;
OPTION EQU $39 ; OPTION REG
COPRST EQU $3A ; COP RESET REG
PPROG EQU REGBS+$3B ; EEPROM PROG REG
HPRIO EQU $3C ; HPRIO REG
INIT EQU $3C ; INIT
CONFIG EQU $3F ; CONFIG REG
CSSTRH EQU $5C ; CS CYCLE STRETCH
CSCTL EQU $5D ; CS CONTROL
CSGADR EQU $5E ; GENERAL PURPOSE CS (RAM)
CSGSIZ EQU $5F ; GENERAL PURPOSE CS SIZE
BANKSR EQU $1600 ; BANK SELECT REGISTER

;********************************************************************
****
; CONSTANTS
* *
;********************************************************************
****

PIEZO EQU %00010000 ; EVB_3A piezo output (D4)
TDRE EQU $80
RDRF EQU $20
MDA EQU $20
SMOD EQU $40
MS10 EQU 10000/3
US500 EQU 500/3

; MEMORY

; DFB " rti_example1.asm V1.00 02 August 2003 "
; DFB " (c) 2002 PMB "

; Variables in zero-page RAM

RTICNT EQU $0006 ; Counter for dump routine
TEMP1 EQU $0007 ; 2 ; Temp variable 1
FLAGS1 EQU $0009 ; status flags

BANKSS EQU $0013 ; bank select register main
copy
BANKST EQU $0014 ; bank select register temp
copy

ORG $3000
LIST FCB $9E,$9D,$9B,$97,$8F,$BF,$DF,$1F
LIST2 FCB $1E,$DD,$BB,$87,$87,$BB,$DD,$1E
LIST3 FCB $9F,$60,$9F,$60,$9F,$60,$9F,$60

;********************************************************************
****
;************; P R O G R A M S T A R T S H E R E
********************
;********************************************************************
**** ; INITIALISATION ROUTINE

ORG $2000 ; initial RAM address

;************
; INITALISATION

START LDX #REGBS ; register base
address

BCLR SPCR,X,%00100000 ; disable WOM outputs
LDAA #%11111111 ; enable SRAM (CE2)
and select banks
STAA BANKSR ; select banks (Flash
and RAM)

; RTI vector to 00EB: 7E,00,00 (for Buffalo)

LDD #RTI ; setup interrupt
vector in RAM
STD $00EC ; just part of
Buffalo

;************
; SET & ENABLE REAL TIME INTERRUPT
; PACTL = nnnnnn10 AT 8 MHz FOR 16.38 mS
; PACTL = nnnnnn01 AT 4 MHz FOR 16.38 mS
; PACTL = nnnn1nnn = DDRA BIT 3 (1=OUTPUT)

BSET PACTL,X,%00001011 ; set slowest RTI rate
BSET TMSK2,X,%01000000 ; enable RTI interrupt
; delay
LDAA #$11 ;01 ; preset RTI cycle
counter
STAA RTICNT ; "
*************

LOOP LDAA #%11111000 ; make 3 lower bit of
Port-A inputs
STAA DDRA,X

BRCLR PORTA,X 1 MODE1
BRCLR PORTA,X 2 STOP
BRCLR PORTA,X 4 STOP
BRA LOOP

MODE1 LDAA #%11111111 ; make ALL bits output
STAA DDRA,X
LDY #LIST
RUN1 LDAA 0,Y
STAA PORTA,X

LDX #$00FF ; delay
T1 DEX
BNE T1 ; delay loop

INY
CPY #$3008
BNE RUN1
BRA LOOP

STOP JMP $8000
;************
; other initalisation

CONT BSET DDRD,X,PIEZO ; make piezo an
output
LDAA #%11111111 ; make Port-A all
outputs
STAA DDRA,X ; "
LDY #LIST
STY $3500
CLI ; enable all
interrupts

; This is the foreground function.

;************
; Pulse the PIEZO buzzer

TESTB LDX #$1000 ; register base address
TSTB1 BRSET PORTD,X,PIEZO,TSTB2 ; check PIEZO
;BSET PORTD,X,PIEZO ; PIEZO = on
BRA TSTB3
TSTB2 BCLR PORTD,X,PIEZO ; PIEZO = off
TSTB3 LDY #$0FFFF ; delay
TSTB4 DEY
BNE TSTB4 ; delay loop
BRA TSTB1 ; next cycle ; RTI -- service routine, occurs everyEVERY 16.384mS. Used for
timing
;*********************************************************************
***
;*********************************************************************
***
;*********************************************************************
***

RTI SEI
LDX #REGBS ; load for indexed
addressing
LDY $3500
BSET TFLG2,X,%01000000 ; clear RTI interrupt
flag

;************

DEC RTICNT ; update interrupt
counter
BNE RTI_99 ; no yet ready

;************
; safety check
TST PORTA,X ; test Port-A
BNE RTI_0 ; ok, continue
INC PORTA,X ; oops, fix Port-A
RTI_0 CPY #$3008 ; reach to the end of
LIST?
BEQ RTI_1 ; Yes, start again
LDAA 0,Y ; no, read data
STAA PORTA,X ; send to PortA
INY ; next data
STY $3500
BRA RTI_98
RTI_1 LDY #$3000
STY $3500 ; right
RTI_98 LDAA #80 ; reset delay counter
STAA RTICNT ; "

RTI_99 RTI ; finished, return
from interrupt

;*********************************************************************
***
;*********************************************************************
***
;*********************************************************************
***
;*********************************************************************
***
;*********************************************************************
***

END



Hi Ryan,

you kill the x register in

CW> LDX #$00FF ; delay
CW> T1 DEX
CW> BNE T1 ; delay loop

but you need it later in Loop. So do: CW> LOOP LDAA #%11111000 ; make 3 lower bit of
CW> Port-A inputs
LDX #REGBS ; register base
CW> STAA DDRA,X

also, for moving code (question of stile):
CW> INY
CW> CPY #$3008 ; not good - better
cpy #LIST + 8
CW> BNE RUN1
CW> BRA LOOP Werner


--- In , "CW" <cheol1217@y...> wrote:
> Hi, I managed to get input from three different switches and
> control the LEDS without using interrupt. When I run this program
> step by step there is no problem, however if I run the program
> automatically I can press a switch only in the first time and
> programme just ends somehow. I think I need some kind of time
> control using time interrupts, but it seems so hard understand.
> Can you plz give me some hints how to do it.

I have taken a look at the code you posted, and have noted a few
problems. Some of the 'problems' I discuss here are merely matters
of style; but there are also some bonafide bugs that I have found as
well.

- Near label "LOOP" you have a LDAA #%11111000 / STAA DDRA,X
sequence. Are you sure that your HC11 variant has a DDRA? The HC11
A and E series parts do NOT provide a DDRA register; the direction
of most Port A bits is fixed (excepting PA3 and PA7, which are
controlled via the PACTL register).

- Near label "START" you initialize the RTI pseudo-vector. For sake
of completeness, and to allow your program to run in debug
environments other than BUFFALO, it is 'good practice' to initialize
the JMP instruction opcode as well. You should add a LDAA #$7E /
STAA $00EB sequence to your init code.

Also, as a matter of style, you should declare a symbol that
contains the location of the RTI pseudo-vector, and use it instead
of a literal constant, like this:

RTIVEC EQU $00EB ;RTI pseudo-vector
...
LDAA #$7E ;JMP instruction opcode
STAA RTIVEC ;Place in RTI pseudo-vector location
LDD #RTI ;Address of RTI ISR
STD RTIVEC+1 ;Copy to RTI pseudo-vector

- It appears as if you are attempting to use Port A to both read
your switches and control LEDs. This would be OK if you had only
buttons attached to PA0-PA2, and LEDs only attached to PA3-PA7.
Based on what I see in your code, it appears as if you have both
LEDs and switches attached to PA0-PA2, which is not a Good Thing.
Also, unless you happen to be using a 'HC11F1 device, PA0-PA2 are
input-only (see comment regarding DDRA above). If you ARE using a
F1, when you configure DDRA to set PA0-PA7 as outputs, your button
(s), if pressed, will attempt to force a OUTPUT line to a fixed
state - you could damage the pin drivers for those ports if the
output level (as set by PORTA) conflicts with the level that the
switches are trying to assert when they are pressed.

It would be much better if you moved your pushbutton switches to a
different port, say, Port E (any port capable of being configured as
an input port will do).

- Near label "T1" you initialize the X register to $00FF and use it
as a delay counter. After the delay is complete, you jump to LOOP,
which contains code that assumes that X is equal to REGBAS. You
should make sure you re-initialize X to REGBAS following your delay
routine. Better yet, add a LDX #REGBS instruction at the start of
the LOOP routine.

In this same block of code, you check for the end-of-table condition
using 'CPY #$3008'. It would be better (as a matter of good style)
to change this to 'CPY #LIST+8' - or, better yet, declare your table
like this:

LIST FCB $9E,$9D,$9B,$97,$8F,$BF,$DF,$1F
ENDLIST EQU *

and change the CPY end-of-table check to 'CPY #ENDLIST'. This way,
if you decide to change the length of the table, your code
will 'automagically' adjust the address that the CPY instruction
checks for. You can use this same 'trick' for your tables LIST1 and
LIST2 - add symbols such as 'ENDLIST1' and 'ENDLIST2', declared as
shown above for 'ENDLIST'.

- In various sections of your code, I note that you sometimes
perform a 'LDX #$1000' instead of a 'LDX #REGBS'. As a matter of
good style, you should always use the symbolic constant REGBS when
you want X to point to the register page.

- In your 'RTI' ISR, you use the instruction BSET TFLG2,X,%01000000
to clear the RTIF bit. This instruction WILL clear the RTIF, but as
a side-effect of the read-modify-write mechanisim used by the BSET
instruction, you will wind up clearing any other flag bit that is
set in TFLG2. The BSET instruction works internally like this: the
location specified by the first operand (TFLG2 in this case) is
read, the value read is ORed with the mask operand you specify, and
the result of the OR operation is written back to the same address
(TFLG2). If you think this through, and recognize that bits in
TFLG2 are RESET when a 1-bit is written to them, you will come to
see that any bit set in TFLG2 will be cleared after the BSET
instruction is executed. Since you are only using the RTI
interrupt, the BSET as you have coded it will not have any adverse
effects, but if you later decide to utilize the other interrupt
sources that TFLG2 annunciates, the BSET in your RTI routine is
going to cause intermittent, difficult-to-track problems.

The solution to this problem is quite simple. Replace the BSET
instruction with 'BCLR TFLG2,X,%10111111'. This at first glance
appears to be a bit odd, but again, if you consider how the BCLR
instruction works internally, and the nature of the clearing
mechanisim used by TFLG2, the BCLR instruction I show above does the
job. Here's how it works: Upon entry to the 'RTI' ISR, bit 6 of
TFLG2 (RTIF) will be set. When the BCLR instruction is executed,
TFLG2 is read (the value will be %x1xxxxxx x=unknown). The value
read from TFLG2 is ANDed with the 1's compliment (inverted) value of
the mask you specify - in this case, %10111111 inverted is %
01000000. The result of this AND operation will be %01000000,
assuming RTIF is set. This value is then written to TFLG2, which
has the result of clearing RTIF but leaving all the other bits
unchanged. If, by some odd chance RTIF was not set, the result of
the AND operation will be %00000000, which will leave TFLG2
unchanged.

Using BSET instead of BCLR to clear flag-register bits is a common
mistake made by beginning HC11 programmers.

- The SEI instruction at the start of your 'RTI' ISR is unnecessary -
the HC11 interrupt service logic automatically sets the interrupt-
disable bit when an interrupt is serviced. The I-flag in the status
register will be restored to its original state when it is popped
off the stack by the RTI instruction.

- If I understand what you are trying to do in your RTI routine
correctly, it appears as if you wish to iterate through a LED
control table, loading one element from the table and storing it to
the LED control port every time RTICNT counts down to 0. In this
routine, you make numerous references to non-symbolic addresses and
constants - this is not very good practice.

You could make your RTI LED-control routine truly flexible by making
a few simple changes. First, declare these variables at the start
of your code:

LISTST EQU $3500 ;Start of active LED control table
LISTEND EQU $3502 ;End of active LED control table +1
LISTPTR EQU $3504 ;Current location in control table
RTICNT EQU $3506 ;RTI delay counter; LED pacing

In your main code, initialize these variables to the start and end
of the LED control table you want to use:

LDD #LIST ;Set start-of-table address
STD LISTST
STD LISTPTR ;Also init table pointer
LDD #LISTEND ;Set end-of-table address
STD LISTEND

When you wish to 'activate' a different LED control table, say, when
a different button is pressed, all you have to do is repeat the code
above, substituting the appropriate start and end of table addresses
for the ones shown above (e.g. LIST1/LIST1END, LIST2/LIST2END, etc.)

In your RTI ISR, iterate through the active LED control table like
this:

RTI LDX #REGBS ;Point to control registers
BCLR TFLG2,X,%10111111 ;Clear RTIF
DEC RTICNT ;Decrement delay
BNE RTIX ;Exit if delay not complete

LDY LISTPTR ;Get current list pointer
INY ;Point to next element
CPY LISTEND ;End of list ?
BLO RTI1 ; No, continue
LDY LISTST ; Yes, reset to start of list

RTI1 STY LISTPTR ;Save updated list pointer
LDAA 0,Y ;Get control byte from list
STAA PORTA,X ;Write to LED control port

LDAA #80 ;Reset delay count
STAA RTICNT ;

RTIX RTI ;Exit - One last note. It appears as if the code starting at label 'CONT'
up through to the start of your RTI ISR is not used for anything -
it is never referenced. I assume this is an alternative test
routine you wrote - Am I correct?

Hope this helps you out.

-- Mark