bike-lights.git
7 days agoadc.c: make the ADC handlers non-atomic master
Jan "Yenya" Kasprzak [Fri, 4 Jan 2013 16:26:08 +0000]
adc.c: make the ADC handlers non-atomic

will it work?

7 days agoadc.c: routine for synchronous conversion
Jan "Yenya" Kasprzak [Fri, 4 Jan 2013 14:50:14 +0000]
adc.c: routine for synchronous conversion

3 weeks agoschematics: more low-pass filters, fuse removed
Jan "Yenya" Kasprzak [Sat, 15 Dec 2012 20:51:23 +0000]
schematics: more low-pass filters, fuse removed

4 weeks agoMerge branch 'master' of ssh://anxur.fi.muni.cz/~kas/html/git/bike-lights
Jan "Yenya" Kasprzak [Wed, 12 Dec 2012 04:03:59 +0000]
Merge branch 'master' of ssh://anxur.fi.muni.cz/~kas/html/git/bike-lights

4 weeks agoschematics: bug fixes
Jan "Yenya" Kasprzak [Tue, 11 Dec 2012 16:16:29 +0000]
schematics: bug fixes

- low-pass filters added to the ADC pins measuring LED current
- prog_ena jumper changed to disconnect pwm0 only, as this is what makes
problem during in-system programming
- labels for LED and battery connectors moved outside the footprint

4 weeks agopwm.c: maximum TOP value of T/C 1 is 0x3FF.
Jan "Yenya" Kasprzak [Mon, 10 Dec 2012 21:00:28 +0000]
pwm.c: maximum TOP value of T/C 1 is 0x3FF.

4 weeks agobuttons.c - the correct IRQ is PCIE1
Jan "Yenya" Kasprzak [Sat, 8 Dec 2012 21:32:40 +0000]
buttons.c - the correct IRQ is PCIE1

4 weeks agoAbility to quickly build testing firmware
Jan "Yenya" Kasprzak [Sat, 8 Dec 2012 19:36:27 +0000]
Ability to quickly build testing firmware

Testing is actually development,
and non-testing is "safe" for production use, even with some
features disabled. At least for now :-)

4 weeks agoADC measurements in mA
Jan "Yenya" Kasprzak [Sat, 8 Dec 2012 19:27:41 +0000]
ADC measurements in mA

5 weeks agopwm.c: publish only PWM_MAX as non-internal value
Jan "Yenya" Kasprzak [Fri, 7 Dec 2012 22:03:55 +0000]
pwm.c: publish only PWM_MAX as non-internal value

The TOP value of Timer/Counter 1 is computed inside pwm.c and it is
purely internal to this module.

5 weeks agopwmled.c: factored out probing to a separate function
Jan "Yenya" Kasprzak [Fri, 7 Dec 2012 21:51:20 +0000]
pwmled.c: factored out probing to a separate function

5 weeks agopwmled.c: save error sum between mode switches
Jan "Yenya" Kasprzak [Fri, 7 Dec 2012 21:03:49 +0000]
pwmled.c: save error sum between mode switches

otherwise it leads to instability when during short blink the error
sum does not manage to increase the stride.

Also, use 32-bit ints to simplify the code and save some branches.

5 weeks agopwm.c: make it usable from non-atomic blocks
Jan "Yenya" Kasprzak [Thu, 6 Dec 2012 23:10:20 +0000]
pwm.c: make it usable from non-atomic blocks

5 weeks agopwm.c - remove unused code
Jan "Yenya" Kasprzak [Thu, 6 Dec 2012 20:38:03 +0000]
pwm.c - remove unused code

5 weeks agopwm.c: PLL clock enabling code
Jan "Yenya" Kasprzak [Thu, 6 Dec 2012 20:34:00 +0000]
pwm.c: PLL clock enabling code

- factored out from init_pwm() in order to be able to suspend PLL also
during normal operation
- use _delay_us(100) instead of _delay_ms(1) as recommended by datasheet
- disable PLL in susp_pwm()

6 weeks agofirmware: control logic moved to a separate module
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 16:37:53 +0000]
firmware: control logic moved to a separate module

