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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/12/03 01:26
Read: times


 
#38836 - RE: use MOVC in p89c668
Responding to: ???'s previous message
Frank:
I am presuming you are trying to move the data to the onboard XDATA space. This memory is disabled out of reset on the 'C668. You have to put a zero into the EXTRAM bit in order to access the onboard XDATA ram. This bit is AUXR.1 which is at the SFR address of 0x8E. See figure 53 of the 'C668 data sheet.

Also note that the 'C668 has two DPTRs. These are particularly handy when doing what you are trying to do. There is a bit called DPS which is AUXR1.0 at SFR address 0xA2. To make use of the dual data pointers you setup a loop like....

a) Clear DPS bit.
b) Load DPTR with #bytes like your sample program.
c) Set DPS bit.
d) Load DPTR with #data_buffer like in your program
e) Load R2 with #size of string.
f) Top of loop
g) Clear DPS bit
h) use MOVC instruction to fetch source byte to A. (i.e CLRA followed by MOVC A,@A+DPTR)
i) Increment DPTR
j) Set DPS bit
k) use MOVX instruction to transfer byte to destination. (i.e. MOVX @DPTR,A)
l) Increment DPTR
m) loop till done. (i.e DJNZ R2,TopOfLoop)
n) Finished!!

Michael Karas


List of 4 messages in thread
TopicAuthorDate
use MOVC in p89c668            01/01/70 00:00      
   RE: use MOVC in p89c668            01/01/70 00:00      
   RE: use MOVC in p89c668            01/01/70 00:00      
   RE: use MOVC in p89c668            01/01/70 00:00      

Back to Subject List