Yoking
Newbie level 6
at89s8253 edaboard
check this c51 code example:
why the *ptr pointer parameter point to ROM data ,it work correctly!(no need to let
0=0xff)
but it work incorrectly when pointer point to external RAM?(Penomena:always missing the high four bits in one byte),but if adding that clause
0=0xff,it work correctly!!!
how to resolve the proble?cause P0 port has been occupied for another using in my circuit!
note:when i used the spi port to send data,i've encountered the same problem:i have to add this clause: P0=0xff!!
eagerly waiting for your help, thanks!
sbit clk=P1^7;
sbit dat=P1^5;
void shift(unsigned char code *ptr){
unsigned char c,temp1;
temp1=~*ptr;
for(c=0;c<8;c++){
if((temp1&0x80)==0)
{ dat=0;}
else
{ dat=1;}
clk=0;
_nop_();
_nop_();
// delay();
clk=1;
_nop_();
_nop_();
// delay();
temp1<<=1;
}
}
check this c51 code example:
why the *ptr pointer parameter point to ROM data ,it work correctly!(no need to let
but it work incorrectly when pointer point to external RAM?(Penomena:always missing the high four bits in one byte),but if adding that clause
how to resolve the proble?cause P0 port has been occupied for another using in my circuit!
note:when i used the spi port to send data,i've encountered the same problem:i have to add this clause: P0=0xff!!
eagerly waiting for your help, thanks!
sbit clk=P1^7;
sbit dat=P1^5;
void shift(unsigned char code *ptr){
unsigned char c,temp1;
temp1=~*ptr;
for(c=0;c<8;c++){
if((temp1&0x80)==0)
{ dat=0;}
else
{ dat=1;}
clk=0;
_nop_();
_nop_();
// delay();
clk=1;
_nop_();
_nop_();
// delay();
temp1<<=1;
}
}