- buttons.c now controls status LEDs only when setting parameters
- pattern.c:
can use NULL instead of off_pattern
has number_pattern() than can also set up inverted patterns
contains only number and boot patterns as static variables
can reload all patterns if some state changes
- ambient.c resets all patterns when ambient zone changes
- control.c:
- now contains almost all pattern strings, only those needed by
other modules are exported
- status LED and illumination LED can be controlled by buttons.c
- separate _pattern_select() function for each LED

6 weeks agoadc: always-running ADC
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 10:23:27 +0000]
adc: always-running ADC

Don't rely on the timer IRQ to start next round of ADC measurements,
start it immediately after the previous one finishes.

6 weeks agologging: consistent init function naming
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 10:13:15 +0000]
logging: consistent init function naming

6 weeks agopatterns: consistent init function naming
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 10:10:04 +0000]
patterns: consistent init function naming

6 weeks agoambient light: consistent init function naming
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 10:09:11 +0000]
ambient light: consistent init function naming

6 weeks agogpio: consistent init function naming
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 10:08:33 +0000]
gpio: consistent init function naming

6 weeks agopwmled: consistent init function naming
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 10:07:02 +0000]
pwmled: consistent init function naming

6 weeks agogpio: rework
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 10:05:36 +0000]
gpio: rework

use correct swtiching between pin input and output
(as per the datasheet, section 10.1.2),
remove old logic of wakeup LED notifications

6 weeks agobuttons, wakeup rework
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 09:58:31 +0000]
buttons, wakeup rework

Set up all the pin-change interrupts even for shutdown,
fix the old pins used in the code (main.c),
factor out waiting for button release from main.c to buttons.c,
fix the status LED notification during wake-up.

6 weeks agopwmled.c: rework
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 01:23:45 +0000]
pwmled.c: rework

Probing and time-averaging works, but several corner cases need to be
polished.

6 weeks agomake timer faster, sub-1 LSB PWM values need it
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 01:22:58 +0000]
make timer faster, sub-1 LSB PWM values need it

otherwise, the step-up blinks with low pwm settings

6 weeks agopattern.c: call pwmled.c unconditionally
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 01:14:57 +0000]
pattern.c: call pwmled.c unconditionally

- no not query whether the LED is alive - pwmled.c will handle this
in that case.

6 weeks agopattern.c: mode1_pattern out of modes 1 and 2 instead of 1 and 4
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 01:14:30 +0000]
pattern.c: mode1_pattern out of modes 1 and 2 instead of 1 and 4

6 weeks agoadc: measure gain stage offset _slowly_
Jan "Yenya" Kasprzak [Fri, 30 Nov 2012 01:12:05 +0000]
adc: measure gain stage offset _slowly_

use running sum of 1<<6 measurements, and do only one measurement
per loop in order to not disturb other measurements. Also, do not log
timer overruns for ADC, as we do most of the processing in ADC IRQs now.

6 weeks agopwm.c: typo fixes
Jan "Yenya" Kasprzak [Thu, 29 Nov 2012 20:07:51 +0000]
pwm.c: typo fixes

6 weeks agofirmware: emulate higher resolution of PWM
Jan "Yenya" Kasprzak [Thu, 29 Nov 2012 13:36:45 +0000]
firmware: emulate higher resolution of PWM

Emulate the sub-1 LSB resolution of PWM by updating the PWM values
in the timer interrupt routine

6 weeks agoadc.c: keep ADC enabled
Jan "Yenya" Kasprzak [Thu, 29 Nov 2012 13:05:08 +0000]
adc.c: keep ADC enabled

7 weeks agopwmled: more logging
Jan "Yenya" Kasprzak [Thu, 22 Nov 2012 22:00:00 +0000]
pwmled: more logging

7 weeks agopwmled: remove old unused function
Jan "Yenya" Kasprzak [Thu, 22 Nov 2012 21:26:08 +0000]
pwmled: remove old unused function

7 weeks agoambient: new zones
Jan "Yenya" Kasprzak [Thu, 22 Nov 2012 00:11:31 +0000]
ambient: new zones

