- C 81.3%
- Makefile 18.7%
| doc/img | ||
| firmware | ||
| hardware | ||
| .gitignore | ||
| .gitmodules | ||
| LICENSE | ||
| README.md | ||
µCurrent controller
a MSP430F5510 based project that controls the power delivery to Dave L. Jones's µCurrent
homepage: https://codeberg.org/subDIMENSION/ucurrent_ctrl
author: Petre Rodan <2b4eda@subdimension.ro>
license: BSD
if you forget to turn off the original µCurrent you will find the enclosed 2032 Li cell completely flat the next day. this project provides a timeout feature to it. a push-button is used to start up both this circuit and the µCurrent. multiple presses will either reset the timeout counter or increase the timeout period. the initial timeout period can be optionally modified via a 3V serial uart. also in case the output voltage is low enough for a given period the µCurrent is turned off.
uC pinout:
- P1.1 IN digital - push button trigger
- P1.4 OUT digital - power-latch my circuit
- P1.5 OUT digital - enable power delivery to the uCurrent
- P2.0 OUT digital - blinky
- P6.0 IN analog - battery voltage
- P4.1 IO - SDA (i2c for ADS1110)
- P4.2 IO - SCL
connectors:
- external power - either 3V Li Cell or 3.7V LiPo/Li-ion (MOLEX 0530470210)
- push button - optional external push button tied to the case (MOLEX 0530470210)
- ucurrent power - uCurrent connections (MOLEX 0530470210)
- debug - TI spy-bi-wire interface and serial uart for programming, debug and user input (MOLEX 0530470610)
power:
- the uCurrent has the cell unpopulated and the power switch set to the "ON" position.
- this circuit will provide the 3V needed to the uCurent
software requirements:
build and debug
make sure to pull the atlas430 dependecy before trying to compile the firmware:
git submodule update --init --recursive
the project is based on a Makefile. REFLIB_ROOT defines the path to where this atlas430 repository has been cloned, TARGET represents the target microcontroller and config.h will be automatically expanded into compilation macros (-DFOO arguments to be sent to gcc).
the makefile supports the following options:
# check if everything is installed and paths are correct
gmake envcheck
# remove the build/DEVICE/ directory
gmake TARGET=MSP430FXXXX clean
# compile the project and library
# create dependency tree and source code tags
gmake TARGET=MSP430FXXXX
# burn the firmware onto the target microcontroller
gmake TARGET=MSP430FXXXX install
# perform an optional static scan of the source code
gmake TARGET=MSP430FXXXX cppcheck # needs dev-util/cppcheck
gmake TARGET=MSP430FXXXX scan-build # needs sys-devel/clang +static-analyzer
gmake TARGET=MSP430FXXXX coverity # needs a coverity account and the associated secret key
in order to use gdb to debug the project make sure to enable the CONFIG_DEBUG macro in config.h and run in a terminal
LD_PRELOAD="./lib/atlas430/lib/$(uname -s)/libmsp430.so" mspdebug --allow-fw-update tilib gdb
# or simply
gmake debug_listen
and then start gdb from within the project directory:
gmake TARGET=MSP430FXXXX debug
commonly used commands from within gdb provided as example for the unit tests:
target remote localhost:2000
monitor reset
monitor erase
load build/MSP430FXXXX/main.elf
b
disassemble
nexti
info registers
continue
tui enable
more images of the prototype are available here
