Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Bit-bang SPI

2007-05-31 by BobGardner@aol.com

> Can anyone point me to a bit-bang SPI example? 

=============================================
#define DATHI() PORTB |= 0x01;
#define DATLO() PORTB &= ~0x01;
#define CLKHI() PORTB |= 0x02;
#define CLKLO() PORTB &= ~0x02;

void bb(char n){
unsigned char msk;

  msk=0x80;
  while(msk){
    if(msk & n) DATHI(); else DATLO();
    CLKHI();
    CLKLO();
    msk >>=1;
  }
}





________________________________________________________________________
AOL now offers free email to everyone.  Find out more about what's free from AOL at AOL.com.


[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.