MA12070 Questions about the MCU/Serial control interface

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Happy
Level 2
Level 2
25 sign-ins 10 replies posted 10 sign-ins

Hello! , I used arduino to try to set the value of Select Power Mode Profile setting, using I2c.write(0x20, 0x00, 0x01); Successful, but all the settings are restored after the power is cut off, can I not permanently write the configuration settings of the MA12070?

1.Both AD0 and AD1 are grounded

2.code

#include <I2C.h>
byte red = 0;
const byte LED = 13;    // LED pin number
const byte BUTTON = 2;  // BUTTON pin number
volatile int state = LOW;
int arr[7];
int i = 0;
byte *b;
void setup() {
  // put your setup code here, to run once:

  pinMode(LED, OUTPUT);        // so we can update the LED
  digitalWrite(BUTTON, HIGH);  // internal pull-up resistor

  I2c.begin();
  I2c.write(0x20, 0x00, 0x01);  //
  //  I2c.write(0x20, 0x27, 0x03);  //

  // I2c.end();
  // I2c.begin();

  digitalWrite(LED, 0);

  // I2c.timeOut(500);
  // I2c.pullup(true);
  Serial.begin(9600);
  Serial.println("open");
  // I2c.setSpeed(true);

  // I2c.end();
}

void loop() {
  // put your main code here, to run repeatedly:


  //

  red = I2c.read(0x20, 0x7C, 0x00);
  // I2c.timeOut(5000);
  byte v=I2c.receive();
  Serial.print(v,HEX); 
    Serial.print('=');
 Serial.print(v,BIN); 
  Serial.print(' ');


  if (i >= 15) {
    Serial.println();
    i = 0;
  }
  i++;
   delay(500); 
}

 

 

 

0 Likes
1 Solution
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

Hi @Happy 

Registers are generally volatile,  Therefore, every time power on, need to rewrite the register.

View solution in original post

0 Likes
3 Replies
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

Hi @Happy 

Registers are generally volatile,  Therefore, every time power on, need to rewrite the register.

0 Likes

你说的内容我也知道,对我来说不是答案。

0 Likes
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

寄存器的值,每次上电都会恢复默认值,必须重新写入,没有其他办法。

0 Likes