Browse Source

Add support for a real 10-bit dac

git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@8673 ddd99763-3ecb-0310-9145-efcb8ce7c51f
tags/zoom-1.0
jim 11 years ago
parent
commit
555b95f641
2 changed files with 12 additions and 6 deletions
  1. +12
    -6
      firmware/dac.h
  2. BIN
      firmware/zoom.mcw

+ 12
- 6
firmware/dac.h View File

@@ -3,16 +3,22 @@
#include "config.h"
#define FAKE_BITS
#define DAC_TYPE 2
#ifdef FAKE_BITS
/* fake compressed range with random lookup bits */
#if DAC_TYPE == 0
/* AD5542, normal 16-bit range */
#define DAC_BITS 16
#define __dac_actual(x) (x)
#elif DAC_TYPE == 1
/* AD5542, fake 10-bit range using random lower bits */
#define DAC_BITS 10
#define __dac_actual(x) (dac_lookup[(x)&1023])
#elif DAC_TYPE == 2
/* MAX504, true 10-bit DAC */
#define DAC_BITS 10
#define __dac_actual(x) ((x) << 2)
#else
/* normal range */
#define DAC_BITS 16
#define __dac_actual(x) (x)
#error Unknown DAC type
#endif
#define DAC_LOW 0


BIN
firmware/zoom.mcw View File


Loading…
Cancel
Save