Hi, I'm using TM4C123BH6PM to interface with accelerometer and gyroscope using SSI interface.
(Accelerometer : LIS331DLH, Gyroscope : L3G4200 from STMicro)
The following source code above is about positioning.
When the EK-TM4C123GXL board(wired with acceleerometer and gyroscope
plus DC motor and a servo motor from a RC Car.)
moves more than 2 meters to the Y-axis, the PWM and the ADC is used to rotate left
and starts calculating the angle using the gyroscope.
Also, when the calculated angle becomes bigger than 90 degrees,
the code runs to a infinite loop with a decreased PWM duty.
Testing with the EK-TM4C123GXL board gives results as I thought.
( Move about 2 meters => Turn left 90 degrees =>Stop, infinite loop)
However, while using the TM4C123BH6PM with the same source code,
sometimes the data from these MEMs sensors give terrible results.
For example, the gyroscope's yaw value (Z-axis) is almost constantly 15~16.
Due to this, the car goes round in circles. (about 2 circles) and stops later.
Also the acceleormeter sometimes acts like the gyroscope too.
(It gives constant acceleration value while moving.)
+) The sensors are well soldered. When reading the Who Am I register from the sensor, it returns normally.
I can only think of hardware problems. The file below is the schematic.
However, I designed quite similar to the EK-TM4C123GXL board and can't understand why mine doesn't work...
Could it be a hardware problem?
What could be the reason?
Appreciate your help.
Regards Min-Ku
+) The tested condition.
When I used the EK-TM4C123GXL board, I connected with the USB.
I didn't used external battery source.
However, testing with the TM4C123BH6PM, I use a 7.4V LiPo battery (2 cell, 850mAh).
This 7.4V goes to the motor driver and 5V regulator. The 5V also goes to 3.3V regulator.