05-20-2019 10:04 PM
I"m triing to get the BMA456 running on a small Controller (Atmega32), the Controller features a Hardware I2C driver which is used directly.
As written in the Datasheet(4.2.2) the BMA456 needs to be initialized with a configuration File.
Since the controller in my project is very small I would like to use the Interrupt functionality without a big config string which needs to be stored in the Controller. Is this possible?
In the datasheet it looks like this could be possible by writing directly to the FEATURES_IN(0x5E) Register.
But this Register is used for more than one byte. The different bytes are addressed differently.
So writing the anymotion "sub"-Registers should look like this?
I2C_START 0x19(Address) 0x5E(Register) 0x00(SubRegister) 0x00 0xAA(Data for the Register(0x5E00)) 0x00 0x05(Data for the Register(0x5E02)) I2C_STOP
Is it also possible to read the Registers? e.g. by
I2C_START 0x19(Address) 0x5E(Register) I2C_STOP I2C_START I2C_READ I2C_READ .... I2C_STOP
With this Code i am getting 0x4D 0x4D 0x4D, but i expected the Standard Values for these registers?
Best Regards
sulkith
Solved! Go to Solution.
05-21-2019 02:49 PM
Hello,
The config file is not optional to use interrupts. In case you are lacking available memory in your MCU, look closely in bma456.c and you should see that the last 1.6kB of the config file is actually just padding bytes ("0x80, 0x2e, 0x18, 0x00"). You could write your own "compression" mechanism that sends these bytes on the bus without storing them into memory.
Otherwise, you can load the config string into external memory.
05-21-2019 10:58 PM
Hi,
Would it be possible to use another modell like the BMA280 or the BMA253 for the NoMotion detection, without downloading a config file first?
since the footprint for both of them seems to be the same, i could replace it by just swapping the chip and changing the Software a bit.
The only difference is the PS Pin(11) which defines the Protocol version for the chip.What is the behavior of the BMA280/BMA253 if this Pin is not connected? Is this Pin actively pulled to GND or VDDIO or is the behavior completely undefined?
Best Regards
sulkith
05-22-2019 09:44 AM
From the datasheet, section 4.1 : "In case the I²C interface shall be used, a direct electrical connection between VDDIO supply and the PS pin is needed in order to ensure reliable protocol selection. For SPI interface mode the PS pin must be directly connected to GNDIO."
As you can see, it is definitely not recommended to leave the pin floating. But indeed no-motion and any-motion interrupts are fairly simple, and the BMA253/280 have these interrupts implemented directly on the ASIC itself.