Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysctl_set_power_mode does not set power mode #116

Open
1 task
ThomasDebrunner opened this issue Oct 29, 2020 · 2 comments
Open
1 task

sysctl_set_power_mode does not set power mode #116

ThomasDebrunner opened this issue Oct 29, 2020 · 2 comments

Comments

@ThomasDebrunner
Copy link

ThomasDebrunner commented Oct 29, 2020

  • [x ] BUG REPORT
  • FEATURE REQUEST

BUG REPORT

Power banks stay at the same voltage level, no matter what is set with sysctl_set_power_mode. For example, power bank 6 always stays at 1.8V, power bank 2 always at 3.3V

Expected behavior

High-state voltage of the GPIO outputs are the value set with sysctl_set_power_mode.

Actual behavior

High state voltages seem unaffected by sysctl_set_power_mode.

Test code

    sysctl_set_power_mode(SYSCTL_POWER_BANK2, SYSCTL_POWER_V18);

    fpioa_set_function(16, FUNC_GPIOHS16);
    gpiohs_set_drive_mode(16, GPIO_DM_OUTPUT);
    gpiohs_set_pin(16, GPIO_PV_HIGH);

Then use a multimeter and check voltage of pin 16. Pin 16 is at 3.3V. This is wrong. Should be at 1.8V.

    sysctl_set_power_mode(SYSCTL_POWER_BANK6, SYSCTL_POWER_V33);

    fpioa_set_function(36, FUNC_GPIOHS30);
    gpiohs_set_drive_mode(30, GPIO_DM_OUTPUT);
    gpiohs_set_pin(30, GPIO_PV_HIGH);

Then use a multimeter and check voltage of pin 36. It is 1.8V. This is wrong, should be at 3.3V.

Document version

Tag 0.5.6

Hardware

Maix Dock with M1 module

System

PlatformIO on macOS

@cmdrf
Copy link

cmdrf commented Aug 6, 2021

It seems the meanings of SYSCTL_POWER_V33 and SYSCTL_POWER_V18 are reversed. If you set SYSCTL_POWER_V18, you get 3.3V, and if you set SYSCTL_POWER_V33, you get 1.8V.

EDIT: Forget it, my circuit just worked sporadically when fiddling around. sysctl_set_power_mode really doesn't do anything.

@cmdrf
Copy link

cmdrf commented Aug 7, 2021

I investigated a bit further and I'm pretty sure the I/O voltage is not field-programmable. You "choose" the I/O voltage by supplying the desired voltage to the corresponding VCC pins. Example of a Sipeed board, where you can place 0 Ohm resistors to choose the voltage:
image

Then you use sysctl_set_power_mode to tell the chip which voltage you are supplying, for whatever reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants