Compare commits

...

5 commits

Author SHA1 Message Date
Stephan I. Böttcher
920938165e src doc: minor typos and fixes 2024-04-20 18:43:11 +02:00
Stephan I. Böttcher
38776671b1 sch: change U2 output voltage, not to run the sensor beyond specs 2024-04-20 18:42:32 +02:00
Stephan I. Böttcher
0ac2f54bbe calib.py: remove bogus output char 2024-04-20 18:40:48 +02:00
Stephan I. Böttcher
1d3fb10e8d Merge branch 'master' of codeberg.org:SiB64/turbo_weather 2024-04-20 18:28:46 +02:00
Stephan I. Böttcher
095d857e18 remove a copy from blinkenlights 2024-04-18 16:08:51 +02:00
4 changed files with 16 additions and 17 deletions

View file

@ -7,7 +7,7 @@
- `USART0-RxD/TxD-PB2…3`: transmission of data, receive commands
- `PORTB-PB1`: enable the RF power regulator
- `PORTA-PA5`: light up the LED
- `ADC0-PA4,6…7: read Batterie, NTC, and RF power voltage, and internal sources.
- `ADC0-PA4,6,7`: read Batterie, NTC, and RF power voltage, and internal sources.
- `PIT`: generate clock tick, to wake the µC once per second from deep sleep.
- `USERROW`: store persistent configuration
- `EEPROM`: store `ADC` readings configuration, store sensor test data records.
@ -52,8 +52,8 @@ is the number of readings sent in between without sending config records.
Debug data is only available when not disabled during compilation. Do
`make DEBUG=-DNODEBUG` to disable all debugging code and data.
The `SEND` flags are stored in byte[3] of the `config` structure with
the bit positions
The `SEND` flags are stored in byte[3] of the `config` structure to
enable the respective output records, with the bit positions
- `SEND_CONFIG = 0x01`
- `SEND_BATED = 0x02`
@ -67,7 +67,7 @@ the bit positions
## Configuration
At boot, the configuration is copied from the `USERROW` to the
`config` structure in `RAM`, iff the first byte in the `USERROW` is
`config` structure in `RAM`, if the first byte in the `USERROW` is
the magic `0xba`, and the second byte matches the version of the
`config` structure, currently `0x08`. Else, the defaults are used.
@ -86,7 +86,7 @@ The config structure is
- `[11]`: `mclk_period`: `TCA0.SINGLE.CMP0` \[÷76\]
- `[12]`: `baud_div`: two bytes little endian \[÷16667\]
- `[14]`: `uart_mode`: `USART0.CTRLB`
- `[15]`: `pit_period`: `RTC.CLKSEL` \[%1024\]
- `[15]`: `pit_period`: `RTC.CLKSEL` \[÷1024\]
- `[16]`: `immediate`: number of immediate readings at boot.
### Triggers
@ -127,7 +127,7 @@ necessary to bias the NTC measured by ADC readings.
## Commands
Commandlines received via the UART must be in the format
- `«C» {[«space»] «hex»}+ [«space»]+ «linefeed»`
- `«C» {[«space»]+ «hex»}+ [«space»]+ «linefeed»`
A command letter, uppercase, and up to seven (optionally space
separated) hex bytes, optionally followed by more space characters and
@ -148,21 +148,22 @@ additional byte.
### List of commands:
- `R «ccp»`: Reboot the µC. The argument byte must be `d8` the
- `R «ccp»`: Reboot the µC. The argument byte must be `d8`, the
`CCP[IOREG]` key, to validate the reset.
- `C «key» «bytes»…`: write to the `config` structure in `RAM`
- `U «key» «bytes»…`: write to persistent config in the `USERROW`
- `E «key» «bytes»…`: write to `EEPROM`
Up to six «bytes» are written. The «key» must be `9d`, the `CCP[SPM]``
key, for the persistent stores, and `ba` for the `RAM`. Prints
the old value of the first bytes written to.
Up to six «bytes» are written. The «key» must be `9d`, the
`CCP[SPM]` key, for the persistent stores, and `ba` for the `RAM`.
These commands return the old value of the first byte that was
written.
- `T «n»`: trigger «n» more immediate sensor readings.
- `M «aaaa»`: reads any memory address «aaaa» (two bytes) and prints the
byte.
- `M «aaaa»`: reads any memory address «aaaa» (two bytes, big endian)
and prints the byte.
- `W «aaaa» «bb»`: write a byte «bb» into any address «aaaa», return
the old value of that memory location.
@ -171,7 +172,7 @@ additional byte.
be sent little endian.
- `D «n»`: process and send calibrated readings for «n» test data
records. The `EEPROM` has space for up to five records.
records. The `EEPROM` has space for up to five data records.
## Toolchain

View file

@ -1,2 +0,0 @@
#define WDT_TRIGGERED 1
#include "bate.c"

View file

@ -55,7 +55,7 @@ TEMP = {TEMP*0.1:.1f} °C
P = X*10//32 + 2500
print(f"""Pressure
D1 = {D[1]} {D[1]-7168}10
D1 = {D[1]} {D[1]-7168}
TCO = {TCO}
OFFT1 = {OFFT1}
OFF = {OFF}

View file

@ -127,7 +127,7 @@ refdes=R3
T 55200 46600 5 10 0 1 90 0 1
footprint=C0603.fp
T 55450 46850 5 10 1 1 90 3 1
value=270kΩ
value=220kΩ
T 55000 46600 5 10 0 0 90 0 1
symversion=0.1
}