7 weeks agobuttons.c: param setup fixes
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 23:58:01 +0000]
buttons.c: param setup fixes

7 weeks agopatterns: zero pattern
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 23:57:03 +0000]
patterns: zero pattern

similar to off, but does not last forever

7 weeks agopwmled: regulation using sum of differences
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 23:34:48 +0000]
pwmled: regulation using sum of differences

7 weeks agoadc: log missed timer interrupts
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 23:28:29 +0000]
adc: log missed timer interrupts

7 weeks agopattern.c: remove unused function
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 22:15:36 +0000]
pattern.c: remove unused function

7 weeks agopatterns: use mode1_pattern for all PWM LEDs for now
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 22:14:26 +0000]
patterns: use mode1_pattern for all PWM LEDs for now

7 weeks agobuttons.c: fix for setup timeout
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 22:12:31 +0000]
buttons.c: fix for setup timeout

we need to test whether the timeout is reached only when the setup
is in progress ;-)

7 weeks agolights.h: PWM_MAX for better measurements
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 22:08:22 +0000]
lights.h: PWM_MAX for better measurements

The PWM frequency should be different than the ADC frequency (125 kHz)
in order to measure in different parts of the PWM cycle (I should have
added a low-pass filter to the ADC inputs, but whatever :-)

7 weeks agoadc: measure the offset of the gain-20 stage
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 22:07:17 +0000]
adc: measure the offset of the gain-20 stage

We measure the offset of the ADC1:ADC1 gain 20 stage and subtract it
from ADC0:ADC1 and ADC2:ADC1 differential readings.

7 weeks agoadc: only 4 measurements for single-ended pwm
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 22:06:04 +0000]
adc: only 4 measurements for single-ended pwm

7 weeks agobuttons: init state when suspended during user params setup
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 20:12:26 +0000]
buttons: init state when suspended during user params setup

7 weeks agomain.c: disable also the analog comparator
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 17:14:09 +0000]
main.c: disable also the analog comparator

7 weeks agoadc: average several measurements
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 17:10:40 +0000]
adc: average several measurements

Also do not define the MUX values in the table in order to be able
to set also GSEL and ADMUX5 if needed.

Disable the ADC between the conversions.

7 weeks agofirmware: button/status LEDs
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 16:06:20 +0000]
firmware: button/status LEDs

(maybe the status led handling should be done in a separate module?)

7 weeks agopatterns: PATTERN_FOREVER
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 15:30:08 +0000]
patterns: PATTERN_FOREVER

7 weeks agofirmware: buttons-press and pwrdown rework
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 15:05:37 +0000]
firmware: buttons-press and pwrdown rework

Reworked short and long button presses. The long press is now also
reported only _after_ release, which allows us to simplify the power-down
case in buttons.c, and even in main.c.

7 weeks agofirmware/buttons.c: preliminary user params setup
Jan "Yenya" Kasprzak [Wed, 21 Nov 2012 14:32:21 +0000]
firmware/buttons.c: preliminary user params setup

7 weeks agopwmled.c: use mA-based values instead of PWM value-based
Jan "Yenya" Kasprzak [Sat, 17 Nov 2012 22:34:41 +0000]
pwmled.c: use mA-based values instead of PWM value-based

7 weeks agopins.txt: current ranges for 0.033 Ohm sensing resistor
Jan "Yenya" Kasprzak [Sat, 17 Nov 2012 21:58:15 +0000]
pins.txt: current ranges for 0.033 Ohm sensing resistor

7 weeks agofirmware/battery: init function, new resistor sizes
Jan "Yenya" Kasprzak [Sat, 17 Nov 2012 21:21:35 +0000]
firmware/battery: init function, new resistor sizes

7 weeks agofirmware: move PWM_MAX to lights.h
Jan "Yenya" Kasprzak [Sat, 17 Nov 2012 21:15:46 +0000]
firmware: move PWM_MAX to lights.h

7 weeks agoadc.c: MUX for LED 3 is on its final position
Jan "Yenya" Kasprzak [Sat, 17 Nov 2012 13:00:33 +0000]
adc.c: MUX for LED 3 is on its final position

