Hi everyone,
I have to make a project using uC/OS III as rtos on the FRDM-K64F.
I am trying to read the values of the accelerometer (FXOS87000CQ) inside the board using, as base, the project provided by micrium with uC/OS III (that uses the old ksdk 1.0).
I found this example on the nxp community and so I tried to follow it changing the port of I2C (the accelerometer is connected to PTE24 - SCL and PTE25 - SDA in mux mode 5) and the I2C module that is I2C0.
FXOS8700CQ - Bare metal example project
Using a scope I see something happens on the port, but when I read the values of the accelerometer I have always 0xFF as result but because I am not very skilled with the protocol and the board I cannot find the problem(s).
I tried also disabling the magnetometer and using only the accelerometer but I obtain the same results. Using the project example generated by the sdk builder, it works. (but it use KSDk v2.3)
Can someone help me explain why the code is not working?
Are there other examples using KSDK 1.0 and the K64F?
Is there a way to update or create a new project using the new KSDK and the uC/OS III rtos?
Any help on this would be appreciated.
Thanks a lot.
Davide
Hi Davide
Check the I2C address being used for the FXOS8700. On the FRDM-K64F the address jumpers are set by default to SA1 = '0' and SA0 = '1', which gives a read address of 0x3b and write address of 0x3a (or sometimes expressed as 0x1e depending on how the firmware manages it).
Possibly the demo that you are using has it set for a different address, in which case the slave would never respond and so 0xff be always read.
Regards
Mark
Kinetis: http://www.utasker.com/kinetis.html
Kinetis K64:
- http://www.utasker.com/kinetis/FRDM-K64F.html
- http://www.utasker.com/kinetis/TWR-K64F120M.html
- http://www.utasker.com/kinetis/TEENSY_3.5.html
- http://www.utasker.com/kinetis/Hexiwear-K64F.html
I2C: http://www.utasker.com/docs/uTasker/uTasker_I2C.pdf
Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M
Professional Kinetis support, one-on-one training and complete fast-track project solutions: http://www.utasker.com/support.html