Chaitanya Varma D
Newbie level 4
- Joined
- Sep 21, 2013
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 74
HI there,
any help would be appreciated..
I am trying to read from the AD0831 ADC through the SPI inteface in proteus lite sim . It seems that I have set the correct flags and every thing but the ADC doesnot communiccate with the micocontroller at all.
This is my configuration:
SCK is RC3
SDI is RC4
SS is RA5.
I think the algorithm for reading from an external device is :
1. first make the SSbar low and the ADC conversion starts and then,
2. and then make a loop such that the SSPSTATbits.BF is set.
3. and then move the content of SSPBUF to another register
4. clear SSPBUF and
5. make SSBAR high....
this is the algorithm i am following to implement the SPI read....
I donot know where am I going wrong...
Please let me know if I have to make any modification in the circuit..
attached in the text file is the code ...
and the file extensions foe datasheet.......
Thanks in advance....
View attachment SPI_READ_CODE.txt
and the datasheet links are.....
https://ww1.microchip.com/downloads/en/devicedoc/41159d.pdf
https://www.ti.com/lit/ds/symlink/adc0831-n.pdf
any help would be appreciated..
I am trying to read from the AD0831 ADC through the SPI inteface in proteus lite sim . It seems that I have set the correct flags and every thing but the ADC doesnot communiccate with the micocontroller at all.
This is my configuration:
SCK is RC3
SDI is RC4
SS is RA5.
I think the algorithm for reading from an external device is :
1. first make the SSbar low and the ADC conversion starts and then,
2. and then make a loop such that the SSPSTATbits.BF is set.
3. and then move the content of SSPBUF to another register
4. clear SSPBUF and
5. make SSBAR high....
this is the algorithm i am following to implement the SPI read....
I donot know where am I going wrong...
Please let me know if I have to make any modification in the circuit..
attached in the text file is the code ...
and the file extensions foe datasheet.......
Thanks in advance....
View attachment SPI_READ_CODE.txt
and the datasheet links are.....
https://ww1.microchip.com/downloads/en/devicedoc/41159d.pdf
https://www.ti.com/lit/ds/symlink/adc0831-n.pdf