8 weeks agopattern.c: make patterns accessible from other modules
Jan "Yenya" Kasprzak [Wed, 14 Nov 2012 00:11:36 +0000]
pattern.c: make patterns accessible from other modules

8 weeks agopattern.c: start numeric pattern with pause
Jan "Yenya" Kasprzak [Mon, 12 Nov 2012 22:51:55 +0000]
pattern.c: start numeric pattern with pause

8 weeks agoMakefile: schematics file printing
Jan "Yenya" Kasprzak [Tue, 30 Oct 2012 15:41:15 +0000]
Makefile: schematics file printing

The image.scm file taken from geda sources, in order to be independent
on actual geda install directories.

8 weeks agoschematics: .gitignore web images
Jan "Yenya" Kasprzak [Tue, 30 Oct 2012 15:41:01 +0000]
schematics: .gitignore web images

8 weeks agobattery voltage sensor
Jan "Yenya" Kasprzak [Mon, 12 Nov 2012 22:47:06 +0000]
battery voltage sensor

2 months agonum_pattern: longer delay
Jan "Yenya" Kasprzak [Sun, 11 Nov 2012 20:21:14 +0000]
num_pattern: longer delay

2 months agoAmbient light values for 300K/1M5 resistors
Jan "Yenya" Kasprzak [Sun, 11 Nov 2012 20:10:47 +0000]
Ambient light values for 300K/1M5 resistors

2 months agofirmware: move buttons and GPIO LEDs
Jan "Yenya" Kasprzak [Sun, 11 Nov 2012 18:17:27 +0000]
firmware: move buttons and GPIO LEDs

Move buttons to PA3, PA4, and GPIO LEDs to PB0,2,4,6 (as in schematics).

2 months agoschematics/.gitignore
Jan "Yenya" Kasprzak [Tue, 30 Oct 2012 15:32:17 +0000]
schematics/.gitignore

2 months agoMakefile: make gerber, make fab
Jan "Yenya" Kasprzak [Tue, 30 Oct 2012 15:31:59 +0000]
Makefile: make gerber, make fab

2 months agoITEAD studio order number gerber-fab-201210219-1711 gerber-fab-20121029-1711
Jan "Yenya" Kasprzak [Mon, 29 Oct 2012 15:12:44 +0000]
ITEAD studio order number

2 months agopcb: design rule check fixes
Jan "Yenya" Kasprzak [Mon, 29 Oct 2012 14:12:26 +0000]
pcb: design rule check fixes

- make signal-sized via anulus 10 mils
- make silk element lines 10 mils

2 months agoMakefile for creating the web pages
Jan "Yenya" Kasprzak [Mon, 29 Oct 2012 10:30:05 +0000]
Makefile for creating the web pages

2 months agoschematics: display the name of the MCP14628 chips
Jan "Yenya" Kasprzak [Mon, 29 Oct 2012 10:29:46 +0000]
schematics: display the name of the MCP14628 chips

2 months agopcb: name of the layout
Jan "Yenya" Kasprzak [Mon, 29 Oct 2012 09:01:03 +0000]
pcb: name of the layout

2 months agopcb: more optimizations
Jan "Yenya" Kasprzak [Sun, 28 Oct 2012 23:08:03 +0000]
pcb: more optimizations

2 months agopcb: via clearance enhanced, pin sizes fixed
Jan "Yenya" Kasprzak [Sun, 28 Oct 2012 22:23:28 +0000]
pcb: via clearance enhanced, pin sizes fixed

2 months agoPCB mounting holes
Jan "Yenya" Kasprzak [Sun, 28 Oct 2012 13:02:28 +0000]
PCB mounting holes

2 months agoconnectors renamed, component orientation labeled
Jan "Yenya" Kasprzak [Fri, 26 Oct 2012 22:26:55 +0000]
connectors renamed, component orientation labeled

2 months agoPCB: first fully routed version
Jan "Yenya" Kasprzak [Fri, 26 Oct 2012 21:50:12 +0000]
PCB: first fully routed version

2 months agoUSBASP pinout fixed
Jan "Yenya" Kasprzak [Fri, 26 Oct 2012 21:49:53 +0000]
USBASP pinout fixed

