Repository navigation
Conversation
…ance with Microchip recommandation, cf DS70188E-page 17-16.
|
Guy Francois, Thank you very much for this Pull Request, and all the code that you have been developing. Please can you tell me a little more about the "Wrong Data Transfer on UART". I have exchanged email's with Bill on the topic of this Pull Request, and he is reluctant to change the code which has appeared to work for so many years. One of the good points about our Autopilot, is the manual control is almost immediate on power up. And on a more general point, we try not to put in any delay statements that just stop all the code. Bill's understanding of the current code is that by the time we send serial output, the PLL has locked. And that this has worked for a long time. So it would be good for us to understand in more detail any testing that you have done, which definitely shows that the UART output is at the wrong speed because the PLL has not locked. If we do make this change, then Bill feels it should go at the very end of initialisation, and that the serial output should come immediately afterwards. We will apparently need to test it very carefully. Best wishes, Pete |
…re sending UART messages.
…e was an unsigned value that was passed as the second argument to __builtin_divsd
…eversed ailerons.
|
Guy and Peter, #if (USE_MAVLINK == 1) That way there is no guessing whether or not enough time has gone by for the pll to lock, and there is no blocking anywhere if it is not, and no data goes out if the pll is not locked. Best regards, |
… build of the XPlane plugin for linux.
… makefile, quiet some warnings
…the cause was an unsigned value that was passed as the second argument to __builtin_divsd" This reverts commit 6cea6cf.
…ation turns to invert. Also fixed a sign error in the turn rate computation at 4 G.
|
Hi Bill and Pete, I will suggest to go ahead with Bill's idea and to create a boolean initilized to 0 at the beginning of the main init phase (matrixpilot_init() ) and set to 1 at the end. This boolean will be used to allow sending out messages. Best regards, gfm |
|
Hi Guy,
In the latest version of MP, condition 1 is already taken care of, there is a global interrupt enable flag that gets turned on at the very end of initialization so that the code starts executing after everything is initialized: void udb_init_irq(void) So, all we need to do is to satisfy the second condition. I propose we do that by checking the PLL locked bit in the code that generates telemetry, and skip sending data if it is not locked. I suggested that in my previous comment: #if (USE_MAVLINK == 1) If you agree, I will create a pull request for you and Peter to look at that should make the telemetry output "bullet-proof". Best regards, |
|
Guy and Peter, |
|
Hi Bill & Pete int matrixpilot_init(void) This operation shows that message try to be sent during the init phase, before its end, so before setting the baud rate. |
|
I think the question that has now arisen is whether the Interrupts are turned on or off when the CPU starts up. To partially answer that question, I have test commented out the re-enabling of interrupts like this:- I then ran the code in HILSIM. The Servos run fine, the Plane flys correctly in FBW mode, and the telemetry (SERIAL_UDB_EXTRA in my case) all comes out of the UDB5 correctly. So udb_init_irq() is currently not really enabling the interrupts. They appear to be enabled all ready. And as a side note, I see that there is a separate and more appropriate Global Interrupt Flag, that can be set or unset to stop all interrupts, without changing the settings of SRbit.IPL. That said, Setting SRBits.IPL = 7, will stop all the main external interrupts from working. Best wishes, Pete |
|
Hi Bill & Pete, |
…ance with Microchip recommandation, cf DS70188E-page 17-16.