* * ================================================================ * * dile2.asm Version 2, suitable for EEM on the Axiom CME11E9-EVBU * * 4 LEDs, 4 DIPS, blink the LEDS if depending on * the setting off the corresponding DIP. * * Lab or Demo for EE 348 at SDSU * * Bob Fourney * * Really need a separate power supply to hook ANYTHING to * these axiom boards. Need to disconnect vcc from extra * breadboard to reset in this config. * * ================================================================ * Hardware * 4 LEDs with cathodes connected thru 470 ohm resistor to ground * Each LED anode connected to one of PD2 PD3 PD4 PD5 * * Top of 10 K ohm resistor connected to Vcc. Bottom connected to * port E (0-3) and via a dip to gnd. So, switch "on" drags port E * pin low, switch "off" allows it to be pulled hi. * * Four Blinking Led's * Now using Port D bit 2 thru 5 * equates Led1: equ $04 ; PD2 selectt Led2: equ $08 ; PD3 select Led3: equ $10 ; PD4 select Led4: equ $20 ; PD5 select * REGBAS: equ $1000 ; register base (BRSET needs INDEXed add) PORTE: equ $0A ; PORT E input resister, relative to base PORTD: equ $08 DDRD: equ $09 ALLOUT: equ $FF ; $3F would also work, only 6 port D pins on E9 * * org $0100 ; for single chip mode (MOD A jumper installed) org $2000 ; for EMM, Mod A = Mod B = 0 * Main: ldx #REGBAS ; load X with register base ldaa #ALLOUT staa DDRD,X ; set bi directional Port D to all out bclr PORTD,x Led1+Led2+Led3+Led4 * turn all led's off * LED1ON: brset PORTE,X $01 LED2ON bset PORTD,x Led1 * turn led one on bsr Delay LED1OFF: bclr PORTD,x Led1 * turn led two off bsr Delay * Turn on Led Two LED2ON: brset PORTE,X $02 LED3ON bset PORTD,x Led2 * turn led two on bsr Delay * Turn off Led Two LED2OFF: bclr PORTD,x Led2 * turn led two off bsr Delay LED3ON: brset PORTE,X $04 LED4ON bset PORTD,x Led3 * turn led three on bsr Delay LED3OFF: bclr PORTD,x Led3 * turn led three off bsr Delay LED4ON: brset PORTE,X $08 Main bset PORTD,x Led4 * turn led four on bsr Delay LED4OFF: bclr PORTD,x Led4 * turn led 4 off bsr Delay bra LED1ON * loop forever * * Delay subroutine * Delay: pshy ; Y is not used elsewhere, but good practice ldy #$ffff DelayA: dey bne DelayA puly rts * return *