why doesnt this code work on my AT91RM9200 (newbie)

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

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


Site Timeline