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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/03/05 06:25
Modified:
  08/03/05 06:28

Read: times


 
Msg Score: +1
 +1 Good Question
#98722 - explanation
Responding to: ???'s previous message
hi,

Kurnia Brahmana said:
When external memory is accessed, actually the uC sent 16 bit out from P0 and P2 at once.
mov dptr , #1234
mov @dptr, A
I think it is possible to use that capability of sending 16 bit address to be used as sending 16 bit data ?


There are some ways to do it.
1.1 By DPTR
MOV  DPL,#address ; 8-bit external address
MOV  DPH,#data_high_byte
MOV  A,#data_low_byte
MOVX @DPTR,A
;
1.2. By either @R0 or @R1
MOV  R0,#address  ; 8-bit external address
MOV  P2,#data_high_byte
MOV  A,#data_low_byte
MOVX @R0,A
;
In both cases above, an external hardware should latch
address from port 0 by ALE and catch data by /WR.
Limitation: both ways cannot be used for read 16-bit data.
;

2.1. By software-emulated sequence.
In this case you should re-route address latch signal
to a pin and pull-up all pins of the port 0.
;
; next line is required if address is locked
; with external flip-flops, for example, 74574.
CLR  Px.y  ; prepare address lock signal
MOV  P0,#address_low_byte
MOV  P2,#address_high_byte
SETB Px.y  ; latch/lock 16-bit address
; next two lines are required if address is latched
; with external D-latches, for example, 74573.
NOP
CLR  Px.y  ; keep address in external latch
MOV P2,#data_high_byte
MOV P0,#data_low_byte
CLR  P3.6  ; /WR emulation
NOP
SETB 3.6
;
;
3.1. By appropriate MCU.
Some MCU like AT89C5132, AT89C51SND1/SND2 has enchanted
external memory access mode called IDE/ATAPI interface.
This mode supports 16-bit data over 16-bit address
read and write cycles.


Regards,
Oleg

List of 19 messages in thread
TopicAuthorDate
Changing address to data ?, Opinion.            01/01/70 00:00      
   Not Possible Kurnia !            01/01/70 00:00      
   explanation            01/01/70 00:00      
      Good Answer,not Good Question            01/01/70 00:00      
   Ask Erik?            01/01/70 00:00      
      Ask Erik?            01/01/70 00:00      
         possible            01/01/70 00:00      
            Possible            01/01/70 00:00      
               re:possible            01/01/70 00:00      
               Students            01/01/70 00:00      
         Speed            01/01/70 00:00      
         Found it!            01/01/70 00:00      
   documentation            01/01/70 00:00      
   Yes, its a good idea !            01/01/70 00:00      
      If you do it that way            01/01/70 00:00      
         speed? really?            01/01/70 00:00      
            the source of this discussion was a post            01/01/70 00:00      
               addressed 16-bit movx write            01/01/70 00:00      
      Thank's for the opinion            01/01/70 00:00      

Back to Subject List