Andy Spencer [Mon, 10 Mar 2014 09:14:40 +0000 (09:14 +0000)]
Improve time sync accuracy
This code is kind of messy, but it is more accurate.
Noise between time syncs seems to be around 50 nanoseconds. Noise on
external event readings seems to be around 500 nanoseconds. External
events were tested by manually inserting pins.
The mbeds seems to be consistency apart on external events, so some of
the noise could be caused by differing thresholds on the wires. Rising
edge mode on mbed seems to be ahead, and in falling edge the other is
ahead.
A large portion of the measurement errors was caused by not properly
learning pending DMA requests before enabling the DMA channels. The
pending requests seem to need to be disabled in the DMAMUX as well as
the DMA controller, and on the pins as well. It's not clearly what the
idea reset method is.
Andy Spencer [Mon, 10 Mar 2014 00:59:02 +0000 (00:59 +0000)]
Work on second mbed
Add control program file:
- Can be used to send a time initialization message to the mbed
Add install program:
- Install programs on both mbeds and initialize the time on one
Add IRQ driven serial interface:
- Since we don't have spare DMA controllers available for this
homework we need to transmit serial data some other way.
- The IRQ code allows us to queue up large messages to be transmitted
asynchronous to main background loop. It should also help with
receiving data at a high rate.
Add task table to main:
- This lets us schedule tasks at fixed intervals.
Fix various bugs:
- Timer dma code reset avoid config errors cause by periodical request
while the DMA controller has nothing to transmit.