Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/24/12 04:57
Read: times


 
#188429 - Brain Fade ?
Responding to: ???'s previous message
Rick Gebhardt said:


.org H'20
.db 1,2,3,4,5,6,7,8, 1,2,3,4,5,6,7,8 (16 bytes)

start: mov dptr,#H'20 (89C51's internal ram 0..FF)
mov R7,#H'10 (A51 compiler uses H'10)
loop: movx A,@dptr
mov P1,A (with leds on P1 and a delay, I could see the bytes)
inc dptr
djnz R7,loop
done: sjmp *


.db is going to place bytes in CODE/ROM, whilst MOVX reads from XDATA.
mov dptr,#H'20, then movx A,@dptr, is not going to read CODE.

XDATA also needs to be enabled
- so usually you would
* enable XDATA
* use MOVC to read Code/Flash
* use MOVX to write to XDATA
then
* Use MOVX to read XDATA.

Note you can set the 6440 to AutoINC the DPTR on most opcodes, and also use ALT DPTR opcodes to speed up transfers.



List of 17 messages in thread
TopicAuthorDate
.db instr does not work like before with movx A,@dptr            01/01/70 00:00      
   Brain Fade ?            01/01/70 00:00      
      memory access            01/01/70 00:00      
         Did you ever try the Maxim/Dallas DS89C4x0?            01/01/70 00:00      
   Handle the dptr with care...            01/01/70 00:00      
      Dallas, Dptr, and DB            01/01/70 00:00      
         not really            01/01/70 00:00      
            Perhaps what he means is ...             01/01/70 00:00      
               Make no mistake...             01/01/70 00:00      
                  and also the XMEGA            01/01/70 00:00      
                     XMEGA ADC            01/01/70 00:00      
                        I agree...            01/01/70 00:00      
               those samples that Andy and others were expecting             01/01/70 00:00      
            Is it 2007 already??            01/01/70 00:00      
               That's why I refer to them as MAXIM/DALLAS             01/01/70 00:00      
                  Part Numbers ?            01/01/70 00:00      
                     None in particular ...             01/01/70 00:00      

Back to Subject List