Cover image
Try Now
2018-01-31

Funciones para leer el convertidor A/D de 12 bits MCP3201 usando el bus SPI en modo MSB o LSB con Raspberry Pi

3 years

Works with Finder

0

Github Watches

6

Github Forks

10

Github Stars

raspi-MCP3201

This module provides functions to read the MCP3201 (2.7V 12-Bit A/D Converter with SPI Serial Interface).

Please refer to the datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/21290F.pdf

The MSB is clocked out on the falling edge of the 3rd clock pulse. After the first eight clocks have been sent to the device, the MCU receive buffer will contain two unknown bits (??), the null bit (NB), and the highest order five bits (B11-B7) of the conversion. After the second eight clocks have been sent, the receive buffer will contain the lowest order seven bits (B6-B0) and the B1 bit repeated as the A/D converter has begun to shift out LSB data with the extra (i.e. the 16th) clock.

Requires SPI:

dtparam=spi=on in /boot/config.txt

sudo pip3 install spidev (https://pypi.python.org/pypi/spidev)

Pin setup MCP3201:

VDD (8) --> 3V3

VREF(1) --> 3V3

VSS (4) --> GND

IN+ (2): positive analog input (min: IN-, max: VREF + IN-)

IN- (3): negative analog input (VSS +- 100 mV), connect to GND

Raspberry Pi (Model B2, Pi2, and Pi3):

CD/SHDN (5): chip select/shutdown --> Raspberry Pi BCM GPIO pin 8 (CE0)

CLK (7): serial clock --> Raspberry Pi BCM GPIO pin 11 (SCLK)

DOUT (6): serial data output --> Raspberry Pi GPIO BCM pin 9 (MISO)

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

  • ravitemer
  • Un poderoso complemento Neovim para administrar servidores MCP (protocolo de contexto del modelo)

  • patruff
  • Puente entre los servidores Ollama y MCP, lo que permite a LLM locales utilizar herramientas de protocolo de contexto del modelo

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

  • av
  • Ejecute sin esfuerzo LLM Backends, API, frontends y servicios con un solo comando.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

  • Mintplex-Labs
  • La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.

    Reviews

    5 (1)
    Avatar
    user_bbTtIfFY
    2025-04-17

    The Raspi-MCP3201 by flohwie is a fantastic addition for anyone looking to add precise ADC capabilities to their Raspberry Pi projects. The integration is seamless, and the documentation on the GitHub page is thorough, making setup straightforward even for beginners. A highly recommended tool for anyone working with analog signals on a Raspberry Pi!