Skip to content

Commit

Permalink
Unsure if these changes are valid. Check before production
Browse files Browse the repository at this point in the history
  • Loading branch information
danngreen committed Apr 28, 2017
1 parent 10dce32 commit 5354882
Show file tree
Hide file tree
Showing 5 changed files with 431 additions and 421 deletions.
2 changes: 1 addition & 1 deletion burn
Original file line number Diff line number Diff line change
@@ -1 +1 @@
avrdude-6.1-patched -F -B 4 -P usb -c avrispmkII -p atmega328 -U hfuse:w:0xd7:m -U lfuse:w:0xef:m -U efuse:w:0x01:m -U flash:w:qcd.hex
avrdude-6.1-patched -F -B 8 -P usb -c avrispmkII -p atmega328 -U hfuse:w:0xd7:m -U lfuse:w:0xef:m -U efuse:w:0x01:m -U flash:w:qcd.hex
4 changes: 2 additions & 2 deletions divmults.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Negative values represent multiplication (so -6 means x6)
Positive values represent division (so 4 means /4)
*/

//#define DIVMULT_FACTORY
#define DIVMULT_FACTORY
//#define DIVMULT_PRIME
//#define DIVMULT_CARNATIC
//#define DIVMULT_MULTONLY
#define DIVMULT_FRACTIONALS
//#define DIVMULT_FRACTIONALS



Expand Down
23 changes: 14 additions & 9 deletions qcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
********************/

#define HOLDTIMECLEAR 16000
#define MIN_PW 40
#define SLOW_PERIOD 240
//100 is 12ms
//80 is 10ms
#define MIN_PW 100
#define SLOW_PERIOD 160
#define DIV_ADC_DRIFT 2
#define PW_ADC_DRIFT 3
#define USER_INPUT_POLL_TIME 20
#define USER_INPUT_POLL_TIME 4


/********************
Expand Down Expand Up @@ -61,8 +63,10 @@

#define TAPOUT_pin PB5
#define TAPOUT_init DDRB |= (1 << TAPOUT_pin)
#define TAPOUT_ON PORTB |= (1 << TAPOUT_pin)
#define TAPOUT_OFF PORTB &= ~(1 << TAPOUT_pin)
#define TAPOUT_ON clkout_state |= (1<<5)
//#define TAPOUT_ON PORTB |= (1 << TAPOUT_pin)
#define TAPOUT_OFF clkout_state &= ~(1<<5)
//#define TAPOUT_OFF PORTB &= ~(1 << TAPOUT_pin)


#define RESET_pins 0b11110000
Expand All @@ -83,7 +87,8 @@
#define CLKOUT_OFF(x) clkout_state &= ~(1 << (x))

#ifndef DEBUG
#define CLKOUT_SETSTATE(x) PORTB = (PORTB & 0b11110000) | (x)
//#define CLKOUT_SETSTATE(x) PORTB = (PORTB & 0b11110000) | (x)
#define CLKOUT_SETSTATE(x) PORTB = (PORTB & 0b11010000) | (x)

#define DEBUGON
#define DEBUGOFF
Expand Down Expand Up @@ -315,7 +320,7 @@ int8_t get_clk_div_nominal(uint8_t adc_val){
return(P_16);
else if (adc_val<=204) // x8
return(P_17);
else if (adc_val<=216) // x12
else if (adc_val<=220) // x12 was 216
return(P_18);
else // x16
return(P_19);
Expand Down Expand Up @@ -665,8 +670,6 @@ int main(void){

CLKOUT_SETSTATE(clkout_state);


if (cur_chan==3){
/************ TAP ************/
if (TAPIN){
tapin_down=0;
Expand Down Expand Up @@ -721,6 +724,8 @@ int main(void){



if (cur_chan==3){

/***************** READ ADC ****************/
DEBUGOFF;

Expand Down
Binary file modified qcd.elf
Binary file not shown.
Loading

0 comments on commit 5354882

Please sign in to comment.