Page 1 of 1

Setting up SPI for the MCP6S93

PostPosted: Thu Jul 28, 2016 4:28 pm
by eswallace
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.

Re: Setting up SPI for the MCP6S93

PostPosted: Thu Jul 28, 2016 11:04 pm
by ric
Are you working in C, or assembler?
Are you using Harmony?

Re: Setting up SPI for the MCP6S93

PostPosted: Fri Jul 29, 2016 2:08 pm
by eswallace
Writing in C, using MPLAB X 3.0. I am not using Harmony

Re: Setting up SPI for the MCP6S93

PostPosted: Mon Aug 01, 2016 4:06 am
by AussieSusan
Show us the code including the config bits, and the SPI peripheral setup.
You say you are having trouble but not what that trouble is? Are you seeing the correct signals on the SCK and SDO lines?
Susan