cancel
Showing results for 
Search instead for 
Did you mean: 

Using the ADC MCP3903 via the MCU STM32F072RBT6

Philip Westphal
Associate II
Posted on May 30, 2018 at 11:15

Hi there, I am new to this community and recently started using STM32 mcus. There is still alot I do not know about 

this subject so please bear with me. I am trying to get familiar with using these mcus and would therefore make

a simple datalogger using the STM32F072RBT6 in combination with the ADC MCP3903.

While I found a library for arduino, I could not find anything for STM.

http://www.kerrywong.com/2014/05/10/mcp3903-library/

  

-Does such a library exists? If not, Is it possible to convert it so that it can be used in the described combination?

-If that does not work either, do you know of a different ADC with similar capabilities where libraries already exist?

Thank you very much for your time and help.

1 ACCEPTED SOLUTION

Accepted Solutions
David SIORPAES
ST Employee
Posted on May 30, 2018 at 18:35

The library seems pretty easy to port to Cube environment.

Re-write the readRegister()/writeRegister() methods using HAL_SPI_TransmitReceive instead of SPI.Transfer() and use HAL_GPIO_WritePin instead of digitalWrite().

View solution in original post

4 REPLIES 4
T J
Lead
Posted on May 30, 2018 at 18:08

just mimic the functionality described on page 31 of the MCP3903 data sheet

its an easy detailed explanation.

Do you have a scope or logic analyzer ?

David SIORPAES
ST Employee
Posted on May 30, 2018 at 18:35

The library seems pretty easy to port to Cube environment.

Re-write the readRegister()/writeRegister() methods using HAL_SPI_TransmitReceive instead of SPI.Transfer() and use HAL_GPIO_WritePin instead of digitalWrite().

Posted on May 31, 2018 at 12:39

Unfortunately, I neither have a scope nor a logic analyzer. I am not sure what I need to look at on page 31. 

Posted on May 31, 2018 at 12:40

Thank you, I will try that.