Setting up SPI for the MCP6S93

Setting up SPI for the MCP6S93

Postby 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.
eswallace
 
Posts: 3
Joined: Thu Jul 28, 2016 4:23 pm
PIC experience: Professional 1+ years with MCHP products

Re: Setting up SPI for the MCP6S93

Postby ric » Thu Jul 28, 2016 11:04 pm

Are you working in C, or assembler?
Are you using Harmony?
My new leslie-special website (for fans of The Great Race) :)
User avatar
ric
Verified identity
 
Posts: 341
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: Setting up SPI for the MCP6S93

Postby eswallace » Fri Jul 29, 2016 2:08 pm

Writing in C, using MPLAB X 3.0. I am not using Harmony
eswallace
 
Posts: 3
Joined: Thu Jul 28, 2016 4:23 pm
PIC experience: Professional 1+ years with MCHP products

Re: Setting up SPI for the MCP6S93

Postby AussieSusan » Mon Aug 01, 2016 4:06 am

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
AussieSusan
Verified identity
 
Posts: 56
Joined: Mon Jun 16, 2014 4:45 am
PIC experience: Experienced Hobbyist


Return to SSP (IIC, SPI)

Who is online

Users browsing this forum: No registered users and 1 guest