ismbn
Full Member level 3
- Joined
- Feb 11, 2012
- Messages
- 160
- Helped
- 4
- Reputation
- 8
- Reaction score
- 4
- Trophy points
- 1,308
- Location
- Mumbai. india
- Activity points
- 2,444
Hello All.
i am now for PIC microcontroller. I tried allot but the SPI is not working.
my aplication is take the data form MCP3550. and show on 4 digit 7 segment.
i am just getting the problem in communication between PIC16F887 and MCP3550.
please guide me how to make alive the communication between them.
this is the simple code the i an trying to read the data and show it on PORTD.
Please help me....
am i correct????
i am now for PIC microcontroller. I tried allot but the SPI is not working.
my aplication is take the data form MCP3550. and show on 4 digit 7 segment.
i am just getting the problem in communication between PIC16F887 and MCP3550.
please guide me how to make alive the communication between them.
this is the simple code the i an trying to read the data and show it on PORTD.
Please help me....
Code:
#include <pic.h>
void my_delay(char x)
{
char q,w;
for (q=0;q < 255; q++)
for(w=0;w<x;w++);
}
char x;
void main()
{
TRISC = 0b10010111;;
TRISA = 0x01;
TRISD=0;
SSPSTAT |= 0b10000000;
SSPCON |= 0b00100100;
while(1){
my_delay(10);
x = SSPBUF;
PORTD = x;
}
}