by eswallace » Thu Jul 28, 2016 4:28 pm
I am using the pic32mx795f512l model processor with MPLAB X 3.0 and an ICD 3 programmer. I am trying to set up a MCP6S93 PGA to a gain of +1V/V. I must use the SPI on the PIC to communicate with the IC but I am having trouble. I have searched the forum and tried different recipes, but to no avail. Looking at the data sheet, I need to set the CS to low, then write a 01000000 to set the instruction register to write to register mode (010). I then need to a write a 00000000 to set the gain register to +1V/V and finally choose CH0 in the channel register with another 00000000. I then need to set CS back to high. I am a bit of a PIC noob and would love some help.