POST No. 2407950
Problem with Opencm
2020-09-23 13:08:16 lolongin

I tried to use OpencM9.04 to control the ordinary motor. When opencM9.04's switching voltage was about 5V, the motor drive plate worked normally and the motor turned normally. However, when Opencm9.04's switching voltage was more than 6V, the motor could not be controlled, but I tested that the output of the port was normal.

I used A2, A3, A10 ports of Opencm9.04 as well as 5V and GND interfaces. The control code is as follows:

#define IN1 2

#define IN2 3

#define ENA 10

uint8_t pwm_out = 255;

void Go(){

  digitalWrite(IN1, LOW);

  digitalWrite(IN2, HIGH);

  analogWrite(ENA, pwm_out);


void Back(){

  digitalWrite(IN1, HIGH);

  digitalWrite(IN2, LOW);

  analogWrite(ENA, pwm_out);


void Stop(){

  digitalWrite(IN1, LOW);

  digitalWrite(IN2, LOW);

  analogWrite(ENA, 0);


void setup() {

  // put your setup code here, to run once:

  pinMode(IN1, OUTPUT);

  pinMode(IN2, OUTPUT);

  pinMode(ENA, OUTPUT);




void loop() {

Can you tell me how to solve this problem?Thank you very much!

2020-09-23 13:08:16
2020-09-24 10:38:57 Will Son


I'm sorry but we do not provide solutions for users' source code.

I'm not sure what you meant by the switching voltage. Did you mean the input voltage?

Please note that GPIO pins on OpenCM9.04 is 3.3V and doesn't have tolerance for voltages that exceed 3.3V.

Thank you.

2020-09-24 10:38:57
2020-09-24 11:01:26 slade


Yes, it's input voltage. 

We want to  control a DC motor with a motor driver board by Opencm9.04's PWM GPIO pins, but when the input voltage is higher than 6v, the motor will not operate.

And, we checked that the motor driver board is fine and the pwm has been tested well by an oscilloscope, so I want to know what's going wrong?

2020-09-24 11:01:26
2020-09-25 09:19:21 Will Son


The recommended operating voltage of OpenCM9.04 is 5~16V and since you confirmed that the PWM signal on the GPIO pin is working fine, I think the problem could be on the driver board side or the motor.

Make sure that the motor driver or the motor can run with 6V.

Other than that, it is difficult for me to identify what causes the issue.

Thank you.

2020-09-25 09:19:21
2020-09-25 11:18:28 hammer


I am a friend of the questioner.

The motor voltage is provided separately. We only use OpenCM9.04's 5V voltage output pin to provide the voltage for the drive plate, and the voltage bearing of the drive plate is 3-6.5V.

We found that everything was fine with the 3.3V pin, maybe there was something wrong with the 5V pin?

And when we do not use 5V or 3.3V GND pins to provide voltage to the drive plate, the GPIO pins do not seem to work properly. What is the connection between them?


2020-09-25 11:18:28
2020-09-29 21:18:01 Will Son


I'm still not very clear with your hardware configuration. 

If you can take a picture of your connection, it might be much more helpful to understand.

When you are using a separate power source for the controller and the motor driver, you should connect the GND pin so that they have the same reference ground.

Thank you.

2020-09-29 21:18:01
웹에디터 시작 웹 에디터 끝