This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Direct bit I/O

I have a bit-addressable var (ibase) that I am loading with a value and then rotating--placing the msb on an I/O pin (SData). The SData pin never changes--it stays high. What am I doing wrong? Thanks!

for(i=0;i<8;i++)
{ SClock = 0;
SData = ibase^7;
ibase = _irol_(ibase,1);
delay();
SClock = 1;
timer0_delay(5);
}

Parents
  • "or I would not have asked such an (for you) elementary question."
    I didn't think it elementary. There is always new things to learn. The important thing is to stay and learn whenever you see something new.

    I have seen at least one person who had programmed in C (PC-class programs) for 10 years and did not know about the xor operator ^. He was 100% sure he new everything, but since he had never bothered to really read the language standard, and considered a book about C stupid to read, he just did not have any way to find out - he stumbled first when he got a piece of code written by someone else and couldn't decode the (as he thought) non-standard code. The situation would have been quite funny if it hadn't been such a traumatic experience for the poor sod ;)

Reply
  • "or I would not have asked such an (for you) elementary question."
    I didn't think it elementary. There is always new things to learn. The important thing is to stay and learn whenever you see something new.

    I have seen at least one person who had programmed in C (PC-class programs) for 10 years and did not know about the xor operator ^. He was 100% sure he new everything, but since he had never bothered to really read the language standard, and considered a book about C stupid to read, he just did not have any way to find out - he stumbled first when he got a piece of code written by someone else and couldn't decode the (as he thought) non-standard code. The situation would have been quite funny if it hadn't been such a traumatic experience for the poor sod ;)

Children