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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Jim Granville
09/23/12 22:57
Read: 580 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
* 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
.db instr does not work like before with movx A,@dptr      Rick Gebhardt      09/23/12 22:16      
   Brain Fade ?      Jim Granville      09/23/12 22:57      
      memory access      Rick Gebhardt      09/24/12 01:30      
         Did you ever try the Maxim/Dallas DS89C4x0?      Richard Erlacher      09/24/12 10:18      
   Handle the dptr with care...      Kai Klaas      09/24/12 10:38      
      Dallas, Dptr, and DB      Rick Gebhardt      09/24/12 21:36      
         not really      Erik Malund      09/25/12 08:50      
            Perhaps what he means is ...       Richard Erlacher      09/25/12 11:28      
               Make no mistake...       Kai Klaas      09/25/12 12:44      
                  and also the XMEGA      Jim Granville      09/25/12 23:36      
                     XMEGA ADC      Maarten Brock      09/26/12 03:00      
                        I agree...      Kai Klaas      09/26/12 17:18      
               those samples that Andy and others were expecting       Andy Neil      09/25/12 15:13      
            Is it 2007 already??      Andy Neil      09/25/12 15:17      
               That's why I refer to them as MAXIM/DALLAS       Richard Erlacher      09/25/12 21:52      
                  Part Numbers ?      Jim Granville      09/25/12 23:29      
                     None in particular ...       Richard Erlacher      09/26/12 16:01      

Back to Subject List