Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 9 months ago.
LPC1768沒有收到IMU(3DM-GX1)訊號
各位先進好 想請問當 LPC1768 傳送16進位的指令後,IMU理論上要回傳訊號,但LPC板似乎沒有收到任何訊號,已確認下列功能正常:
(1)IMU正常(已使用電腦上程式驗證輸入指令後,IMU會回傳所要的訊號)
(2)已檢測過連接LPC板與IMU的RS232轉TTL板正常
(3)有使用過有buffer和interrupt功能的程式庫,MODSERIAL、BufferedSerial,一樣無效果
想請問是不是程式有錯誤或是IMU與LPC1768不相容?
#include"mbed.h" Serial pc(USBTX,USBRX); Serial gy(p9,p10); DigitalOut led(LED1); int main(){ gy.baud(38400); pc.baud(38400); gy.format(8,Serial::None,1); int i=0; gy.putc(0xF1);//輸入指令,會回傳5個byte,分別為F1、dataMSB、dataLSB、checksumMSB、checksumLSB while(i!= 5){ if(gy.readable()){ pc.putc(gy.getc()); i++; led != led; } } }
IMU規格如下: http://files.microstrain.com/manuals/3DM-GX1%20Data%20Communication%20Protocol%203102.pdf
謝謝
1 Answer
6 years, 9 months ago.
Hi Kai Fu,
從MicroStrain上給的資料https://www.microstrain.com/inertial/3DM-GX1中,可以看到他所使用的RS232 Cable是把V+另外給的,MAX232這邊如果是由LPC1768給電的話,就會是5V,所以要看V+的電壓是多少,是否兩個的電壓是一致的。
另外就是3dm-gx1的最小操作電壓是5.2v,這個也要注意是否有符合這個規格,謝謝。
Please let me know if you have any questions!
- Desmond, team Mbed