X4ROY
Newbie level 6
im trying to interface this 4 wire SPI based device AD7314 to a pic16f877a .
This IC sends 10 bit temperature data while the register (SSPBUF) where the received data is stored is 8 bit in size.
after the eighth bit of the 10 bits are received the BF flag (indicating SSPBUF is full) will go high .
now i dont mind loosing the last two bits .... but if i dont read the last two bits will the slave temp sensor continue sending data or will it stop ??
also please check my algorithm
1. initialize SSPSTAT , SSPCON1 , TRISC(data direction reg for PORTC)
2. start conversion SSPEN =1
3. load SSPBUF with address of configuration register
4. monitor BF
5. load SSPBUF with data of configuration register
6. monitor BF
i intend to set the continuous read mode
7. monitor BF if high
8. read 8 of 10 bit data store it in long int variable and display appropriately in LCD
9. goto step 7 and repeat forever
i use mplab ide ....... please help im stuck with this for a week ........
This IC sends 10 bit temperature data while the register (SSPBUF) where the received data is stored is 8 bit in size.
after the eighth bit of the 10 bits are received the BF flag (indicating SSPBUF is full) will go high .
now i dont mind loosing the last two bits .... but if i dont read the last two bits will the slave temp sensor continue sending data or will it stop ??
also please check my algorithm
1. initialize SSPSTAT , SSPCON1 , TRISC(data direction reg for PORTC)
2. start conversion SSPEN =1
3. load SSPBUF with address of configuration register
4. monitor BF
5. load SSPBUF with data of configuration register
6. monitor BF
i intend to set the continuous read mode
7. monitor BF if high
8. read 8 of 10 bit data store it in long int variable and display appropriately in LCD
9. goto step 7 and repeat forever
i use mplab ide ....... please help im stuck with this for a week ........