Update to use attiny1616 AC2 and TCB1

- Change AVC output enable/disable to only change input/output of pin 7;
  only one pin should need to be used to send (i.e. actual differential
  signaling isn't being used, therefore, we can achieve the necessary
  (single-ended) differential voltage using only one pin, leaving the
  other outputting low)
- Use virtual ports to enable setting output status with single
  instruction
This commit is contained in:
Allen Hill
2023-08-03 11:01:45 -04:00
parent 0a9bd4d988
commit feccda9e69
3 changed files with 67 additions and 95 deletions
+5 -8
View File
@@ -18,14 +18,11 @@
#define FALSE 0
#define TRUE (!FALSE)
// AVC LAN bus directly connected to internal analog comparator (PD6/7)
// PD6 AIN0 +
// PD7 AIN1 -
#define DATAIN_PIN ACSR
#define DATAIN ACO
#define INPUT_IS_SET ( bit_is_set( DATAIN_PIN, DATAIN ) )
#define INPUT_IS_CLEAR ( bit_is_clear( DATAIN_PIN, DATAIN ) )
// AVC LAN bus on AC2 (PA6/7)
// PA6 AINP0 +
// PA7 AINN1 -
#define INPUT_IS_SET ( bit_is_set( AC2_STATUS, AC_STATE_bp ) )
#define INPUT_IS_CLEAR ( bit_is_clear( AC2_STATUS, AC_STATE_bp ) )
#define LED_DDR DDRB
#define LED_PORT PORTB