Commit graph

198 commits

Author SHA1 Message Date
Stephan I. Böttcher
a7e45f235d leia: add 'n' → ports 2025-12-01 20:44:55 +01:00
Stephan I. Böttcher
7ebd848bd2 'r' returns conf.enable 2025-11-19 19:04:23 +01:00
Stephan I. Böttcher
75eaab4a26 leia: 'r' returns REST_PORT 2025-11-14 14:04:17 +01:00
Stephan I. Böttcher
144982c8b0 leia: 'w', pulse continuation, doc 2025-11-14 12:37:23 +01:00
Stephan I. Böttcher
6615bfba28 leia: clean conf.dir
writing '1' to input PORTs enables the pullup.  Avoid that on the DIR
port.
2025-11-08 10:32:29 +01:00
Stephan I. Böttcher
50f46b8494 leia: properly ramp dac with arbitray steps 2025-10-29 20:46:22 +01:00
Stephan I. Böttcher
d20586f0fc leia: '?' query GPIOR 2025-10-29 17:38:17 +01:00
Stephan I. Böttcher
be2d75f3b4 leia: eeprom isr __asm__ selected and tested 2025-10-29 17:20:10 +01:00
Stephan I. Böttcher
344e3a073d leia: do not enable interrupts when reading eeprom 2025-10-29 15:58:52 +01:00
Stephan I. Böttcher
04e72a3010 leia: fix adc isr
- XL is a macro from avr/io.h, avoid as asm param
- SUBI the negative memory location, 3×
- s/jjmp/rjmp/
- store the high byte of avg
- store the index into the correct location s/II/I/, 2×
- optimize for the likely code path
- s/OCF10B/OCF0B/

eeprom isr: (not yet enabled/tested)

- s/$[V]/%[V]/
2025-10-29 15:32:39 +01:00
Stephan I. Böttcher
f0f9b8acab leia: convert VCC first, as reference for NTCs 2025-10-29 12:15:11 +01:00
Stephan I. Böttcher
530fedca69 leia: TICK by CPUCLK 2025-10-29 10:54:00 +01:00
Stephan I. Böttcher
100f07b9f5 leia: Error codes 2025-10-28 23:58:03 +01:00
Stephan I. Böttcher
162e0c6c8a spi_slave: faster Rx_sleep() 2025-10-28 23:57:26 +01:00
Stephan I. Böttcher
684d552c13 leia: SPI error propagation and msg 2025-10-28 20:02:32 +01:00
Stephan I. Böttcher
71f5839306 leia: dac ref
The DAC uses the Vref selected in ADMUX.  We _must_ keep the REFS bits
stable to use the DAC as motor current reference.

Add .conf.dac_ref to initialize REFS, in case the ADC conf is missing.
Change the default ADC config to use the internal 2.5V reference for all
channels.
2025-10-28 19:18:59 +01:00
Stephan I. Böttcher
0579532711 leia: RESET_PORT config 2025-10-28 08:55:44 +01:00
Stephan I. Böttcher
d3a29cc6c9 leia: ramp dac only when 'D' 2025-10-27 19:58:35 +01:00
Stephan I. Böttcher
e06a147c6e leia: stepper isr enable only one OCR 2025-10-27 19:56:51 +01:00
Stephan I. Böttcher
fc2affa04e spi_slave: harden _sleep mode 2025-10-27 19:44:39 +01:00
Stephan I. Böttcher
8d99d529f5 leia: control all RESET_PORT bits 2025-10-26 17:08:17 +01:00
Stephan I. Böttcher
6e1ccd4bce leia: peek ram, flash, eeprom 2025-10-26 16:39:03 +01:00
Stephan I. Böttcher
ad35f866aa leia: fix conf padding 2025-10-25 22:13:10 +02:00
Stephan I. Böttcher
6a2cc9a6ad remove dead source file 2025-10-22 22:29:43 +02:00
Stephan I. Böttcher
fb7c5498fa leia: update comments 2025-10-22 22:25:31 +02:00
Stephan I. Böttcher
b26a64514c leia: conf → v.conf, v.stat 2025-10-22 22:19:33 +02:00
Stephan I. Böttcher
267ad36409 leia: conf size 2025-10-22 21:21:49 +02:00
Stephan I. Böttcher
b57552a3e7 leia: 'V' 2025-10-22 20:39:22 +02:00
Stephan I. Böttcher
7de7b3a732 spi_slave: sleep 2025-10-22 20:38:29 +02:00
Stephan I. Böttcher
27bbff81b3 leia: "zW" for eeprom write 2025-10-22 19:10:07 +02:00
Stephan I. Böttcher
6e8a9325e7 leia: add EEPROM write counter 2025-10-22 18:56:23 +02:00
Stephan I. Böttcher
f90a2205b0 leia adc: REFS0==ADC_E, ~ADLAR==average mode, fixes 2025-10-22 18:01:16 +02:00
Stephan I. Böttcher
e979101398 spi_slave: fixes 2025-10-22 11:45:38 +02:00
Stephan I. Böttcher
58b56f20bf leia: c isrs, for initial tests 2025-10-22 11:45:16 +02:00
Stephan I. Böttcher
e890a58340 .gitignore docs 2025-10-22 11:44:23 +02:00
Stephan I. Böttcher
4badaf23ce leia: all isr in assemby 2025-10-19 21:49:35 +02:00
Stephan I. Böttcher
c1f87a11da leia: docs, cleanups, fixes 2025-10-18 22:46:34 +02:00
Stephan I. Böttcher
d76f6517db leia: dac ramp 2025-10-18 15:36:26 +02:00
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 I. Böttcher
f486d693b1 add .gitignore 2024-09-03 14:20:53 +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
a7504da2ff avr/spi_slave: spi_slave_Rx_wdt()
Flag a case where a WDT interrupt messed with command reception.
The user must define the `wdt_tick` flag.



git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/arm/avr@9050 bc5caf13-1734-44f8-af43-603852e9ee25
2024-07-10 07:18:27 +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