mpu6050 Component

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
ajneal4uk
Posts: 22
Joined: Sun Mar 03, 2013 10:30 pm
Has thanked: 1 time
Been thanked: 1 time
Contact:

mpu6050 Component

Post by ajneal4uk »

Hi

I am unable to compile to chip when I use the i2c components.
If I add the mpu6050 component to FC6 for a 30f3013 I get the following messages, do I have to add anything to the Cal_I2C.C Function?:-


http://www.matrixmultimedia.com
Launching the compiler...
C:\Program Files\Flowcode 6\compilers\pic16\batchfiles\pic16_C30_comp.bat "Flowcode1" "C:\Users\Ando's\DOWNLO~1\" "30F3013"
Launching compiler...

C:\Users\Ando's\DOWNLO~1>pic30-gcc -c -mcpu="30F3013" -funsigned-char -fno-short-double -Os -I"C:\PROGRA~1\FLOWCO~3\COMPIL~1\pic16\BATCHF~1\..\support\h" -I"C:\PROGRA~1\FLOWCO~3\COMPIL~1\pic16\BATCHF~1\..\MX_support" -Wall -std=gnu99 "Flowcode1".c -o "Flowcode1".o
In file included from C:\Program Files\Flowcode 6\CAL\includes.c:155,
from Flowcode1.c:251:
C:\Program Files\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c: In function 'FC_CAL_I2C_Master_Init_1':
C:\Program Files\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c:111: error: 'I2C1CONbits' undeclared (first use in this function)
C:\Program Files\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c:111: error: (Each undeclared identifier is reported only once
C:\Program Files\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_I2C.c:111: error: for each function it appears in.)

etc

Thanks
Andy

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: mpu6050 Component

Post by Benj »

Hi Andy,

I believe we have fixed this bug now and the fix should be included in the next release. For now you should be able to solve the issue yourself by copying the attached file below into your "Flowcode v6/FCD/PIC16/" folder before starting Flowcode. Hopefully the I2C will then compile correctly.
Attachments
30F3013.fcdx
(19.42 KiB) Downloaded 279 times

ajneal4uk
Posts: 22
Joined: Sun Mar 03, 2013 10:30 pm
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: mpu6050 Component

Post by ajneal4uk »

Thanks Ben

Any reason why the xyz Gyro's return -1?

I read with interest your quadcopter blog.

I think the idea of using the hardware to output the data and flowcode using it to develop the math is cool.

I was wondering how you get the comport to connect, I assume a drop down box but don't see it.

Maybe a global variable that I have overlooked, my serial port is com10.

Also it would be good to have a kalman filter example, I got a shed load of dsp components that I have no idea how to use.

Thanks

Andy

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: mpu6050 Component

Post by Benj »

Hi Andy,

Values of -1 represent that the value received is 0xFFFF so the pin you are reading from is always high. Have you got the ADR0 pin pulled to the correct voltage rail?

The COM port can be selected in the sensor read examples to match the COM port assigned by Windows to the ECIO with the USB Serial component running on it. Simply select the RS232 component and then one of the properties should be COM/Injector and then if you select COM you are presented with a list of active COM ports.

Just brought in the finished quad to work today to rev it up and see if it would take the 830g weight. Well it took it but then shattered one of the 3D printed arms due to the kick from starting up the motors. Bit more CAD work required I feel.

I posted some v6 DSP examples here if you want to have a play.
http://www.matrixmultimedia.com/mmforum ... =25#p52092

ajneal4uk
Posts: 22
Joined: Sun Mar 03, 2013 10:30 pm
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: mpu6050 Component

Post by ajneal4uk »

Hi Ben;

I updated the V6.0.2.0 patch and the gyro values spring into life.

The component structure is a good feature of flowcode I like the way the MPU6050 is derived from the I2C component.

Would it be possible to show the MPU6050 project before it is exported into a component?

Andy

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: mpu6050 Component

Post by Benj »

Thanks Andy,

I have PM'd you with the source.

Post Reply