How to use MCP3008 with codesys and raspberry pi ? (including GPIO setup)

Anonymous
2019-04-15
2019-04-16
  • Anonymous - 2019-04-15

    Originally created by: kjsys1202@naver.com

    I do not speak English well, so I ask a Google translator. Even if the grammar is not valid, please understand.

    I would like to receive data values ​​via codesys via raspberry pi and MCP3008.

    As far as I know, I get data values ​​through SPI communication, but there are no GPIOs 8,9,10,11 in codesys.
    Can you tell me how to add a GPIO or how to make it work differently?

    And I am going to use the codesys example 'MCP3008Temperaturae', but I do not know how to set GPIO Parameters and SPIO I / O Mapping. I want you to know this too.

    I'll be waiting for a good answer.

    IMG: 캑처2.PNG

     
  • eschwellinger

    eschwellinger - 2019-04-16

    hi,
    maybe attached first steps documentation should point you in the right direction.

    A known issue is at the moment:
    You need to reduce the SPI mas speed :

    BR
    Edwin

    IMG: SPIMaxSpeed.png

    RaspberryPI_CodesysV3_FirstSteps_EN.pdf [885.7 KiB]

     
  • Anonymous - 2019-04-16

    Originally created by: kjsys1202@naver.com

    Thank you for your reply.
    However, I encountered another problem.
    I created a new project by looking at the 'MCP3008Temp' example file. And the same code and the same settings, despite the 'C0032' error code came out.
    I want to convert type, but I do not know what to do.
    I'll wait for a good reply.

    IMG: 2.PNG

    IMG: 1.PNG

     

Log in to post a comment.