From 78a9dfb99a9cf4f5e3614a647268bf72379c0301 Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 7 May 2023 04:57:50 +0200 Subject: [PATCH] feat: save 2mA by idling the DAC at logical 0 rather than amplitude 0 --- create_sinus_tables.py | 4 +++- include/afsk_sinus.hpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/create_sinus_tables.py b/create_sinus_tables.py index d8e2929..780e5f4 100755 --- a/create_sinus_tables.py +++ b/create_sinus_tables.py @@ -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; }} ''') diff --git a/include/afsk_sinus.hpp b/include/afsk_sinus.hpp index 2e45b66..d99400d 100644 --- a/include/afsk_sinus.hpp +++ b/include/afsk_sinus.hpp @@ -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; }