Tuning in ADC

This commit is contained in:
Ben V. Brown
2022-04-21 18:25:14 +10:00
parent 82a8eb5a2c
commit 8ea1edf7a7
3 changed files with 5 additions and 5 deletions

View File

@@ -12,8 +12,8 @@
// These control the period's of time used for the PWM
const uint16_t powerPWM = 255;
const uint8_t holdoffTicks = 14;
const uint8_t tempMeasureTicks = 10;
const uint8_t holdoffTicks = 3; // This is the tick delay
const uint8_t tempMeasureTicks = 4;
uint16_t totalPWM = 255; // Total length of the cycle's ticks

View File

@@ -108,7 +108,7 @@ void switchToFastPWM(void) {
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 20);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 11);
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
}
@@ -126,7 +126,7 @@ void switchToSlowPWM(void) {
uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 40);
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 22);
BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal);
}

View File

@@ -86,7 +86,7 @@ void setup_adc(void) {
ADC_Reset();
ADC_Init(&adc_cfg);
adc_fifo_cfg.dmaEn = DISABLE;
adc_fifo_cfg.fifoThreshold = ADC_FIFO_THRESHOLD_8;
adc_fifo_cfg.fifoThreshold = ADC_FIFO_THRESHOLD_4;
ADC_FIFO_Cfg(&adc_fifo_cfg);
ADC_MIC_Bias_Disable();