Trying to log data from UM6 sensor with GPS receiver LS20031. I have two problems: - I can't log to file at a fast rate (<0.5s) without data values freezing to a fixed value. Print to pc screen it works fine. Ideally I would do this with an interrupt (e.g. ticker) so that the time of each reading is a fixed interval - I removed this as I thought this was causing the problem. - I want to record GPS lat and long. I have setup the GPS ground speed so I know the sensor are communicating. So I possibly havent set the config file to correctly interpet these two signals.

Dependencies:   MODSERIAL mbed

Fork of UM6_IMU_AHRS_2012 by lhiggs CSUM

Committer:
njewin
Date:
Sat May 04 09:34:15 2013 +0000
Revision:
6:43029c69b9ac
Parent:
0:03c649c76388
publish version ; bugs need correcting for:; - logging to file at 10ms rate; - reading GPS lat and long data

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lhiggs 0:03c649c76388 1 /* $Id:$
lhiggs 0:03c649c76388 2
lhiggs 0:03c649c76388 3 1.23 25th July 2012
lhiggs 0:03c649c76388 4
lhiggs 0:03c649c76388 5 * LPC1768 code as was. This release includes "alpha" support for the LPC11U24
lhiggs 0:03c649c76388 6
lhiggs 0:03c649c76388 7 1.22 19th April 2012
lhiggs 0:03c649c76388 8
lhiggs 0:03c649c76388 9 * http://mbed.org/forum/bugs-suggestions/topic/2936/
lhiggs 0:03c649c76388 10 * Bug fix, protect important buffer pointers from IRQ corruption.
lhiggs 0:03c649c76388 11 Credits:
lhiggs 0:03c649c76388 12 Anthony Wieser http://mbed.org/users/WieserSoftwareLtd/ for the fix.
lhiggs 0:03c649c76388 13 BlazeX http://mbed.org/users/BlazeX/ for the alert that a fix was needed!
lhiggs 0:03c649c76388 14
lhiggs 0:03c649c76388 15 1.21 10 May 2011
lhiggs 0:03c649c76388 16
lhiggs 0:03c649c76388 17 * http://mbed.org/forum/mbed/topic/2264
lhiggs 0:03c649c76388 18
lhiggs 0:03c649c76388 19 1.20 26 April 2011
lhiggs 0:03c649c76388 20
lhiggs 0:03c649c76388 21 * Bug fix, not blocking on transmit
lhiggs 0:03c649c76388 22 by Erik Petrich, http://mbed.org/forum/bugs-suggestions/topic/2200
lhiggs 0:03c649c76388 23
lhiggs 0:03c649c76388 24 1.19 20 April 2011
lhiggs 0:03c649c76388 25
lhiggs 0:03c649c76388 26 * Fixed some doxygen comment bugs.
lhiggs 0:03c649c76388 27
lhiggs 0:03c649c76388 28 1.18 20 April 2011
lhiggs 0:03c649c76388 29
lhiggs 0:03c649c76388 30 * All callbacks now use MODSERIAL_callback (rather than Mbed's FunctionPointer[1] type)
lhiggs 0:03c649c76388 31 to store and invoke it's callbacks. This allows MODSERIAL to pass a parameter
lhiggs 0:03c649c76388 32 to callbacks. The function prototype is now void func(MODSERIAL_IRQ_INFO *q).
lhiggs 0:03c649c76388 33 * Callbacks now pass a pointer to a MODSERIAL_IRQ_INFO class type.
lhiggs 0:03c649c76388 34 This class holds a pointer to the MODSERIAL object that invoked the callback
lhiggs 0:03c649c76388 35 thus freeing callbacks need to use the global variable of the original
lhiggs 0:03c649c76388 36 MODSERIAL instance.
lhiggs 0:03c649c76388 37 * MODSERIAL_IRQ_INFO also declares public functions that are protected within MODSERIAL
lhiggs 0:03c649c76388 38 thus allowing certain functions to be restricted to callback context only.
lhiggs 0:03c649c76388 39 * New function MODSERIAL_IRQ_INFO::rxDiscardLastChar() allows an rxCallback function
lhiggs 0:03c649c76388 40 to remove the character that was just placed into the RX buffer.
lhiggs 0:03c649c76388 41
lhiggs 0:03c649c76388 42 [1] http://mbed.org/users/AjK/libraries/FPointer/latest/docs/
lhiggs 0:03c649c76388 43
lhiggs 0:03c649c76388 44 1.17 08/Mar/2011
lhiggs 0:03c649c76388 45 Fixed a memory leak in the DMA code.
lhiggs 0:03c649c76388 46
lhiggs 0:03c649c76388 47 1.16 - 12 Feb 2011
lhiggs 0:03c649c76388 48
lhiggs 0:03c649c76388 49 * Missed one, doh!
lhiggs 0:03c649c76388 50
lhiggs 0:03c649c76388 51 1.15 - 12 Feb 2011
lhiggs 0:03c649c76388 52
lhiggs 0:03c649c76388 53 * Fixed some typos.
lhiggs 0:03c649c76388 54
lhiggs 0:03c649c76388 55 1.14 - 7 Feb 2011
lhiggs 0:03c649c76388 56
lhiggs 0:03c649c76388 57 * Fixed a bug in __putc() that caused the output buffer pointer to
lhiggs 0:03c649c76388 58 become corrupted.
lhiggs 0:03c649c76388 59
lhiggs 0:03c649c76388 60 1.13 - 20/01/2011
lhiggs 0:03c649c76388 61
lhiggs 0:03c649c76388 62 * Added extra documentation.
lhiggs 0:03c649c76388 63 * Fixed some typos.
lhiggs 0:03c649c76388 64
lhiggs 0:03c649c76388 65 1.12 - 20/01/2011
lhiggs 0:03c649c76388 66
lhiggs 0:03c649c76388 67 * Added new "autoDetectChar()" function. To use:-
lhiggs 0:03c649c76388 68 1st: Add a callback to invoke when the char is detected:-
lhiggs 0:03c649c76388 69 .attach(&detectedChar, MODSERIAL::RxAutoDetect);
lhiggs 0:03c649c76388 70 2nd: Send the char to detect.
lhiggs 0:03c649c76388 71 .autoDectectChar('\n');
lhiggs 0:03c649c76388 72 Whenever that char goes into the RX buffer your callback will be invoked.
lhiggs 0:03c649c76388 73 Added example2.cpp to demo a simple messaging system using this auto feature.
lhiggs 0:03c649c76388 74
lhiggs 0:03c649c76388 75
lhiggs 0:03c649c76388 76 1.11 - 23/11/2010
lhiggs 0:03c649c76388 77
lhiggs 0:03c649c76388 78 * Fixed a minor issue with 1.10 missed an alteration of name change.
lhiggs 0:03c649c76388 79
lhiggs 0:03c649c76388 80 1.10 - 23/11/2010
lhiggs 0:03c649c76388 81
lhiggs 0:03c649c76388 82 * Rename the DMA callback from attach_dma_complete() to attach_dmaSendComplete()
lhiggs 0:03c649c76388 83
lhiggs 0:03c649c76388 84 1.9 - 23/11/2010
lhiggs 0:03c649c76388 85
lhiggs 0:03c649c76388 86 * Added support for DMA sending of characters. Required is
lhiggs 0:03c649c76388 87 the MODDMA library module:-
lhiggs 0:03c649c76388 88 http://mbed.org/users/AjK/libraries/MODDMA/latest
lhiggs 0:03c649c76388 89 See example_dma.cpp for more information.
lhiggs 0:03c649c76388 90
lhiggs 0:03c649c76388 91 1.8 - 22/11/2010
lhiggs 0:03c649c76388 92
lhiggs 0:03c649c76388 93 * Added code so that if a buffer is set to zero length then
lhiggs 0:03c649c76388 94 MODSERIAL defaults to just using the FIFO for that stream
lhiggs 0:03c649c76388 95 thus making the library "fall back" to teh same operation
lhiggs 0:03c649c76388 96 that the Mbed Serial library performs.
lhiggs 0:03c649c76388 97 * Removed dmaSend() function that should have been removed
lhiggs 0:03c649c76388 98 at 1.7
lhiggs 0:03c649c76388 99
lhiggs 0:03c649c76388 100 1.7 - 21/11/2010
lhiggs 0:03c649c76388 101
lhiggs 0:03c649c76388 102 * Remove the DMA enum from MODSERIAL.h as it's not currently
lhiggs 0:03c649c76388 103 ready for release.
lhiggs 0:03c649c76388 104 * Added page doxygen comments.
lhiggs 0:03c649c76388 105
lhiggs 0:03c649c76388 106 1.6 - 21/11/2010
lhiggs 0:03c649c76388 107
lhiggs 0:03c649c76388 108 * Version 1.5 solved a blocking problem on putc() when called
lhiggs 0:03c649c76388 109 from another ISR. However, isr_tx() invokes a callback of it's
lhiggs 0:03c649c76388 110 own when a byte is tranferred from TX buffer to TX FIFO. User
lhiggs 0:03c649c76388 111 programs may interpret that as an IRQ callback. That's an ISR
lhiggs 0:03c649c76388 112 call from within an existing ISR which is not good. So the
lhiggs 0:03c649c76388 113 TxIrq callback from isr_tx is now conditional. It will only
lhiggs 0:03c649c76388 114 be called when isr_tx() is actually within it's own ISR and
lhiggs 0:03c649c76388 115 not when called from alternate ISR handlers.
lhiggs 0:03c649c76388 116
lhiggs 0:03c649c76388 117 1.5 - 21/11/2010
lhiggs 0:03c649c76388 118
lhiggs 0:03c649c76388 119 * Calling putc() (or any derived function that uses it like
lhiggs 0:03c649c76388 120 printf()) while inside an interrupt service routine can
lhiggs 0:03c649c76388 121 cause the system to lock up if the TX buffer is full. This
lhiggs 0:03c649c76388 122 is because bytes are only transferred from the TX buffer to
lhiggs 0:03c649c76388 123 the TX FIFO via the TX ISR. If we are, say in an RX ISR already,
lhiggs 0:03c649c76388 124 then the TX ISR will never trigger. The TX buffer stays full and
lhiggs 0:03c649c76388 125 there is never space to putc() the byte. So, while putc() blocks
lhiggs 0:03c649c76388 126 waiting for space it calls isr_tx() to ensure if TX FIFO space
lhiggs 0:03c649c76388 127 becomes available it will move bytes from the TX buffer to TX
lhiggs 0:03c649c76388 128 FIFO thus removing the blocking condition within putc().
lhiggs 0:03c649c76388 129
lhiggs 0:03c649c76388 130 1.4 - 21/11/2010
lhiggs 0:03c649c76388 131
lhiggs 0:03c649c76388 132 * Removed all the new DMA code. I wish mbed.org had proper SVN
lhiggs 0:03c649c76388 133 versioning, I'm use to working in HEAD and BRANCHES after I've
lhiggs 0:03c649c76388 134 released a project. Getting bug reports in current releases
lhiggs 0:03c649c76388 135 while trying to dev new code is hard to manage without source
lhiggs 0:03c649c76388 136 control of some type!
lhiggs 0:03c649c76388 137
lhiggs 0:03c649c76388 138 1.3 - 21/11/2010
lhiggs 0:03c649c76388 139
lhiggs 0:03c649c76388 140 * Fixed a macro problem with txIsBusy()
lhiggs 0:03c649c76388 141 * Started adding code to use "block data" sending using DMA
lhiggs 0:03c649c76388 142 * Removed #include "IOMACROS.h"
lhiggs 0:03c649c76388 143
lhiggs 0:03c649c76388 144 1.2 - 21/11/2010
lhiggs 0:03c649c76388 145
lhiggs 0:03c649c76388 146 * Removed unsed variables from flushBuffer()
lhiggs 0:03c649c76388 147 * Fixed a bug where both RX AND TX fifos are cleared/reset
lhiggs 0:03c649c76388 148 when just TX OR RX should be cleared.
lhiggs 0:03c649c76388 149 * Fixed a bug that cleared IIR when in fact it should be left
lhiggs 0:03c649c76388 150 alone so that any pending interrupt after flush is handled.
lhiggs 0:03c649c76388 151 * Merged setBase() into init() as it wasn't required anywhere else.
lhiggs 0:03c649c76388 152 * Changed init() to enforce _uidx is set by Serial to define the _base
lhiggs 0:03c649c76388 153 address of the Uart in use.
lhiggs 0:03c649c76388 154
lhiggs 0:03c649c76388 155 1.1 - 20/11/2010
lhiggs 0:03c649c76388 156
lhiggs 0:03c649c76388 157 * Added this file
lhiggs 0:03c649c76388 158 * Removed cruft from GETC.cpp
lhiggs 0:03c649c76388 159 * "teh" should be "the", why do my fingers do that?
lhiggs 0:03c649c76388 160
lhiggs 0:03c649c76388 161 1.0 - 20/11/2010
lhiggs 0:03c649c76388 162
lhiggs 0:03c649c76388 163 * First release.
lhiggs 0:03c649c76388 164
lhiggs 0:03c649c76388 165 */