Re: [Milkymist-devel] Counter-based ADC for the pots...

2013-04-18 Thread Werner Almesberger
Uwe Bonnes wrote: > can you explain what hardware (features) your ADC uses and what connections > and parts are needed? It's for Sebastien's HDMI/DVI mixer extension board for M1. This is the section with the two potentiometers and the very simple ADC hardware: http://milkymist.org/vmixext-5fev/

Re: [Milkymist-devel] Counter-based ADC for the pots...

2013-04-18 Thread Uwe Bonnes
Hallo Werner, can you explain what hardware (features) your ADC uses and what connections and parts are needed? Thanks -- Uwe Bonnesb...@elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt - Tel. 06151 162516 Fa

[Milkymist-devel] [PATCH v2] milkymist/adc/__init__.py: CounterADC - simple counter-based ADC

2013-04-18 Thread Werner Almesberger
This is a revised version of the counter-based ADC. How to use it: 1) select the polarity 2) wait a few ms until the cap has (dis)charged to the desired level 3) write any value to START/BUSY 4) wait until BUSY auto-clears 5) check OVERFLOW. If a bit is 1, the corresponding channel has overflo

Re: [Milkymist-devel] [PATCH 1/2] milkymist/adc/__init__.py: CounterADC - simple counter-based ADC

2013-04-18 Thread Werner Almesberger
sebastien.bourdeaud...@lekernel.net wrote: > A better way is to use isinstance(sense, collections.Iterable), see: That's nicer. Thanks ! > I think "sense = [sense]" would be clearer. Sneef. Nobody values the ancient art of tail recursion anymore :( > Too much C? :) channels = len(sense) Heh, i

Re: [Milkymist-devel] [PATCH 1/2] milkymist/adc/__init__.py: CounterADC - simple counter-based ADC

2013-04-18 Thread sebastien . bourdeauducq
Hi Werner, and thanks for this core! On Thu, 18 Apr 2013 03:35:28 -0300, Werner Almesberger wrote: +class CounterADC(Module, AutoCSR): + def __init__(self, charge, sense, width = 24): + if not hasattr(sense, "__iter__"): A better way is to use isinstance(sense, collections.