Search found 13 matches

by Jevermeister
Sun Apr 14, 2013 7:42 pm
Forum: User Projects
Topic: Arduino I2Cdev & MPU-6050 code conversion to ChibiOS
Replies: 7
Views: 11854

Re: Arduino I2Cdev & MPU-6050 code conversion to ChibiOS

Hi,

my I2C configuration struct is /* I2C interface #1 */
static const I2CConfig i2cfg1 = {
OPMODE_I2C,
400000,
FAST_DUTY_CYCLE_2,
};

and

/* I2C interface #1 */
i2cStart(&I2CD1, &i2cfg1);
palSetPadMode(GPIOB, I2C1_SDA, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN);
palSetPadMode ...
by Jevermeister
Fri Mar 08, 2013 4:07 pm
Forum: Development and Feedback
Topic: Time measurement unit.
Replies: 12
Views: 12761

Re: Time measurement unit.

Okay, now at least the measurement seems to be correct.
Needed to change CH_FREQUENCY back to 100 as otherwise my periodic CAN output status would sweep between +- 1ms delay.

Without any delay the thread runtime is stable at ~1350us. I just look at the last value. If i add 2000us delay, my ...
by Jevermeister
Fri Mar 08, 2013 3:45 pm
Forum: Development and Feedback
Topic: Time measurement unit.
Replies: 12
Views: 12761

Re: Time measurement unit.

It is initialised. The task takes about 6ms to complete and i want to measure up to 20ms. So this should be enough?
With a thread sleep of less than 9000 us, it always takes ~9900us to complete.
With a thread sleep of more than 9000 us, it takes ~9900us + x to complete, x is roughly threadsleep ...
by Jevermeister
Fri Mar 08, 2013 2:59 pm
Forum: Development and Feedback
Topic: Time measurement unit.
Replies: 12
Views: 12761

Re: Time measurement unit.

Hi, i'm trying to measure the time needed to complete one task loop.

The task is activated every ~5ms by an external interrupt which releases a semaphore.
code is like this:

while (TRUE) {
tmStartMeasurement(&TimeMonitor);
chBSemWait(&semaphore);
doStuff();
chThdSleepMicroseconds(5000 ...
by Jevermeister
Wed Feb 06, 2013 11:17 pm
Forum: User Projects
Topic: Arduino I2Cdev & MPU-6050 code conversion to ChibiOS
Replies: 7
Views: 11854

Re: Arduino I2Cdev & MPU-6050 code conversion to ChibiOS

Code is up. Will convert the quaternion code and corresponding functions tomorrow.
by Jevermeister
Wed Feb 06, 2013 1:11 pm
Forum: User Projects
Topic: Arduino I2Cdev & MPU-6050 code conversion to ChibiOS
Replies: 7
Views: 11854

Re: Arduino I2Cdev & MPU-6050 code conversion to ChibiOS

Just finished my first attempt to convert the corresponding 6-axis DMP MotionApps code (MPU6050_6Axis_MotionApps20.h).
Will upload it in the evening and do further tests tomorrow, the DMP initialisation seems to work.

Serial output example:
STARTING...

Resetting MPU6050..&#46 ...
by Jevermeister
Tue Feb 05, 2013 8:52 pm
Forum: User Projects
Topic: Arduino I2Cdev & MPU-6050 code conversion to ChibiOS
Replies: 7
Views: 11854

Arduino I2Cdev & MPU-6050 code conversion to ChibiOS

Hi,

for my master thesis i ported today the popular Arduino I2Cdev C++ library and corresponding MPU-6050 code to ChibiOS.
Available at m - MIT/X11 license.
Please consider it highly experimental as i only tested a few functions.
I'll test as much as possible and try to implement the DMP functions ...
by Jevermeister
Fri Jan 11, 2013 3:57 pm
Forum: User Projects
Topic: MPU 60X0 Sample Code
Replies: 11
Views: 13174

Re: MPU 60X0 Sample Code

any update yet?

ah:

Code: Select all

#define MPU_ADDR         0b1101001

won't work with the build-in KEIL compiler. Needed to convert it to 0x69

regards
by Jevermeister
Thu Jan 10, 2013 7:21 pm
Forum: Development and Feedback
Topic: can't get PWM going with TIM1 on the F4DISCOVERY
Replies: 7
Views: 7789

Re: can't get PWM going with TIM1 on the F4DISCOVERY

solved. had to set my timer to multiples of 256 to prevent rounding errors :) thanks
by Jevermeister
Thu Jan 10, 2013 6:08 pm
Forum: Development and Feedback
Topic: can't get PWM going with TIM1 on the F4DISCOVERY
Replies: 7
Views: 7789

Re: can't get PWM going with TIM1 on the F4DISCOVERY

I have another problem now, maybe you have a clue.

If i set PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 90));

with a clock frequency of 1khz and a period of 1ms, nothing happens.

PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 100));

and above works fine. where's the problem, integer math?