logo       

Re: Reading from 38000 in assembler: msg#00714

hardware.microcontrollers.tini

Subject: Re: Reading from 38000 in assembler



Andreas Steibl wrote:
Hi, i just tried to write some code in assembler.
Compiling and executing the code from the JAVA file workes fine, but i
didn't get the correct result.


this is the working code in java


keyPort = new com.dalsemi.system.DataPort(0x380000);
keyPort.setFIFOMode( true );
keyPort.setStretchCycles(DataPort.STRETCH10);
keyPort.read()


and the not working code in assembler code : (allways getting 249)

readKey:
WOS_DISABLE_INTERRUPTS
TIMEDACCESS
ANL MCON,#11110000B

orl CKCON, #00000111b

mov dptr, #380000h

movx a, @dptr

TIMEDACCESS
orl mcon,#00001111B
WOS_ENABLE_INTERRUPTS

mov R0, a
clr a
mov R1, a
mov R2, a
mov R3, a

ret




Why are you changing the MCON register?

Your DataPort code indicates you are working in CE space (address 0x380000) and not PCE space (address 0xb80000=0x380000+0x800000... See DataPort JavaDoc). I do not believe you need to touch MCON to access this address.

You should also save and restore the CKCON register if you change it's value.



--
Tom Chenot
Dallas Semiconductor
http://www.dalsemi.com
--

_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/hBDgjK7y7TUQ@xxxxxxxxxxxxxxxx
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise