Commit graph

87 commits

Author SHA1 Message Date
Stephan I. Böttcher
6d389a572b add project LEIA, two channel stepper motor control 2025-10-17 10:35:02 +02:00
Stephan I. Böttcher
71a82cfe2c revision.h: provide a fit Id string. 2024-09-04 13:29:38 +02:00
stephan
c11e2767c2 avr/chaos: hvosc resonance witb base shield, 800V
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9072 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-19 05:10:23 +00:00
stephan
be19a700ac avr/chaos: use larger range for Ibias ADC, do not ramp at boot
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9064 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-16 13:57:58 +00:00
stephan
df870da929 avr/chaos: die(), fix read_adc()
die(): 'W" 0xd1ff   causes infinite uninteruptable sleep.
Fix adc_sum shift.
Properly account for the new adc_sum format.
Do not fault read_adc() when wdt_tick.



git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9052 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-10 12:16:12 +00:00
stephan
de6e5d2e1d avr/chaos: WDT reboot handling
Interrupts were never enabled unless 'W'.  The WDT was enabled via init_conf().
Result was constant rebooting.

Enable interrupts unconditionally in the main loop.
On boot, detect WDT reset, disable the WDT, chain load a WDT config.
Cmd 'Z' to read the `MCUSR` with the `WDRF`.

Detect WDT interrupts during `spi_slave_Rx()`, answer with an error 'EEW'

`adc_lock` to prevent the WDT ISR to call read_adc() when it is busy.
Also, `read_adc()` will discard the result in case of a `wdt_tick`.



git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9051 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-10 07:32:55 +00:00
stephan
7f3cb0583a avr/chaos: dac ramp
In conf_init, do dac_ramp last, it takes longest.
Do not dac_ramp in 'L' 10.
Configure dac_nominal=700V with hvosc 55,14.



git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9042 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-09 15:07:00 +00:00
stephan
c20fe169b4 avr/chaos: change R bit allocation R 1 gives integral ADC
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9040 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-09 14:21:02 +00:00
stephan
82d18d3e66 avr/chaos: rounding of adc_noise
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9036 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-09 14:04:25 +00:00
stephan
0f8632bb57 avr/chaos: use PCINT for spi_busy()
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9035 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-08 13:09:09 +00:00
stephan
71a95be193 avr/chaos: send spiu_busy only when something was interrupted
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9034 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-08 12:07:37 +00:00
stephan
2d38e63320 avr/chaos/read_adc: properly saturate the residuals
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9031 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-07 20:43:46 +00:00
stephan
7158c9f6b0 avr/chaos: read_adc optimization
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9025 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-07 17:30:27 +00:00
stephan
6f26cd9469 avr/chaos: fix sense of conf.wdt_toggle
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9020 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-06 09:26:31 +00:00
stephan
23194ceabb avr/chaos: hv_led improvements, spi_busy, …
- Do not toggle the HV LED at every command.
- Toggle with 'W' and 'H'.
- Remove `conf.wdt_save_addr`.
- Add `conf.wdt_toggle`, toggle period of the HV LED in ISR.
- 'H' etc turns the LED on, `hv_led_on()`.
- At boot, only do `hv_safe()` when `conf.safe` (EEPROM[0]).
- 'r' 1 reads `adc_hv`
- Sanitize arg `read_adc(…, n)`
- `spi_busy()`, break out of long loops when SPI SSEL is asserted.
- `clear_spi_busy()` in the main loop, when SSEL is asserted,
  answer with a busy message.



git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9019 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-06 09:24:42 +00:00
stephan
a758c33f6f avr/chaos 'w': hv_safe()
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9016 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-01 15:03:43 +00:00
stephan
feaa93e086 avr/chaos: use WDCE to set WDIE
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9015 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-01 14:38:10 +00:00
stephan
511bfc0cce chaos/wdt: kick wdt in isr, and more wdt mods
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9014 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-01 14:01:33 +00:00
stephan
84338f287c avr/chaos: INPDIS, swap ADC channels 1,2
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9012 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-01 09:31:21 +00:00
stephan
49643bd07e avr/chaos/hvosc: init drives PWM pins 0
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9011 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-01 09:30:50 +00:00
stephan
3b7a32b26e avr: fix read_adc(), fix 'LF' command
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8994 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-06 19:35:17 +00:00
stephan
f1ed05ce38 avr/ads8688: fix adc_gain cmd endianess
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8988 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-04 16:33:47 +00:00
stephan
3394f87f9d avr/chaos: "L" eeprom load conditional
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8987 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-04 16:20:00 +00:00
stephan
817040e9df avr/ads8688: fix read_adc command endianness
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8986 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-04 16:04:01 +00:00
stephan
724aac154d avr/ads8688: fix ads8688_read()
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8985 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-04 15:14:13 +00:00
stephan
1c246f434b avr/chaos: fix ADS8868 SDO input s/PORT/PIN/
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8984 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-04 11:54:10 +00:00
stephan
17b0f52835 avr/chaos: fix DDR
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8983 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-04 09:32:12 +00:00
stephan
4e5d4fa092 avr/chaos: fix SPI ports
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8981 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-03 18:33:17 +00:00
stephan
e1cdb1b2f5 avr/chaos: fix LED ports
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8980 bc5caf13-1734-44f8-af43-603852e9ee25
2024-06-03 18:32:57 +00:00
stephan
049f835ce8 arm/avr: fix hv_safe() w/ timeout in case the ADS is missing
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8978 bc5caf13-1734-44f8-af43-603852e9ee25
2024-05-31 17:20:20 +00:00
stephan
9142aafa3a avr/chaos: read default conf from EEPROM
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8961 bc5caf13-1734-44f8-af43-603852e9ee25
2024-05-30 04:07:37 +00:00
stephan
0f54a0bde3 arm/avr/chaos: compile conf into eeprom
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8955 bc5caf13-1734-44f8-af43-603852e9ee25
2024-05-26 12:16:15 +00:00
stephan
b1d755e290 arm/avr: read_adc(), read_adcaux(), read_adchv()
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8954 bc5caf13-1734-44f8-af43-603852e9ee25
2024-05-25 08:32:25 +00:00
stephan
9391e699db arm/avr: ADS8688 gains, fixes
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8953 bc5caf13-1734-44f8-af43-603852e9ee25
2024-05-24 21:25:36 +00:00
stephan
d9cde30690 arm/avr/chaos: hv_safe()
- WDT timeout at 1s
- toggle LED in WDT interrupt
- enable WDT reset
- keep WDT interrupting, reset only when stuck `cli()`
- `hv_safe()` when WDT interrupts accumulate
- `hv_safe()` shuts down hvosc, dac and optionally portc.  
- `hv_is_safe()` when hvosc is off and dac is off.


git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8952 bc5caf13-1734-44f8-af43-603852e9ee25
2024-05-24 15:45:11 +00:00
stephan
bf69d871f4 chaos avr: redefine 2nd parameter of hv_osc_init() as dc
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8894 bc5caf13-1734-44f8-af43-603852e9ee25
2024-03-08 17:24:26 +00:00
stephan
119f776fc3 chaos avr: symmetric hvosc gap
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8893 bc5caf13-1734-44f8-af43-603852e9ee25
2024-03-08 16:57:03 +00:00
stephan
09face2e57 chaos avr: LED pin numbers
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8891 bc5caf13-1734-44f8-af43-603852e9ee25
2024-03-08 16:51:44 +00:00
stephan
85b304d7db chaos avr: fixes
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8890 bc5caf13-1734-44f8-af43-603852e9ee25
2024-03-06 16:46:53 +00:00
stephan
77452de170 avr chaos: conf_init() execution order
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8880 bc5caf13-1734-44f8-af43-603852e9ee25
2024-02-28 14:06:42 +00:00
stephan
6d56b99f89 avr chaos: hvled
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8879 bc5caf13-1734-44f8-af43-603852e9ee25
2024-02-28 13:52:52 +00:00
stephan
50ab323173 arv/chaos: move ADC_SDO to PD1
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8878 bc5caf13-1734-44f8-af43-603852e9ee25
2024-02-28 13:08:32 +00:00
stephan
ec13f94d99 avr/chaos: upcase()
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8839 bc5caf13-1734-44f8-af43-603852e9ee25
2024-01-28 12:43:50 +00:00
stephan
67981e803f avr/chaos: hvosc_gap
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8837 bc5caf13-1734-44f8-af43-603852e9ee25
2024-01-26 21:52:29 +00:00
stephan
20c6f1a801 avr/chaos: poke, hvosc DDR
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8836 bc5caf13-1734-44f8-af43-603852e9ee25
2024-01-26 15:30:03 +00:00
stephan
b53d1914cf avr/chaos/hvosc: brown paper bag bug
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8835 bc5caf13-1734-44f8-af43-603852e9ee25
2024-01-26 14:50:55 +00:00
stephan
914e7182de avr/chaos: fix hvosc wgm
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8834 bc5caf13-1734-44f8-af43-603852e9ee25
2024-01-26 13:40:48 +00:00
stephan
4b76c0be2e arm/avr/chaos: hvosc
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8833 bc5caf13-1734-44f8-af43-603852e9ee25
2024-01-26 09:53:46 +00:00
stephan
82239c9d65 arm/avr/chaos: hvosc
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8832 bc5caf13-1734-44f8-af43-603852e9ee25
2024-01-26 09:53:15 +00:00
stephan
1b823fa3ad nmrean pa dac: use new address
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@8828 bc5caf13-1734-44f8-af43-603852e9ee25
2024-01-24 14:46:27 +00:00