Skip to content

Imu#519

Open
zer0page wants to merge 14 commits intointegrationfrom
imu
Open

Imu#519
zer0page wants to merge 14 commits intointegrationfrom
imu

Conversation

@zer0page
Copy link
Copy Markdown
Contributor

@zer0page zer0page commented Oct 6, 2016

DO NOT MERGE
emits commands via SPI uart code
"tap"
and
"flipped [1|0]"

Copy link
Copy Markdown
Contributor

@plasticchris plasticchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What impact is there on pill?

imu_clear_tap_interrupt();
PRINTS("Tap\r\n");
MSG_Data_t * data = MSG_Base_AllocateStringAtomic("tap");
if(data){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not reference a const string?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to convert the string to MSG_Data_t * which is consumed by the sspi module

/*
*PRINTF("<imu>x:%d y:%d z:%d</imu>\r\n", xyz[0], xyz[1], xyz[2]);
*/
if(xyz[2] > 1000 && !flipped){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dependent on the selected scale

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change

Copy link
Copy Markdown
Contributor Author

@zer0page zer0page Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, i don't think the scale matters in this, because this is a simple hysteresis on the Z value. Due to the orientation of the imu chip, any positive Z value means Sense has flipped or rolled.

@zer0page
Copy link
Copy Markdown
Contributor Author

zer0page commented Oct 6, 2016

this change is morpheus only

_register_write(REG_CTRL_6, INT_ACTIVE_LOW );

_register_write(REG_CLICK_CFG, 0x3F);//all directions clickable
_register_write(REG_CLICK_SRC, CLICK_SRC_DCLICK | CLICK_SRC_STAP);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this register meant to be written to?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like its read only, will remove

_register_write(REG_CLICK_THR, 0x06);
_register_write(REG_TIME_LIMIT, 0x04);
_register_write(REG_TIME_LATENCY, 0x24);
_register_write(REG_TIME_WINDOW, 0x7F);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the units for these documented anywhere?

Copy link
Copy Markdown
Contributor Author

@zer0page zer0page Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, i just saw a youtube video of a demo and copied the numbers.
documentation also does not show what the units are

drivers/imu.c Outdated
// clear the interrupt by reading INT_SRC register
uint8_t int_source;
_register_read(REG_INT1_SRC, &int_source);
PRINTF("INT CLR %x\r\n", int_source);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why move this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

artifact from testing, will revert

IMU_HZ_1 = 1,
IMU_HZ_10 = 2,
IMU_HZ_25 = 3,
IMU_HZ_400 = 7,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undocumented rates go all the way up to 1.6 kHz (the resonant freq of the sensing element) but you get reduced resolution...

@zer0page
Copy link
Copy Markdown
Contributor Author

causes instability to the middle board, do not merge

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

Successfully merging this pull request may close these issues.

2 participants