Ability to read ADC1&2_WIFI?


Hey guys, been having a pretty good time getting the MangOH Red going. I’m curious whether the ADC1_Wifi and ADC2_Wifi are available to be read? I didn’t see it in the interfaces and didn’t see it in the legato framework, but it appears available on the headers on connector CN310.


Hey guys, further to the ADC I can’t seem to find any way to connect to the SPI through the wifi component. I’ve investigated the legato components and modules and saw a generic spiService, but I’m not sure how I would have it connect me through the wifi chip to my external device.

My use case is that I’m trying to connect an ADC (MCP3004), which communicates via SPI, to the RPI connector. At this point I don’t know what service I would need to use in order to communicate over those pins.



Hi Brandon,

In this case, you need to have CP2130 driver enabled in your sdef.This part is working.
Now why do you need to use the ADC from the MTK chipset? We have not written sample code for that. Our plan for MTK is the following:
a. End of Oct: WiFi working with documentation available
b. End of December: Bluetooth working with documentation available
c. End of Oct: Sample code for using gpios on MTK chipset.



Hey Ashish,

I won’t need to access the ADC on the Wifi if I can get the SPI working. So the CP2130 driver will provide me access to the SPI?


Yes, just uncomment out the driver in sdef file and rebuild. Note a large part (not all) of that driver was built by us and has a random startup issue. You can get started however and fix any :ant: you find.



I think you two are confusing each other :slight_smile:

Ashish is asking why you want to use the ADC on the mt7697 because there are already ADCs on the WP. Also, there are two ways to do SPI in the mangOH Red. There is a SPI master built-in to the WP module. Also there is a CP2130 USB-To-SPI bridge chip. The purpose of the CP2130 is to provide a way for the WP to control the mt7697 (wifi + BT) chip. If you have another chip that you want to connect and control with SPI, then you would be better off connecting it to SPI1 which is available on the IoT slot.

I have written some preliminary documentation which describes how to flash the mt7697, but I don’t get into how to write code for it. Based on our discussion, I don’t think you necessarily need to write any code for the mt7697 chip though.


Thanks, David.

Yeah I have been looking to build a daughter board off of the 26-pin RPI header… But perhaps as you had mentioned previously my best bet is to build a custom IoT0 daughter board. My monitoring requirements are:

ADC x 3
Digital x 3
UART x 1
Send data to SD card

Since the IOT connector doesn’t have 3 ADC’s I’d have to use the SPI there with the MCP3004 (4 channel ADC). I would then use a connector to break out my signals to a phoenix style-connector on the outside of my enclosure.

If I skipped the MangOH board I could definitely just use the ADC connectors on the WP, however for the sake of speed it’s great to leverage what you guys have done so I can launch my first version of the product to my early adopters.


Hi Brandon,

All of this should be available. For the 3 ADCs
a. ADC0 on IoT card
b. ADC1 and ADC2 on CN312

3 Digital IO on IoT card, UART on IoT card
SD Card on board.



Thanks Ashish.

I think I may have been losing my mind, when I was looking at CN312 I assumed that the ADCs were using a reference voltage of 1.8V… But now that i’m reviewing you’re just doing a direct connect to ADC1 and ADC2 on the chip. I will be looking to drop voltages down from up to 48VDC and monitoring, 1.8V would have been nasty.


Hey guys, I just read in the the WP8548 tech spec that the reference voltage is 1.8VDC for the ADCs, darnit! I may still end up using the SPI interface to MCP module since I’m monitoring such a large voltage range.


just use the SPI on the IoT module


For sure, thanks Ashish.


FYI, legato spi service should make it pretty simple to use .