Quick Question
Got the LEDS working, but I am still having trouble using the switches...
I wrote a separate program to help me understand how they work, but I am having some trouble.
Code synopsis
When switch one is pressed I want all the LEDS to light up.
And now without any more delay... Here's the code I have so far:
AREA ledsnswitches, CODE, READWRITE
ENTRY
LDR r0,=0xFFFF0000 ;Load PIO
LDR r1,=0xFFFF0010 ;Load PIO enable
LDR r3,=0xFFFF0030 ;Load PIO set
LDR r4,=0xFFFF0034 ;Load PIO clear
LDR r5,=0xFFFF003C ;Load PIO Pin Status
LDR r6,=0xF127E ;Swtiches and Leds
LDR r7,=0xF0078 ;LEDS
LDR r8,=0x1206 ;Switches
LDR r9,=0x1 ;SW1
STR r6,[r0]
STR r6,[r1]
start STR r7,[r3] ;turn leds off
TEQ r5,r8 ;check for switches pressed
STREQ r7,[r4] ;turn on all LEDS if a switch is pressed
B start ;loop forever
END
But it is not working... What do I need to adjust?
Thanks in advance for your help...
Psyberbob
