Commit graph

311 commits

Author SHA1 Message Date
Stephan I. Böttcher
a9b687312e cmd: work now, add some assembler 2024-04-14 19:40:04 +02:00
Stephan I. Böttcher
276bd40a33 rtc: add debug counter 2024-04-14 19:38:27 +02:00
Stephan I. Böttcher
ad2246675f rtc: add debug counter 2024-04-14 19:35:54 +02:00
Stephan I. Böttcher
5757d31416 cmd: fix parse_hex_nibble(), better output, W command 2024-04-14 04:36:26 +02:00
Stephan I. Böttcher
bcaf9e3de6 uart: fix in rx_dismiss: 2024-04-14 04:35:10 +02:00
Stephan I. Böttcher
38db87a030 uart: mostly assembler, now
Most uart code is now in `uart_tx.S`.
Code close to the hardware stays in `uart.c` to use `io.h`.
The .S does not use the CPP, yet.
2024-04-14 03:36:55 +02:00
Stephan I. Böttcher
4ea0d71d5d uart: save a few instructions 2024-04-13 19:02:54 +02:00
Stephan I. Böttcher
61d78b9bdc uart: add missing RETI 2024-04-13 17:46:44 +02:00
Stephan I. Böttcher
0ba62420ab cmd: only accept lowercase hex digits
Not to confuse hex parameters with uppercase commands.
2024-04-13 17:45:08 +02:00
Stephan I. Böttcher
0801c0513d make: drop bate_CFLAGS 2024-04-13 17:44:04 +02:00
Stephan I. Böttcher
e24402ce66 cmd: C and M 2024-04-13 01:49:17 +02:00
Stephan I. Böttcher
7f20ce610f adc: fix and call send_calib_adc() 2024-04-12 18:58:12 +02:00
Stephan I. Böttcher
7e18810b42 adc: fix saddus() 2024-04-12 18:34:23 +02:00
Stephan I. Böttcher
25bebed7df uart: rework uart_busy
- implement `tx()` in asm, does not work yet!
- enable TXC interrupt, to be woken when the uart is done
  in order to power down.  Alias the DRE interrupt.
- Rework `send_char()` and `send_str()`.
- Remove …_nosleep() and `panik()`.
- Better account for volatile-ness of buffer pointers.
2024-04-12 16:41:46 +02:00
Stephan I. Böttcher
306904b372 bate: print eeprom in words 2024-04-12 16:40:57 +02:00
Stephan I. Böttcher
68cc24fb7c adc: calibrated output
- add calib values to `adc_conf`,
- double the size of `struct adc_conf`
- reduce the sape for `testdata`.
- implement the calibration with offset and scale.
2024-04-12 02:08:31 +02:00
Stephan I. Böttcher
d7b100e02c eeprom: forget about specifying the address or vars 2024-04-12 02:07:04 +02:00
Stephan I. Böttcher
3aaf28484d POWER_LED and POWER_SYDBY 2024-04-11 21:22:53 +02:00
Stephan I. Böttcher
850cd6a4fb uart: fix uart_busy(), we were powering down too early 2024-04-11 21:22:05 +02:00
Stephan I. Böttcher
707f4512e8 bate: output config improvements
- new config.cperiod: print configuration one in a while
- SEND_BATED: print `W` and `D` sensor words separately,
  send `W` with config.
- testdata: do not wait for config.period.
- clock: dorp `trigger` from `T` record,
  send it with debug `X` instead
- config version 4, sane order.
- adc `A`: do not send unused entries.
2024-04-11 17:02:51 +02:00
Stephan I. Böttcher
b3dcb7d104 adc: stop at first unused adc_conf entry 2024-04-11 11:30:17 +02:00
Stephan I. Böttcher
8050b9abf0 make isr variables volatile 2024-04-11 04:09:34 +02:00
Stephan I. Böttcher
358da80f46 move adc_conf and test_data into the EEPROM 2024-04-11 03:51:19 +02:00
Stephan I. Böttcher
edb1544cd7 print E adc_conf on boot 2024-04-10 18:20:41 +02:00
Stephan I. Böttcher
ee03f01b06 greeting improvement 2024-04-10 18:15:24 +02:00
Stephan I. Böttcher
ebdb88118c baye.config: add BC_SPI 2024-04-10 18:13:57 +02:00
Stephan I. Böttcher
a3eb8eb7b9 spi: replace bit banging with SPI0 2024-04-10 18:10:57 +02:00
Stephan I. Böttcher
82f0da6a89 calib: fix turbo test case[0] 2024-04-10 18:09:09 +02:00
Stephan I. Böttcher
9302c61244 bate: use 16-bit frames 2024-04-10 01:24:24 +02:00
Stephan I. Böttcher
77463da388 bate_wait: sleep() waiting for pin interrupt 2024-04-09 23:55:10 +02:00
Stephan I. Böttcher
cd6355021b uart: pin sense bothedges 2024-04-09 23:50:43 +02:00
Stephan I. Böttcher
4bbd6c264a adc: now it works w/ interrupts
The problem was: the TCA0 IRQ was busylooping

`send_char()` now sleeps.
Debug counters are cleared.
Config version 3 with acquisition period.
2024-04-09 23:19:08 +02:00
Stephan I. Böttcher
09cc30d854 adc: worknow, but w/o isr
The RESRDY vector is never called, neither the SAMPRDY, when enabled.
No idea why. We do polling now.
No idea what wakes the CPU from sleep with STOP_MCLK.
2024-04-09 19:08:23 +02:00
Stephan I. Böttcher
ebb9d88b81 uart: panic(), spaces in hexdump 2024-04-09 18:14:39 +02:00
Stephan I. Böttcher
a4b1e0b1b1 bate: fixes
- adc.h: adc_init(), disable inputs used for analog inputs.
- bate: PORTA → VPORTA, restore blinkenlight's bate_bit()
- config V2: add cpu_clk, remove config pointer indirection
- CLKCTRL: make extra sure we run at 10 MHz
    → regained telemetry at 2400 baud
- turn on LED while digitizing and transmitting
2024-04-09 00:43:34 +02:00
Stephan I. Böttcher
89d64222e6 Makefile: BV_VERS=2 2024-04-09 00:42:25 +02:00
Stephan I. Böttcher
233a175151 calib: fix bitsize of dT, add test case 2024-04-09 00:41:13 +02:00
Stephan I. Böttcher
cac8adf51f adc: fix globals, add adc_init() 2024-04-09 00:40:07 +02:00
Stephan I. Böttcher
0693ab1204 mul16sun: fix case n=0 2024-04-09 00:38:13 +02:00
Stephan I. Böttcher
c8f9b34757 adc: annotate asm savings in isr 2024-04-08 10:05:55 +02:00
Stephan I. Böttcher
2e66f12041 adc readout 2024-04-08 01:47:46 +02:00
Stephan I. Böttcher
e8aaefbe1f make %.id %.verify: -qq 2024-04-07 17:45:42 +02:00
Stephan I. Böttcher
23dc2085ea text_calib to SEND_HEX 2024-04-07 12:25:20 +02:00
Stephan I. Böttcher
53a77c75aa uart: send*(): pointers to const payload 2024-04-07 11:53:22 +02:00
Stephan I. Böttcher
2d7ac8c6af %.s: depend on %.o to capture dependencies from %.d 2024-04-07 11:52:03 +02:00
Stephan I. Böttcher
2665750308 make %.verify 2024-04-07 11:34:31 +02:00
Stephan I. Böttcher
0179568e85 make bate.config, individual vars 2024-04-07 10:54:10 +02:00
Stephan I. Böttcher
ef65e2dc0e decimal_str() 2024-04-07 01:09:55 +02:00
Stephan I. Böttcher
0b680c1b78 calib: tests and fixes 2024-04-06 21:42:18 +02:00
Stephan I. Böttcher
900089c787 uart: fix uart_break_p() polarity 2024-04-06 12:52:39 +02:00