MC3630 - Accel sensor
MC3630 - accelerometer
Accelerometer using SPI bus.
Available only when board BEHAVIOR <PAL_MOT>
<PAL_NOTICE>
is loaded. Procedures of common methods except begin(), available()
are executed in board BEHAVIOR.
Operation flow
1..begin()
: Sensor operation starts 2. 2.PIN_SNS_INT
interrupt or available()
: FIFO queue reaches the specified number 3. 3..get_que()
: Get data from the FIFO queue
Procedures required for operation
SPI bus
None in particular.
Sleep procedure
To wake up by PIN_SNS_INT interrupt, the following settings must be made before sleep.
Procedures for waking up from sleep
A call to the .wakeup()
method is required. This process is executed in the <PAL_MOT>
board BEHAVIOR.
If the semiconductor's internal FIFO queue is full and no read is performed, the data acquisition is terminated and no new values are stored.
Data Structure
Each sample is stored in a queue smplque
whose elements are axis_xyzt
structures. The members x,y,z correspond to the X, Y, and Z axes, respectively.
The value of each axis is stored as a value where 1G is 1000. The t
is the sample number, which is assigned to each sample in order from 0
.
Methods
read()
Reads data from a semiconductor FIFO queue. The number of bytes read is returned, but be sure to read the number of data stored in the size of the queue referenced by .get_que()
.
After returning from sleep, <PAL_MOT>
will do read()
.
get_que()
Get a sample of the acceleration. The queue is smplque
with axis_xyzt
as an element; the queue should be emptied as soon as it is available.
Common methods
setup()
This sensor does not use setup()
.
begin(), end()
Initialize with the settings specified in conf
.
conf[0:15]
(bit0-15): sampling mode, conf[16:23]
(bit16-23): range of acceleration, conf[24:31]
(bit24-31): number of samples until interrupt occurs.
conf[0:15] sample mode | contents |
---|---|
| 1Hz Low Power (unofficial setting) |
| 2Hz Low Power (unofficial setting) |
| 7Hz Low Power (unofficial setting) |
| 14Hz Low Power (default) |
| 28Hz Low Power |
| 54Hz Low Power |
| 105Hz Low Power |
| 210Hz Low Power |
| 400Hz Low Power |
| 25Hz Ultra Low Power |
| 50Hz Ultra Low Power |
| 100Hz Ultra Low Power |
| 190Hz Ultra Low Power |
| 380Hz Ultra Low Power |
Unofficial settings are not described in the MC3630 datasheet and their behavior is undefined. Please check the behavior of the settings before using them. We are not able to answer any questions or problems related to the unofficial settings.
conf[16:23] Acceleration range | Contents |
---|---|
| ±8G (default) |
| ±4G |
| ±2G |
| ±1G |
process_ev()
This sensor does not use process_ev()
.
available()
Returns true
if data is read out to the sensor and stored in the internal queue.
probe()
You cannot use probe()
with this sensor.
wakeup()
Reinitializes the SPI bus after sleep recovery and reads acceleration data.
最終更新