povlhp / iBus2PPM

Arduino code to read iBus over serial port, and output PPM to FlightController. Future plans include PWM out for select channels.
GNU General Public License v3.0
34 stars 16 forks source link

Compatibility with Arduino Pro Micro #1

Open midlandsdesign opened 8 years ago

midlandsdesign commented 8 years ago

Hi.

Firstly I would like to thanks you for making your great work available to everyone.

In using this code on an Arduino Pro Micro (Leonardo) and I am not getting any response from the iBus output on the iA6B receiver to show in MissionPlanner, having checked, and double checked, and triple checked the connections.

Upon further investigation, I spotted this in the documentation for this board:

Separation of USB and serial communication. https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc6

Would be correct in saying that in the sketch one should be setting up Serial1 and not Serial?

In addition to the above, the only LED that is assigned to a pin on the Leonardo is the RX LED, and it is assigned to pin 17, so in the sketch the outputs assigned to pin 13 should be assigned to pin 17?

Does this sound correct?

Many thanks

Julian

povlhp commented 8 years ago

Sounds right. Give it a try

Sendt fra min iPhone

Den 18. jul. 2016 kl. 13.57 skrev midlandsdesign notifications@github.com:

https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc6

This

midlandsdesign commented 8 years ago

Thanks. I've given it a bash with no joy. Back to the drawing board. Maybe the receiver is faulty but I'll need to find a way of testing it.

povlhp commented 8 years ago

If you have a ftdi cable try to connect gnd and connect iBus data to Rx. Open putty or another terminal emulator to see if you get binary data in at 115200 bps.

Do you have leds? What is their status?

Sendt fra min iPhone

Den 18. jul. 2016 kl. 19.49 skrev midlandsdesign notifications@github.com:

Thanks. I've given it a bash with no joy. Back to the drawing board. Maybe the receiver is faulty but I'll need to find a way of testing it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

midlandsdesign commented 8 years ago

I have got it working now, thanks a mil.

On the Arduino Pro Micro (Leonardo), the Serial.xx is used for the built in USB serial connection, and Serial1.xx is used for pin 0 and pin 1 serial connection. In addition to this, on this board, the LED is on pin 17 and not 13 as on the other boards.

You therefore need to change all the Serial.xx lines of code in the sketch to Serial1.xx and the LED pin to 17 from 13 if you are using the Arduino Pro Micro or any other Leonardo based board.

Attached is the modified sketch that I am using with the hacked FS i6 Tx, the FS i6B Rx, and APM 2.6, and a cheap clone Arduino Pro Micro board from eBay.

iBus2PPM_leonardo.zip

Thanks again for all your help.