cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with UART Interrupt with IMU

chenping
Associate II
Posted on April 02, 2015 at 19:59

After extracting IMU from the demonstration project (merely leave out USB setting), now I face another issue is that whenever I tried to activate interrupt setting for UARTs, it hangs. (The circular LED_toggle indicating intialization stops at led3). Other various settings like qei, pwm do not clashes with this IMU. Sometimes as timer 6 and 7 are on, this situation occurs too.

I tried printing as usual in while(1), without uart interrupt setting being set, and I can see big difference between with or without IMU setting being initialized. That is the speed of transmission. Obviously, the printing in while (1) is being slowed down tremendously with IMU. But as I commented the IMU_init line, it returned to being fast transmission.

Perhaps there's somewhere wrong in my IMU? But I just can't figure out.. Please help.. Thank you in advance!!

#clive1 #wait-for-you--clive1-!-!-!
5 REPLIES 5
chenping
Associate II
Posted on April 02, 2015 at 23:22

I don't see any IRQ handler code here. You can attach files directly to a post.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
chenping
Associate II
Posted on April 03, 2015 at 17:46

My uart handler is relatively clean. As I just shifted them from common.c to main.c, i will attach another main.c here. Thanks!

Today I analyzed the problem and found further that whenever I use the UART pin with Handler on, the IMU led pointing north will stop moving or rather hanging (led in timer stop moving as well as this happens).

However as I switched off the function IMU_Yaw, this situation does not occur regardless of UART Handler on or off.

________________

Attachments :

main.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0d5&d=%2Fa%2F0X0000000bbX%2Ft1f5_IYq1ySaMgUxecjoruDSY4IXga1oeCl0bvSYXcA&asPdf=false
chenping
Associate II
Posted on April 03, 2015 at 18:47

This is a previous project of which I considered quite most successful among all other trials though this still end up hanging after a few shaking of the board (affecting gyroscope).

UART Handlers are in common.c

Timer IRQHandlers are in main.c

Init settings are in common.c and basic def in adapter.h

________________

Attachments :

adapter.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I04b&d=%2Fa%2F0X0000000bbW%2Fl86jMLmUOSB.92KTr06YNbGI.AtqYHrkZmxvmq.r4YU&asPdf=false

adapter.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0cr&d=%2Fa%2F0X0000000bbV%2FGpYhsveVL1y2ef64t_8iEB8QA1MLSRrxo3NrwVXUCtI&asPdf=false

common.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0d0&d=%2Fa%2F0X0000000bbU%2FB15in8xv0d64s9QnlnRH4KUFMZ1JjhNv9Ot4eyW6qpU&asPdf=false

common.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzYt&d=%2Fa%2F0X0000000bbT%2Fm6c4tVmKd76.PAL45BZry_WgPDvuqa2_0jwlzefS3pg&asPdf=false

IMU.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0cv&d=%2Fa%2F0X0000000bbS%2FJYe30SXdDECJezolt9nyScElpu0KWTkbZeaNAzxGK4A&asPdf=false

IMU.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0cq&d=%2Fa%2F0X0000000bbQ%2FZnNut7IvMRddHX0fD5YTAX5K.jErW_aQSsqgK0OFMR4&asPdf=false

main.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0cc&d=%2Fa%2F0X0000000bbR%2FsVEgMWy9stgs0CFvXEv1RVaumZpv94rVs4qoO3rHDog&asPdf=false

main.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0aw&d=%2Fa%2F0X0000000bbO%2FWgXU.BkI7gocfSxkoqoU0spZKkLcaSVU9uxCoEMLFJI&asPdf=false

qei.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0cl&d=%2Fa%2F0X0000000bbN%2FxtZSTxGH.s6HKEDPRRDUp_NfFNiOfPi0omZerYlPWK0&asPdf=false

qei.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0cg&d=%2Fa%2F0X0000000bbM%2FkXL.SHsZJxJDQ8LOkXZL_ZHSLQucHuoMbwluWQZJPL4&asPdf=false
chenping
Associate II
Posted on April 04, 2015 at 14:30