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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/24/02 15:21
Read: times


 
#19070 - RE: port 0 and external memory use
Hi again,

Well I think I've figured it out...
When I want to write to the DAC which is chip enabled by
ANDing 'ALE' and 'Y3' on a decoder :

I set Y3 to high (in my case pull pins P1.1 and P1.2 high)

Then any external write to memory (I'm writing this in C mostly)
will apply the required data to the latch of the DAC.

So the following should do what I want? ::

XDATA BYTE dac_dummy;
WORD16 dac_var_12bit;
.
.
P1 &= 0xf1; // clear P1.1, P1.2, P1.3
P1 |= 0x06; // set P1.1, P1.2

dac_dummy = (BYTE) WRITE_LOW_NIBBLE | (dac_var_12bit&0x000f);
dac_dummy = (BYTE) WRITE_MID_NIBBLE | ((dac_var_12bit&0x00f0)>>4);
dac_dummy = (BYTE) WRITE_HIGH_NIBBLE | ((dac_var_12bit&0x0f00)>>8);
dac_dummy = (BYTE) LOAD_DAC_REGISTER;

P1 &= 0xf1; // reset P1.1, P1.2, P1.3
.
.

Thanks for your help - hopefully that's it??

Kev


List of 13 messages in thread
TopicAuthorDate
port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      
RE: port 0 and external memory use            01/01/70 00:00      

Back to Subject List