ZymKey problem when reading MCP3008

Using the latest Raspberry Pi OS 32bit, fully updated on a Pi4 2GB.

Linux raspberrypi 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l GNU/Linux

The ZymKey appears to work fine with the slow blue led blinking. Within a few seconds of starting code that reads MCP3008 over SPI the ZymKey flashes rapidly then gives 8 flashes which I believe is i2c comms problem.

The ZymKey port is configured to GPIO24.

from gpiozero import MCP3008
import time

voltages = []
voltages.append(MCP3008(channel=7))
voltages.append(MCP3008(channel=6))
voltages.append(MCP3008(channel=5))
voltages.append(MCP3008(channel=4))
voltages.append(MCP3008(channel=3))
voltages.append(MCP3008(channel=2))
    
while True:
    for voltage in voltages:
        print(str(voltage.value)+' ',end='')
    print('')    
    time.sleep(0.1)

@rpiMike - Yes the 8 flashes is a comm problem on i2c.

The first question we always have to ask is do you have a good power supply?

Next, can you try changing the PI CPU scaling governor from ondemand to performance to see if that makes a difference? Details here:

https://community.zymbit.com/t/dev-team-known-issues/996/3

And one more question on your setup: How is your MCP3008 wired up? Is it on a standard HAT, or are you wiring up yourself on a breadboard?

Bob

I’m using an official Pi 2.5 Amp power supply into a PiJuice UPS mounted onto the Pi4. I’m not seeing any low power warnings.

I will try the governor change.

The MCP3008 is mounted onto a custom made PCB.

The Pi4 recommended power is at least 3.0A. If you have a better Power Supply, you may want to also give that a try.

https://www.raspberrypi.org/documentation/hardware/raspberrypi/power/README.md

Tested with an official Pi 3.0Amp power supply direct into Pi4, same issue.

First command on your governor change fails:

pi@raspberrypi:~ $ 
pi@raspberrypi:~ $ echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
bash: /sys/devices/system/cpu/cpufreq/policy0/scaling_governor: Permission denied
pi@raspberrypi:~ $ sudo echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
bash: /sys/devices/system/cpu/cpufreq/policy0/scaling_governor: Permission denied
pi@raspberrypi:~ $

It requires “sudo su”. Thanks for pointing that out. We added that note to our instructions.