WellDone / MoMo-Firmware

Embedded PIC Firmware and hardware designs for the WellDone Mobile Monitor (MoMo).
welldone.org
Other
8 stars 6 forks source link

Asynchronous MIB Support #188

Closed timburke closed 9 years ago

timburke commented 9 years ago

This PR implements the new version of asynchronous MIB v2.0. There are still refinements left to do but it works and appears stable in hardware so I'm putting it up for @amcgee to test.

The documentation of each part is in doc/8{0,1,2,3}-MIB-*.md

Specifically, this PR implements:

  1. New PIC12 Executive with the following features
    • Very good unit test coverage of major functionality
    • Checksum verification before running application firmware
    • New application MIB block that supports API compatibility version and firmware version
    • Support for MIB protocol v2.0
    • PRO mode compiler is no longer required for compilation
  2. Updated PIC24 firmware with the following new features
    • Cleaned up various headers that weren't actually portable or out of date
    • Support for MIB protocol v2.0
    • Fixed performance bug in taskloop where a task could be added to the loop without being run until the device woke from sleep from an external event (this is still possible but the odds of it happening are greatly reduced).
    • Updated all pic24 chips to be more robust to noise on the bus.

Included in the new MIB bus code is a better of way of checking whether the bus is idle that cannot be confused by noise. Previously, if noise caused a false start to appear on the bus, everyone could hang thinking the bus was in use forever. Now, the bus is checked for ~ 4 clock periods and if no activity is seen, it is assumed to be idle. This check is sufficient since it is not possible for someone to be in the middle of a call without either SDA or SCL going low at least once in 4 clock periods. (really 1 clock period but the 4 is to allow for clock slop and ease of implementation.

Updating Instructions

You must update pymomo to the latest PR version, gpsim to the latest PR version and this PR at the same time and reflash every pic12_executive, mainboard and fsu together since old and new firmwares are not compatible on the wire. Compilation of the new code also required an updated pymomo using the PR on that repository since new build steps were added to patch in checksums into pic12 application firmwares and the mib file format changed.

Known issues

timburke commented 9 years ago

This request has been superseded by a later one