Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Now about those Switches...
PostPosted: Tue Jun 22, 2004 8:41 pm 
Offline

Joined: Fri Jun 18, 2004 3:47 pm
Posts: 7
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 :?


Top
 Profile  
 
 Post subject: Got it figured, thanks...
PostPosted: Wed Jul 07, 2004 4:39 pm 
Offline

Joined: Fri Jun 18, 2004 3:47 pm
Posts: 7
Figured it out... I was checking the wrong thing...
Anyway.. Thanks...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: