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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/11/03 19:32
Read: times


 
#48087 - RE: P89LPC932 w/ SPI
Responding to: ???'s previous message
Hi Craig,

Here is some small code that will write out on the SPI bus.

#include <Reg932.h>

void WriteSPI (unsigned char dat)
{
// write data to SPI bus
SPDAT = dat;
// wait for SPIF bit to be set
while ((SPSTAT & 0x80) == 0)
{
}

// Clear SPIF bit by writing 1 to it
SPSTAT |= 0x80;
}


void main(void)
{
// Set Port 2 to quasi-bidirectional
P2M1 = 0x00;
P2M2 = 0x00;

// Initialize SPI
SPCTL = 0xF7;

while (1)
{
WriteSPI(0x11);
WriteSPI(0x22);
WriteSPI(0x44);
WriteSPI(0x88);
}
}

Regards,

Bauke

List of 20 messages in thread
TopicAuthorDate
P89LPC932 w/ SPI            01/01/70 00:00      
   RE: P89LPC932 w/ SPI            01/01/70 00:00      
      RE: P89LPC932 w/ SPI            01/01/70 00:00      
         RE: P89LPC932 w/ SPI            01/01/70 00:00      
            RE: P89LPC932 w/ SPI            01/01/70 00:00      
         RE: P89LPC932 w/ SPI            01/01/70 00:00      
      RE: P89LPC932 w/ SPI            01/01/70 00:00      
         RE: P89LPC932 w/ SPI            01/01/70 00:00      
            RE: P89LPC932 w/ SPI            01/01/70 00:00      
               RE: P89LPC932 w/ SPI            01/01/70 00:00      
                  RE: P89LPC932 w/ SPI            01/01/70 00:00      
                     RE: P89LPC932 w/ SPI            01/01/70 00:00      
   TI TLV1570            01/01/70 00:00      
      RE: TI TLV1570            01/01/70 00:00      
         RE: TI TLV1570            01/01/70 00:00      
            RE: TI TLV1570            01/01/70 00:00      
            RE: TI TLV1570            01/01/70 00:00      
   RE: P89LPC932 w/ SPI            01/01/70 00:00      
      RE: P89LPC932 w/ SPI            01/01/70 00:00      
         RE: P89LPC932 w/ SPI            01/01/70 00:00      

Back to Subject List