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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/07/02 13:56
Read: times


 
#24103 - using shift registers
An example for 16 inputs and 16 outputs:


char bdata dig_in[2];
char bdata dig_out[2] = {0};


char dig_shift( char b )
{
char i;
for( i = 8; i; i-- ){
DMOSI = b & 0x80; // high bit first
b += b;
if( DMISO )
b++;
DSCK = 0;
DSCK = 1;
}
return b;
}


void dig_update( void )
{
xDI_LOAD = 0; // load input register
xDI_LOAD = 1; // shift

dig_in[1] = dig_shift( dig_out[1] ); // high byte first
dig_in[0] = dig_shift( dig_out[0] );

DO_LOAD = 0;
DO_LOAD = 1; // load output register
}


Peter


List of 16 messages in thread
TopicAuthorDate
8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255 / kunal            01/01/70 00:00      
RE: 8255 / kunal            01/01/70 00:00      
using shift registers            01/01/70 00:00      
RE: using shift registers            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: 8255            01/01/70 00:00      
RE: using shift registers            01/01/70 00:00      

Back to Subject List