Sending 8-bits of serial data for D/A convertor
Posted: Wed Jun 07, 2006 9:21 am
Hi
Does anyone have any examples on how to send serial data out of a port in C. In the manual it tells you to use
SPI mode (SD0)RC5 to send serial data out of a port but I am not sure how you do this in 'C' ?
I assumed that you would need a loop routine simliar to what I have done but how do you shift the bit out of the port
with each clock cycles falling edge ?
#include <system.h>
int serial;
int i;
char main()
{
set_tris_b(0x00);
for(i=0;i==8;i++)
{
serial=10101010b; //set 8-bits to be outputed
}
any help greatly recieved
Dave
Does anyone have any examples on how to send serial data out of a port in C. In the manual it tells you to use
SPI mode (SD0)RC5 to send serial data out of a port but I am not sure how you do this in 'C' ?
I assumed that you would need a loop routine simliar to what I have done but how do you shift the bit out of the port
with each clock cycles falling edge ?
#include <system.h>
int serial;
int i;
char main()
{
set_tris_b(0x00);
for(i=0;i==8;i++)
{
serial=10101010b; //set 8-bits to be outputed
}
any help greatly recieved
Dave