2 months agoschematics: more routing of PCB
Jan "Yenya" Kasprzak [Fri, 26 Oct 2012 00:07:05 +0000]
schematics: more routing of PCB

2 months agopcb: wip routed step-down 3
Jan "Yenya" Kasprzak [Wed, 24 Oct 2012 23:00:29 +0000]
pcb: wip routed step-down 3

2 months agoschematics: fix for dual-drain MOSFET
Jan "Yenya" Kasprzak [Wed, 24 Oct 2012 22:33:30 +0000]
schematics: fix for dual-drain MOSFET

2 months agoPCB: new placement prepared for fat routes
Jan "Yenya" Kasprzak [Wed, 24 Oct 2012 21:53:00 +0000]
PCB: new placement prepared for fat routes

2 months agoSchematics: jumper for disconnecting voltage reguator
Jan "Yenya" Kasprzak [Wed, 24 Oct 2012 17:09:10 +0000]
Schematics: jumper for disconnecting voltage reguator

2 months agoconnectors in schematics reworked
Jan "Yenya" Kasprzak [Tue, 23 Oct 2012 23:35:01 +0000]
connectors in schematics reworked

2 months agoFirst PCB version
Jan "Yenya" Kasprzak [Tue, 23 Oct 2012 06:20:33 +0000]
First PCB version

2 months agoFootprint for SMB diode
Jan "Yenya" Kasprzak [Mon, 22 Oct 2012 19:12:03 +0000]
Footprint for SMB diode

2 months agolights.sch: footprints and values added
Jan "Yenya" Kasprzak [Mon, 22 Oct 2012 15:27:39 +0000]
lights.sch: footprints and values added

2 months agoFingerprint for fuse
Jan "Yenya" Kasprzak [Mon, 22 Oct 2012 15:27:24 +0000]
Fingerprint for fuse

2 months agolights.prj: project file for gsch2pcb
Jan "Yenya" Kasprzak [Mon, 22 Oct 2012 15:26:48 +0000]
lights.prj: project file for gsch2pcb

2 months agolights.sch: refdes added to all components
Jan "Yenya" Kasprzak [Fri, 19 Oct 2012 21:53:03 +0000]
lights.sch: refdes added to all components

3 months agoschematics: second step-down merged
Jan "Yenya" Kasprzak [Fri, 5 Oct 2012 21:44:08 +0000]
schematics: second step-down merged

3 months agoschematics: one step-down converter integrated into main
Jan "Yenya" Kasprzak [Thu, 4 Oct 2012 22:21:56 +0000]
schematics: one step-down converter integrated into main

3 months agoschematics: integrate power module
Jan "Yenya" Kasprzak [Thu, 4 Oct 2012 21:36:07 +0000]
schematics: integrate power module

Without power switch and MOSFET, the power module is simpler, so let's
integrate it to the main schematics.

Author and license added to the description.

Deleted the connectors which need to be reworked.

3 months agomain.c: allow only long keypress to wake us
Jan "Yenya" Kasprzak [Wed, 3 Oct 2012 19:33:46 +0000]
main.c: allow only long keypress to wake us

3 months agopower-off function
Jan "Yenya" Kasprzak [Sun, 30 Sep 2012 20:23:08 +0000]
power-off function

TODO: factor it out from main.c, probably.

3 months agogpio: suspend function, status poweroff led
Jan "Yenya" Kasprzak [Sun, 30 Sep 2012 20:22:10 +0000]
gpio: suspend function, status poweroff led

3 months agogpio: port A/B fix
Jan "Yenya" Kasprzak [Sun, 30 Sep 2012 20:21:29 +0000]
gpio: port A/B fix

3 months agopatterns for testing
Jan "Yenya" Kasprzak [Sun, 30 Sep 2012 20:11:43 +0000]
patterns for testing

3 months agohigher limit for pwm max
Jan "Yenya" Kasprzak [Sun, 30 Sep 2012 20:10:46 +0000]
higher limit for pwm max

3 months agotmr: suspend function
Jan "Yenya" Kasprzak [Sun, 30 Sep 2012 19:57:14 +0000]
tmr: suspend function