feat: save 2mA by idling the DAC at logical 0 rather than amplitude 0

This commit is contained in:
s3lph 2023-05-07 04:57:50 +02:00
parent f6fbc29fde
commit 78a9dfb99a
Signed by: s3lph
GPG key ID: 0AA29A52FB33CFB5
2 changed files with 6 additions and 2 deletions

View file

@ -62,7 +62,9 @@ void sendZero(uint32_t *us, uint8_t *phaseShift) {{
}}
void setZero() {{
OUT_PORT = (pgm_read_byte(&SINUS2200[0]) >> 4) | (OUT_PORT & 0xf0);
// Setting all to LOW rather than what 0b1000000 (which would be a signal amplitude of 0) saves about 2mA @ R = 550 ohms
//OUT_PORT = (pgm_read_byte(&SINUS2200[0]) >> 4) | (OUT_PORT & 0xf0);
OUT_PORT &= 0xf0;
}}
''')

View file

@ -37,6 +37,8 @@ void sendZero(uint32_t *us, uint8_t *phaseShift) {
}
void setZero() {
OUT_PORT = (pgm_read_byte(&SINUS2200[0]) >> 4) | (OUT_PORT & 0xf0);
// Setting all to LOW rather than what 0b1000000 (which would be a signal amplitude of 0) saves about 2mA @ R = 550 ohms
//OUT_PORT = (pgm_read_byte(&SINUS2200[0]) >> 4) | (OUT_PORT & 0xf0);
OUT_PORT &= 0xf0;
}