Use serial port 3 in MEGA too...
Use serial port 3 in MEGA too...
Hi all,
I just found the r1055 release on multiwii repo.
I tried, when only OSD on serial3 is connected it works great.
But, with this simple clone method, when serial 1 is connected to GUI too, it crashes, many data loss, etc.
I thought it's not as easy as it is written down but it is interresting to solve this question anyway and have two fully functional serial ports on MEGA... could be useful when ie. bluetooth and OSD are connected at the same time!!!
What do you think guys?
BR
Adrian
I just found the r1055 release on multiwii repo.
I tried, when only OSD on serial3 is connected it works great.
But, with this simple clone method, when serial 1 is connected to GUI too, it crashes, many data loss, etc.
I thought it's not as easy as it is written down but it is interresting to solve this question anyway and have two fully functional serial ports on MEGA... could be useful when ie. bluetooth and OSD are connected at the same time!!!
What do you think guys?
BR
Adrian
Re: Use serial port 3 in MEGA too...
when you say serial 1 are you numbering 0-3 or 1-4 for ports ?
i made a thread about this sort of thing too: viewtopic.php?f=7&t=2218
what is "this clone method" ? is it something in r1055 ? i havent looked at it
i made a thread about this sort of thing too: viewtopic.php?f=7&t=2218
what is "this clone method" ? is it something in r1055 ? i havent looked at it
Re: Use serial port 3 in MEGA too...
I suggest to check r1055 first and then you'll understand.
The idea of the author was that he copied all functions of main serial port to serial 3 port. So it is not a remapping like in your topic but the idea of having two working serials at the same time. But, because of the interrupts it is now working really when there is communicaion on both serial ports...
The idea of the author was that he copied all functions of main serial port to serial 3 port. So it is not a remapping like in your topic but the idea of having two working serials at the same time. But, because of the interrupts it is now working really when there is communicaion on both serial ports...
Re: Use serial port 3 in MEGA too...
i understand now. prob best to contact author directly.
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Use serial port 3 in MEGA too...
I think the purpose was to be able to connect an OSD on serial port 3, but not be able to communicate at the same time with GUI and OSD.
It would be possible, but it would require some code evolution with multiple buffers.
It would be possible, but it would require some code evolution with multiple buffers.
Re: Use serial port 3 in MEGA too...
Hi,
i made a similar mod .. but for serial 1 .. it may be easy made variable with a define.. to choose the serial port that clones the gui data.
i posted it here:
viewtopic.php?f=7&t=2043&p=20241#p20241
the code is here http://code.google.com/p/multiwii/sourc ... rial_1_gui
i dont know whitch variant is better so maybe alex would like to take a look
it would be good for the atmega32u4 to make serial 1 usable for BT or what ever
regards Felix
i made a similar mod .. but for serial 1 .. it may be easy made variable with a define.. to choose the serial port that clones the gui data.
i posted it here:
viewtopic.php?f=7&t=2043&p=20241#p20241
the code is here http://code.google.com/p/multiwii/sourc ... rial_1_gui
i dont know whitch variant is better so maybe alex would like to take a look
it would be good for the atmega32u4 to make serial 1 usable for BT or what ever
regards Felix
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Use serial port 3 in MEGA too...
I will have a look on it
The result is generally simple, but it's not so easy to make things generic from a code patchwork.
The result is generally simple, but it's not so easy to make things generic from a code patchwork.
ronco wrote:Hi,
i made a similar mod .. but for serial 1 .. it may be easy made variable with a define.. to choose the serial port that clones the gui data.
i posted it here:
viewtopic.php?f=7&t=2043&p=20241#p20241
the code is here http://code.google.com/p/multiwii/sourc ... rial_1_gui
i dont know whitch variant is better so maybe alex would like to take a look
it would be good for the atmega32u4 to make serial 1 usable for BT or what ever
regards Felix
Re: Use serial port 3 in MEGA too...
nhadrian:
What OSD you try connect. With Misio-OSD i can use both ports at the same time. Requests from GUI and OSD are parsed separatly by MWC and no problems from this side. The output from MWC is sended by both SERIAL0 and SERIAL3 at the same time. OSD parse the output commands and use it or ignore it. Data requested by OSD is sended to MultiWiiConf too, but MultiwiiConf use it (or ignore - i don't know), and work normally.
In my case Misio-OSD and MultiWiiConf can work in the same time.
I know that this is not perfect solution, but work as I expected.
What OSD you try connect. With Misio-OSD i can use both ports at the same time. Requests from GUI and OSD are parsed separatly by MWC and no problems from this side. The output from MWC is sended by both SERIAL0 and SERIAL3 at the same time. OSD parse the output commands and use it or ignore it. Data requested by OSD is sended to MultiWiiConf too, but MultiwiiConf use it (or ignore - i don't know), and work normally.
In my case Misio-OSD and MultiWiiConf can work in the same time.
I know that this is not perfect solution, but work as I expected.
Re: Use serial port 3 in MEGA too...
I'm using Mobidrone OSD right now. In my oppinion, this is not the really solution.
For me, the final acceptable solution would be two total independent serial port. Not just for my OSD but for any general puropses...
For me, the final acceptable solution would be two total independent serial port. Not just for my OSD but for any general puropses...
Re: Use serial port 3 in MEGA too...
maybe instead of cloning the code , couldnt it just run a loop, checking each chosen serial port one after the other ?
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Use serial port 3 in MEGA too...
haydent wrote:maybe instead of cloning the code , couldnt it just run a loop, checking each chosen serial port one after the other ?
Here is a proposal made for a special mega serial file made back one May 12, 2012 however it seems to have gotten buried.
viewtopic.php?f=8&t=1516&start=50#p13929
Works very well.
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Use serial port 3 in MEGA too...
I will commit a nice improvement about serial port management.
With this mod, each of the 4 Serial port of the mega would be able to handle separately (with an own state for each) a GUI, an OSD, a spektrum sat, or whatever as long it is MSP compatible.
I managed for instance to connect 2 GUI + 1 android phone via bluetooth at the same time, using 3 distinct UART.
With this mod, each of the 4 Serial port of the mega would be able to handle separately (with an own state for each) a GUI, an OSD, a spektrum sat, or whatever as long it is MSP compatible.
I managed for instance to connect 2 GUI + 1 android phone via bluetooth at the same time, using 3 distinct UART.
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Use serial port 3 in MEGA too...
ronco wrote:it would be good for the atmega32u4 to make serial 1 usable for BT or what ever
regards Felix
I think you will also like the next commit, as it concerns also the UART of the promicro.
I tested it with 2 GUI running at the same time: one via the integrated USB, the other via the UART.
Re: Use serial port 3 in MEGA too...
Here is a proposal made for a special mega serial file made back one May 12, 2012 however it seems to have gotten buried.
viewtopic.php?f=8&t=1516&start=50#p13929
Works very well.
Do you have a solution that works with the latest protocol as I have tried to add the serial.ino from the post above and it doesn't compile.
Cheers
Matt
Re: Use serial port 3 in MEGA too...
Alexinparis wrote:ronco wrote:it would be good for the atmega32u4 to make serial 1 usable for BT or what ever
regards Felix
I think you will also like the next commit, as it concerns also the UART of the promicro.
I tested it with 2 GUI running at the same time: one via the integrated USB, the other via the UART.
sounds good
ill test it soon
thank you!
regards Felix
-
- Posts: 506
- Joined: Thu May 05, 2011 8:13 am
- Location: Slovenia
Re: Use serial port 3 in MEGA too...
Alexinparis wrote:...
I think you will also like the next commit, as it concerns also the UART of the promicro.
I tested it with 2 GUI running at the same time: one via the integrated USB, the other via the UART.
Is it possible to initialize different ports with different baud rates?!
Example: Serial0 and 1 with 115200 (for USB and Bluetooth), Serial3 with 19600 for APC220 telemetry (or XBee)?
Regards Andrej
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Use serial port 3 in MEGA too...
crashlander wrote:Alexinparis wrote:...
I think you will also like the next commit, as it concerns also the UART of the promicro.
I tested it with 2 GUI running at the same time: one via the integrated USB, the other via the UART.
Is it possible to initialize different ports with different baud rates?!
Example: Serial0 and 1 with 115200 (for USB and Bluetooth), Serial3 with 19600 for APC220 telemetry (or XBee)?
Regards Andrej
Yes, one different baudrate per UART is possible.
Currently, the default is the same for all, but you can tune it easily here in multiwii.ino
Code: Select all
SerialOpen(0,SERIAL_COM_SPEED);
#if defined(PROMICRO)
SerialOpen(1,SERIAL_COM_SPEED);
#endif
#if defined(MEGA)
SerialOpen(1,SERIAL_COM_SPEED);
SerialOpen(2,SERIAL_COM_SPEED);
SerialOpen(3,SERIAL_COM_SPEED);
#endif
Re: Use serial port 3 in MEGA too...
i have some problem with this function. I'm using this type of board:
viewtopic.php?f=6&t=1672
I'm using I2C flytron gps with it.
i merged the 2.1 code with the r1074 (copy r1074 files to 2.1) but i is't work for me. only serial 0 communicate with the gui, osd, bt.
what's the problem? how can i debug this error?
regard, Peter
viewtopic.php?f=6&t=1672
I'm using I2C flytron gps with it.
i merged the 2.1 code with the r1074 (copy r1074 files to 2.1) but i is't work for me. only serial 0 communicate with the gui, osd, bt.
what's the problem? how can i debug this error?
regard, Peter
Re: Use serial port 3 in MEGA too...
Alexinparis wrote:I will commit a nice improvement about serial port management.
With this mod, each of the 4 Serial port of the mega would be able to handle separately (with an own state for each) a GUI, an OSD, a spektrum sat, or whatever as long it is MSP compatible.
I managed for instance to connect 2 GUI + 1 android phone via bluetooth at the same time, using 3 distinct UART.
Alex when it will be available in the code?
Re: Use serial port 3 in MEGA too...
This is available from some days at code.google :
http://code.google.com/p/multiwii/sourc ... Wii_shared
http://code.google.com/p/multiwii/sourc ... Wii_shared
Re: Use serial port 3 in MEGA too...
Hi,
please, could some one clarify, what must i do to get wireless link with APC220 working? How exactly i need to setup the code for 57600 operation? And how to compile the MultiwiiConf to work at 57600 too? I would like to use lates rev 1130. Could some one compile it for me?
please, could some one clarify, what must i do to get wireless link with APC220 working? How exactly i need to setup the code for 57600 operation? And how to compile the MultiwiiConf to work at 57600 too? I would like to use lates rev 1130. Could some one compile it for me?
Re: Use serial port 3 in MEGA too...
KasparsL wrote:Hi,
please, could some one clarify, what must i do to get wireless link with APC220 working? How exactly i need to setup the code for 57600 operation? And how to compile the MultiwiiConf to work at 57600 too? I would like to use lates rev 1130. Could some one compile it for me?
Ok, got it compiled and working somehow =]
Re: Use serial port 3 in MEGA too...
how did you do it? can you explain for me?
Re: Use serial port 3 in MEGA too...
I would like to know too
Running the Crius Extend Board, Xbee is on serial3.
Running the Crius Extend Board, Xbee is on serial3.
Re: Use serial port 3 in MEGA too...
werty wrote:how did you do it? can you explain for me?
I changed the serial0 speed to be 57600 compiled it. changed the MultiwiiGui serial speed to 57600 and compiled it. To compile Gui by Processing, you need some files next to your*.pde file, I putted all files which were next to executable file and it worked.
Re: Use serial port 3 in MEGA too...
My Xbee is now working properly on serial3 after fidling with the configuration via X-CTU a little bit more.
Have also activated LCD_TELEMETRY, not sure if this is necessary for Xbee (but would be necessary for my LCD )
Have also activated LCD_TELEMETRY, not sure if this is necessary for Xbee (but would be necessary for my LCD )
Re: Use serial port 3 in MEGA too...
KasparsL wrote:werty wrote:how did you do it? can you explain for me?
I changed the serial0 speed to be 57600 compiled it. changed the MultiwiiGui serial speed to 57600 and compiled it. To compile Gui by Processing, you need some files next to your*.pde file, I putted all files which were next to executable file and it worked.
thank you very much
Re: Use serial port 3 in MEGA too...
Is there a release based on v2.1 that make the serial work on a atmega32u4 board (drofly)?
Could i use this one?
http://code.google.com/p/multiwii/sourc ... Wii_shared
thanks,
manu
Could i use this one?
http://code.google.com/p/multiwii/sourc ... Wii_shared
thanks,
manu
Re: Use serial port 3 in MEGA too...
Hey,
ronco released a version with Serial1 working on the 32u4 and committed it to his branch in the multiwii repo.
I am currently flying with the version he posted here http://www.rc-heli-fan.org/post1413559.html#p1413559. It works great so I didn't try the version from the repo.
ronco released a version with Serial1 working on the 32u4 and committed it to his branch in the multiwii repo.
I am currently flying with the version he posted here http://www.rc-heli-fan.org/post1413559.html#p1413559. It works great so I didn't try the version from the repo.
Re: Use serial port 3 in MEGA too...
Yeahiii!, its working
Thanks a lot!
manu
Thanks a lot!
manu