why doesnt this code work on my AT91RM9200 (newbie)
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
why doesnt this code work on my AT91RM9200 (newbie)

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System
Author Message
funkymunky
Guest





Posted: Fri Dec 31, 2004 5:16 pm    Post subject: why doesnt this code work on my AT91RM9200 (newbie) Reply with quote

Hi,

Im an undergrad student, and a newbioe to the ARM. Im working on a
board based on the AT91RM9200 uC. Im relying on the default boot
program, and im using the xmodem protocol to load the foll. program
thru hyperterminal. Im just sending a nibble to the I/O pins, expecting
to verify the effect with a multimeter. but this isnt working:

#include <stdio.h>
int main()
{
__asm
{
start:MOV r1, #0xFFFFF800 //PIO C
MOV r0,#0xF //only the last 4 pins needed
STR r0, [r1] //send to PIO_PER
MOV r0, #0
STR r0, [r1, #0x4] //send to PIO_PDR
MOV r0, #0xF //output enabled on last 4 pins
STR r0, [r1, #0x10]//send to PIO_OER
MOV r0, #0
STR r0, [r1, #0x14] //send to PIO_ODR
MOV r0, #0xF //sync output on last 4 pins
STR r0, [r1, #0xA0] //send to PIO_OWER
MOV r0, #0
STR r0, [r1, #0xA4] //send to PIO_OWDR
MOV r0, #0xA
STR r0, [r1, #0x38] //send this to the pins
loop: B loop //infinite loop
}
}

after this ->

armcc -c test.c
armlink test.o -o test.axf
fromelf test.axf -bin -o test.bin

then i load this bin file onto the controller. But nothing
happens..whats going on :-(

thanx in anticipation
Mayank
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System All times are GMT
Page 1 of 1

 
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 vote in polls in this forum




VoIP Electronics Powered by phpBB