|
|
|
|
@ -10,7 +10,7 @@
|
|
|
|
|
#define FET0_PIN 0
|
|
|
|
|
#define FET1_PIN 1
|
|
|
|
|
|
|
|
|
|
#define TIMEOUT 255
|
|
|
|
|
#define TIMEOUT 51 /* 2 seconds */
|
|
|
|
|
|
|
|
|
|
uint8_t led_color = 0;
|
|
|
|
|
|
|
|
|
|
@ -72,7 +72,7 @@ ISR(PCINT0_vect)
|
|
|
|
|
// uC ADC pin (with 1.11V reference)
|
|
|
|
|
uint16_t linearize_temp(uint16_t temp_in)
|
|
|
|
|
{
|
|
|
|
|
static const uint16_t one_point_one_volt = 65472; //2^16-2^6
|
|
|
|
|
static const uint16_t one_point_one_volt = (1 << 16) - (1 << 6);/* max value from 64 adc mesaurements */
|
|
|
|
|
uint16_t temp_out = ~0; //burning
|
|
|
|
|
// made from datasheet by:
|
|
|
|
|
// for i in 677 740 807 877 951 1029 1111 1196 1286 1378 1475 1575 1679 1786 1896 2003 2103 2189; do calc 5*$i/9860*65472/1.11; done
|
|
|
|
|
@ -149,8 +149,9 @@ void adc_init(void)
|
|
|
|
|
|
|
|
|
|
void heat_init(void)
|
|
|
|
|
{
|
|
|
|
|
TCCR1B = (1 << CS12) | (1 << CS10);/* prescaler / 1024 */
|
|
|
|
|
TCCR1B = (1 << WGM12) | (1 << CS10);/* some mode allowing to set timer TOP, no prescaler */
|
|
|
|
|
TIMSK1 = (1 << TOIE1);/* interupt on overflow */
|
|
|
|
|
OCR1A = 39063;
|
|
|
|
|
/* insert loading of heat setting here */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|