restructuring

This commit is contained in:
2022-03-10 11:04:14 +03:00
parent 29560b7c0c
commit 733dbd75d2
1758 changed files with 14 additions and 26855 deletions

View File

@@ -0,0 +1,134 @@
BINARY = chiller
BOOTPORT ?= /dev/ttyUSB0
BOOTSPEED ?= 115200
# MCU FAMILY
FAMILY = F0
# MCU code
MCU = F030x4
DEFS = -DEBUG
# change this linking script depending on particular MCU model,
# for example, if you have STM32F103VBT6, you should write:
LDSCRIPT = stm32f030f.ld
INDEPENDENT_HEADERS=
FP_FLAGS ?= -msoft-float
ASM_FLAGS = -mthumb -mcpu=cortex-m0 -march=armv6-m -mtune=cortex-m0
ARCH_FLAGS = $(ASM_FLAGS) $(FP_FLAGS)
###############################################################################
# Executables
PREFIX ?= /opt/bin/arm-none-eabi
RM := rm -f
RMDIR := rmdir
CC := $(PREFIX)-gcc
LD := $(PREFIX)-gcc
AR := $(PREFIX)-ar
AS := $(PREFIX)-as
OBJCOPY := $(PREFIX)-objcopy
OBJDUMP := $(PREFIX)-objdump
GDB := $(PREFIX)-gdb
STFLASH := $(shell which st-flash)
STBOOT := $(shell which stm32flash)
###############################################################################
# Source files
OBJDIR = mk
LDSCRIPT ?= $(BINARY).ld
SRC := $(wildcard *.c)
OBJS := $(addprefix $(OBJDIR)/, $(SRC:%.c=%.o))
STARTUP = $(OBJDIR)/startup.o
OBJS += $(STARTUP)
DEPS := $(OBJS:.o=.d)
INC_DIR ?= ../inc
INCLUDE := -I$(INC_DIR)/F0 -I$(INC_DIR)/cm
LIB_DIR := $(INC_DIR)/ld
###############################################################################
# C flags
CFLAGS += -O2 -g -MD -D__thumb2__=1
CFLAGS += -Wall -Werror -Wextra -Wshadow -Wimplicit-function-declaration
CFLAGS += -Wredundant-decls $(INCLUDE)
# -Wmissing-prototypes -Wstrict-prototypes
CFLAGS += -fno-common -ffunction-sections -fdata-sections
###############################################################################
# Linker flags
LDFLAGS += --static -nostartfiles
#--specs=nano.specs
LDFLAGS += -L$(LIB_DIR)
LDFLAGS += -T$(LDSCRIPT)
LDFLAGS += -Wl,-Map=$(OBJDIR)/$(BINARY).map
LDFLAGS += -Wl,--gc-sections
###############################################################################
# Used libraries
LDLIBS += -Wl,--start-group -lc -lgcc -Wl,--end-group
LDLIBS += $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
DEFS += -DSTM32$(FAMILY) -DSTM32$(MCU)
#.SUFFIXES: .elf .bin .hex .srec .list .map .images
#.SECONDEXPANSION:
#.SECONDARY:
ELF := $(OBJDIR)/$(BINARY).elf
LIST := $(OBJDIR)/$(BINARY).list
BIN := $(BINARY).bin
HEX := $(BINARY).hex
all: bin list
elf: $(ELF)
bin: $(BIN)
hex: $(HEX)
list: $(LIST)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPS)
endif
$(OBJDIR):
mkdir $(OBJDIR)
$(STARTUP): $(INC_DIR)/startup/vector.c
$(CC) $(CFLAGS) $(DEFS) $(INCLUDE) $(ARCH_FLAGS) -o $@ -c $<
$(OBJDIR)/%.o: %.c
@echo " CC $<"
$(CC) $(CFLAGS) $(DEFS) $(INCLUDE) $(ARCH_FLAGS) -o $@ -c $<
$(BIN): $(ELF)
@echo " OBJCOPY $(BIN)"
$(OBJCOPY) -Obinary $(ELF) $(BIN)
$(HEX): $(ELF)
@echo " OBJCOPY $(HEX)"
$(OBJCOPY) -Oihex $(ELF) $(HEX)
$(LIST): $(ELF)
@echo " OBJDUMP $(LIST)"
$(OBJDUMP) -S $(ELF) > $(LIST)
$(ELF): $(OBJDIR) $(OBJS)
@echo " LD $(ELF)"
$(LD) $(LDFLAGS) $(ARCH_FLAGS) $(OBJS) $(LDLIBS) -o $(ELF)
clean:
@echo " CLEAN"
$(RM) $(OBJS) $(DEPS) $(ELF) $(HEX) $(LIST) $(OBJDIR)/*.map
@rmdir $(OBJDIR) 2>/dev/null || true
flash: $(BIN)
@echo " FLASH $(BIN)"
$(STFLASH) write $(BIN) 0x8000000
boot: $(BIN)
@echo " LOAD $(BIN) through bootloader"
$(STBOOT) -b$(BOOTSPEED) $(BOOTPORT) -w $(BIN)
.PHONY: clean flash boot

View File

@@ -0,0 +1,35 @@
Self-made chiller control system
UART: 115200N1, not more than 100ms between data bytes in command
To turn ON human terminal (without timeout) send "####"
Protocol: [ command line ]
'[' clears earlier input
'\n', '\r', ' ', '\t' are ignored
All messages are asynchroneous!
Commands:
Ax - turn on(x=1)/off(x=0) external alarm or check its value
Cx - set cooler PWM to x
d - (only when EBUG defined) go into debug commands
F - get flow sensor rate for 5s period
Hx - set heater PWM to x
L - check water level sensor value
Px - set pump PWM to x
R - reset MCU
Tx - get NTC temperature for channel x
t - get MCU temperature
V - get Vdd value *100V
Debugging commands:
A - show raw ADC value (next letter is index, 0..5)
F - get flow_cntr value & PB state
T - show raw T values
w - test watchdog
Messages:
MCUTEMP10=x - mcu temperature * 10 (degrC)
SOFTRESET=1 - software reset occured (msg @ start)
VDD100=x - Vdd*100 (V)
WDGRESET=1 - watchdog reset occured (msg @ start)

View File

@@ -0,0 +1,117 @@
/*
* This file is part of the Chiller project.
* Copyright 2018 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "adc.h"
/**
* @brief ADC_array - array for ADC channels with median filtering:
* 0..3 - external NTC
* 4 - internal Tsens
* 5 - Vref
*/
uint16_t ADC_array[NUMBER_OF_ADC_CHANNELS*9];
/**
* @brief getADCval - calculate median value for `nch` channel
* @param nch - number of channel
* @return
*/
uint16_t getADCval(int nch){
int i, addr = nch;
register uint16_t temp;
#define PIX_SORT(a,b) { if ((a)>(b)) PIX_SWAP((a),(b)); }
#define PIX_SWAP(a,b) { temp=(a);(a)=(b);(b)=temp; }
uint16_t p[9];
for(i = 0; i < 9; ++i, addr += NUMBER_OF_ADC_CHANNELS) // first we should prepare array for optmed
p[i] = ADC_array[addr];
PIX_SORT(p[1], p[2]) ; PIX_SORT(p[4], p[5]) ; PIX_SORT(p[7], p[8]) ;
PIX_SORT(p[0], p[1]) ; PIX_SORT(p[3], p[4]) ; PIX_SORT(p[6], p[7]) ;
PIX_SORT(p[1], p[2]) ; PIX_SORT(p[4], p[5]) ; PIX_SORT(p[7], p[8]) ;
PIX_SORT(p[0], p[3]) ; PIX_SORT(p[5], p[8]) ; PIX_SORT(p[4], p[7]) ;
PIX_SORT(p[3], p[6]) ; PIX_SORT(p[1], p[4]) ; PIX_SORT(p[2], p[5]) ;
PIX_SORT(p[4], p[7]) ; PIX_SORT(p[4], p[2]) ; PIX_SORT(p[6], p[4]) ;
PIX_SORT(p[4], p[2]) ;
return p[4];
#undef PIX_SORT
#undef PIX_SWAP
}
// return MCU temperature (degrees of celsius * 10)
int32_t getMCUtemp(){
getVdd();
// make correction on Vdd value
// int32_t temperature = (int32_t)ADC_array[4] * VddValue / 330;
int32_t ADval = getADCval(4);
int32_t temperature = (int32_t) *TEMP30_CAL_ADDR - ADval;
temperature *= (int32_t)(1100 - 300);
temperature /= (int32_t)(*TEMP30_CAL_ADDR - *TEMP110_CAL_ADDR);
temperature += 300;
return(temperature);
}
// return Vdd * 100 (V)
uint32_t getVdd(){
uint32_t vdd = ((uint32_t) *VREFINT_CAL_ADDR) * (uint32_t)330; // 3.3V
vdd /= getADCval(5);
return vdd;
}
/**
* @brief getNTC - return temperature of NTC (*10 degrC)
* @param nch - NTC channel number (0..3)
* @return
*/
int16_t getNTC(int nch){
#define NKNOTS (9)
const int16_t ADU[NKNOTS] = {427, 468, 514, 623, 754, 910, 1087, 1295, 1538};
const int16_t T[NKNOTS] = {-200, -180, -159, -116, -72, -26, 23, 75, 132};
/*
* coefficients: 0.050477 0.045107 0.039150 0.033639 0.029785 0.027017 0.024996 0.023522 0.022514
* use
* [N D] = rat(K*10); printf("%d, ", N); printf("%d, ", D);
*/
const int16_t N[NKNOTS] = {1377, 295, 258, 110, 291, 77, 1657, 191, 120};
const int16_t D[NKNOTS] = {2728, 654, 659, 327, 977, 285, 6629, 812, 533};
if(nch < 0 || nch > 3) return -30000;
uint16_t val = getADCval(nch);
// find interval
int idx = (NKNOTS)/2, left = 0, right = NKNOTS-1; // left, right, middle
while(idx > left && idx < right){
int16_t midval = ADU[idx];
if(val < midval){
if(idx == 0) break;
if(val > ADU[idx-1]){ // found
--idx;
break;
}
right = idx - 1;
idx = (left + right)/2;
}else{
if(val < ADU[idx+1]) break; // found
left = idx + 1;
idx = (left + right)/2;
}
}
if(idx < 0) idx = 0;
else if(idx > NKNOTS-1) idx = NKNOTS - 1;
// T = Y0(idx) + K(idx) * (ADU - X0(idx));
int16_t valT = T[idx] + (N[idx]*(val - ADU[idx]))/D[idx];
#undef NKNOTS
return valT;
}

View File

@@ -0,0 +1,30 @@
/*
* This file is part of the Chiller project.
* Copyright 2018 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ADC_H
#define ADC_H
#include "stm32f0.h"
#define NUMBER_OF_ADC_CHANNELS (6)
extern uint16_t ADC_array[];
int32_t getMCUtemp();
uint32_t getVdd();
uint16_t getADCval(int nch);
int16_t getNTC(int nch);
#endif // ADC_H

Binary file not shown.

View File

@@ -0,0 +1,203 @@
/*
* This file is part of the Chiller project.
* Copyright 2018 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "hardware.h"
#include "usart.h"
#include "adc.h"
static inline void iwdg_setup(){
/* Enable the peripheral clock RTC */
/* (1) Enable the LSI (40kHz) */
/* (2) Wait while it is not ready */
RCC->CSR |= RCC_CSR_LSION; /* (1) */
while((RCC->CSR & RCC_CSR_LSIRDY) != RCC_CSR_LSIRDY); /* (2) */
/* Configure IWDG */
/* (1) Activate IWDG (not needed if done in option bytes) */
/* (2) Enable write access to IWDG registers */
/* (3) Set prescaler by 64 (1.6ms for each tick) */
/* (4) Set reload value to have a rollover each 1s */
/* (5) Check if flags are reset */
/* (6) Refresh counter */
IWDG->KR = IWDG_START; /* (1) */
IWDG->KR = IWDG_WRITE_ACCESS; /* (2) */
IWDG->PR = IWDG_PR_PR_1; /* (3) */
IWDG->RLR = 625; /* (4) */
while(IWDG->SR); /* (5) */
IWDG->KR = IWDG_REFRESH; /* (6) */
}
static inline void adc_setup(){
uint16_t ctr = 0; // 0xfff0 - more than 1.3ms
// Enable clocking
/* (1) Enable the peripheral clock of the ADC */
/* (2) Start HSI14 RC oscillator */
/* (3) Wait HSI14 is ready */
RCC->APB2ENR |= RCC_APB2ENR_ADC1EN; /* (1) */
RCC->CR2 |= RCC_CR2_HSI14ON; /* (2) */
while ((RCC->CR2 & RCC_CR2_HSI14RDY) == 0 && ++ctr < 0xfff0){}; /* (3) */
// calibration
/* (1) Ensure that ADEN = 0 */
/* (2) Clear ADEN */
/* (3) Launch the calibration by setting ADCAL */
/* (4) Wait until ADCAL=0 */
if ((ADC1->CR & ADC_CR_ADEN) != 0){ /* (1) */
ADC1->CR &= (uint32_t)(~ADC_CR_ADEN); /* (2) */
}
ADC1->CR |= ADC_CR_ADCAL; /* (3) */
ctr = 0; // ADC calibration time is 5.9us
while ((ADC1->CR & ADC_CR_ADCAL) != 0 && ++ctr < 0xfff0){}; /* (4) */
// enable ADC
ctr = 0;
do{
ADC1->CR |= ADC_CR_ADEN;
}while ((ADC1->ISR & ADC_ISR_ADRDY) == 0 && ++ctr < 0xfff0);
// configure ADC
/* (1) Select HSI14 by writing 00 in CKMODE (reset value) */
/* (2) Select the continuous mode */
/* (3) Select CHSEL0..3 - ADC inputs, 16,17 - t. sensor and vref */
/* (4) Select a sampling mode of 111 i.e. 239.5 ADC clk to be greater than 17.1us */
/* (5) Wake-up the VREFINT and Temperature sensor (only for VBAT, Temp sensor and VRefInt) */
// ADC1->CFGR2 &= ~ADC_CFGR2_CKMODE; /* (1) */
ADC1->CFGR1 |= ADC_CFGR1_CONT; /* (2)*/
ADC1->CHSELR = ADC_CHSELR_CHSEL0 | ADC_CHSELR_CHSEL1 | ADC_CHSELR_CHSEL2 |
ADC_CHSELR_CHSEL3 | ADC_CHSELR_CHSEL16 | ADC_CHSELR_CHSEL17; /* (3)*/
ADC1->SMPR |= ADC_SMPR_SMP_0 | ADC_SMPR_SMP_1 | ADC_SMPR_SMP_2; /* (4) */
ADC->CCR |= ADC_CCR_TSEN | ADC_CCR_VREFEN; /* (5) */
// configure DMA for ADC
// DMA for AIN
/* (1) Enable the peripheral clock on DMA */
/* (2) Enable DMA transfer on ADC and circular mode */
/* (3) Configure the peripheral data register address */
/* (4) Configure the memory address */
/* (5) Configure the number of DMA tranfer to be performs on DMA channel 1 */
/* (6) Configure increment, size, interrupts and circular mode */
/* (7) Enable DMA Channel 1 */
RCC->AHBENR |= RCC_AHBENR_DMA1EN; /* (1) */
ADC1->CFGR1 |= ADC_CFGR1_DMAEN | ADC_CFGR1_DMACFG; /* (2) */
DMA1_Channel1->CPAR = (uint32_t) (&(ADC1->DR)); /* (3) */
DMA1_Channel1->CMAR = (uint32_t)(ADC_array); /* (4) */
DMA1_Channel1->CNDTR = NUMBER_OF_ADC_CHANNELS * 9; /* (5) */
DMA1_Channel1->CCR |= DMA_CCR_MINC | DMA_CCR_MSIZE_0 | DMA_CCR_PSIZE_0 | DMA_CCR_CIRC; /* (6) */
DMA1_Channel1->CCR |= DMA_CCR_EN; /* (7) */
ADC1->CR |= ADC_CR_ADSTART; /* start the ADC conversions */
}
/**
* @brief gpio_setup - setup GPIOs for external IO
* GPIO pinout:
* PA5 - floating input - Ef of TLE5205
* PA13 - open drain - IN1 of TLE5205
* PA14 - open drain - IN2 of TLE5205
* PF0 - floating input - water level alert
* PF1 - push-pull - external alarm
* PA0..PA3 - ADC_IN0..3
* PA4, PA6, PA7 - PWM outputs
* Registers
* MODER - input/output/alternate/analog (2 bit)
* OTYPER - 0 pushpull, 1 opendrain
* OSPEEDR - x0 low, 01 medium, 11 high
* PUPDR - no/pullup/pulldown/resr (2 bit)
* IDR - input
* ODR - output
* BSRR - 0..15 - set, 16..31 - reset
* BRR - 0..15 - reset
* AFRL/AFRH - alternate functions (4 bit, AF: 0..7); L - AFR0..7, H - ARF8..15
*/
static inline void gpio_setup(){
// Enable clocks to the GPIO subsystems
RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_GPIOFEN;
GPIOA->MODER =
GPIO_MODER_MODER13_O | GPIO_MODER_MODER14_O |
GPIO_MODER_MODER4_AF | GPIO_MODER_MODER6_AF |
GPIO_MODER_MODER7_AF |
GPIO_MODER_MODER0_AI | GPIO_MODER_MODER1_AI |
GPIO_MODER_MODER2_AI | GPIO_MODER_MODER3_AI;
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN; // enable syscfg clock for EXTI
GPIOA->OTYPER = 3 << 13; // 13/14 opendrain
GPIOF->MODER = GPIO_MODER_MODER1_O;
// PB1 - interrupt input
/* (2) Select Port B for pin 1 external interrupt by writing 0001 in EXTI1*/
/* (3) Configure the corresponding mask bit in the EXTI_IMR register */
/* (4) Configure the Trigger Selection bits of the Interrupt line on rising edge*/
/* (5) Configure the Trigger Selection bits of the Interrupt line on falling edge*/
SYSCFG->EXTICR[0] = SYSCFG_EXTICR1_EXTI1_PB; /* (2) */
EXTI->IMR = EXTI_IMR_MR1; /* (3) */
//EXTI->RTSR = 0x0000; /* (4) */
EXTI->FTSR = EXTI_FTSR_TR1; /* (5) */
/* (6) Enable Interrupt on EXTI0_1 */
/* (7) Set priority for EXTI0_1 */
NVIC_EnableIRQ(EXTI0_1_IRQn); /* (6) */
NVIC_SetPriority(EXTI0_1_IRQn, 3); /* (7) */
// alternate functions:
// PA4 - TIM14_CH1 (AF4)
// PA6 - TIM16_CH1 (AF5), PA7 - TIM17_CH1 (AF5)
GPIOA->AFR[0] = (GPIOA->AFR[0] &~ (GPIO_AFRL_AFRL4 | GPIO_AFRL_AFRL6 | GPIO_AFRL_AFRL7)) \
| (4 << (4 * 4)) | (5 << (6 * 4)) | (5 << (7 * 4));
}
static inline void timers_setup(){
// timer 14 ch1 - cooler PWM
// timer 16 ch1 - heater PWM
// timer 17 ch1 - pump PWM
RCC->APB1ENR |= RCC_APB1ENR_TIM3EN | RCC_APB1ENR_TIM14EN; // enable clocking for timers 3 and 14
RCC->APB2ENR |= RCC_APB2ENR_TIM16EN | RCC_APB2ENR_TIM17EN; // & timers 16/17
// PWM mode 1 (active -> inactive)
TIM14->CCMR1 = TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1;
TIM16->CCMR1 = TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1;
TIM17->CCMR1 = TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1;
// frequency
TIM14->PSC = 59; // 0.8MHz for 3kHz PWM
TIM16->PSC = 18749; // 2.56kHz for 10Hz PWM
TIM17->PSC = 5; // 8MHz for 31kHz PWM
// ARR for 8-bit PWM
TIM14->ARR = 254;
TIM16->ARR = 254;
TIM17->ARR = 254;
// start in OFF state
// TIM14->CCR1 = 0; and so on
// enable main output
TIM14->BDTR |= TIM_BDTR_MOE;
TIM16->BDTR |= TIM_BDTR_MOE;
TIM17->BDTR |= TIM_BDTR_MOE;
// enable PWM output
TIM14->CCER = TIM_CCER_CC1E;
TIM16->CCER = TIM_CCER_CC1E;
TIM17->CCER = TIM_CCER_CC1E;
// enable timers
TIM14->CR1 |= TIM_CR1_CEN;
TIM16->CR1 |= TIM_CR1_CEN;
TIM17->CR1 |= TIM_CR1_CEN;
}
void hw_setup(){
sysreset();
gpio_setup();
adc_setup();
timers_setup();
USART1_config();
iwdg_setup();
}
/*
* Flow sensor counter
*/
void exti0_1_isr(){
if (EXTI->PR & EXTI_PR_PR1){
EXTI->PR |= EXTI_PR_PR1; /* Clear the pending bit */
++flow_cntr;
}
}

View File

@@ -0,0 +1,79 @@
/*
* This file is part of the Chiller project.
* Copyright 2018 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef HARDWARE_H
#define HARDWARE_H
#include "stm32f0.h"
// measure flow sensor data each 1 second
#define FLOW_RATE_MS (999)
// previous as string constant
#define FLOWRATESTR "1"
// each TMEASURE_MS ms calculate temperatures & check them
#define TMEASURE_MS (1000)
// each TCHECK_MS ms check cooler state and regulate temperature
#define TCHECK_MS (10000)
/*
temperature limits and tolerances
*/
// tolerance: +-1.5degrC
#define TEMP_TOLERANCE (15)
// dT tolerance: +-0.5degrC
#define DT_TOLERANCE (5)
// maximal heater temperature - 80degrC; normal - <60
#define MAX_HEATER_T (800)
#define NORMAL_HEATER_T (600)
// maximal output temperature - 45degrC; minimal - 10
#define MAX_OUTPUT_T (450)
#define MIN_OUTPUT_T (100)
// temperature working values: from 15 to 30degrC
#define OUTPUT_T_H (300)
#define OUTPUT_T_L (150)
/*
other limits & tolerances
*/
// minimal flow rate - 0.2l per minute
#define MIN_FLOW_RATE (20)
// normal flow rate
#define NORMAL_FLOW_RATE (30)
// minimal PWM values when motors should work
#define MIN_PUMP_PWM (90)
#define MIN_COOLER_PWM (90)
// PWM setters and getters
#define SET_COOLER_PWM(N) do{TIM14->CCR1 = (uint32_t)N;}while(0)
#define GET_COOLER_PWM() (uint16_t)(TIM14->CCR1)
#define SET_HEATER_PWM(N) do{TIM16->CCR1 = (uint32_t)N;}while(0)
#define GET_HEATER_PWM() (uint16_t)(TIM16->CCR1)
#define SET_PUMP_PWM(N) do{TIM17->CCR1 = (uint32_t)N;}while(0)
#define GET_PUMP_PWM() (uint16_t)(TIM17->CCR1)
// ext. alarm states
#define ALARM_ON() pin_set(GPIOF, 2)
#define ALARM_OFF() pin_clear(GPIOF, 2)
#define ALARM_STATE() pin_read(GPIOF, 2)
extern volatile uint16_t flow_rate, flow_cntr;
extern volatile uint32_t Tms;
void hw_setup(void);
#endif // HARDWARE_H

View File

@@ -0,0 +1,514 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# +12V
#
DEF +12V #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "+12V" 0 140 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 2 0 1 0 -30 50 0 100 N
P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 100 30 50 N
X +12V 1 0 0 0 U 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# +3.3V
#
DEF +3.3V #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "+3.3V" 0 140 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 2 0 1 0 -30 50 0 100 N
P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 100 30 50 N
X +3V3 1 0 0 0 U 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# +3.3VADC
#
DEF +3.3VADC #PWR 0 0 Y Y 1 F P
F0 "#PWR" 150 -50 50 H I C CNN
F1 "+3.3VADC" 0 100 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 3 0 1 0 0 0 0 40 0 40 N
P 6 0 1 0 0 40 20 20 0 70 -20 20 0 40 0 40 N
X +3.3VADC 1 0 0 0 U 50 50 0 0 W N
ENDDRAW
ENDDEF
#
# C
#
DEF C C 0 10 N Y 1 F N
F0 "C" 25 100 50 H V L CNN
F1 "C" 25 -100 50 H V L CNN
F2 "" 38 -150 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
C_*
$ENDFPLIST
DRAW
P 2 0 1 20 -80 -30 80 -30 N
P 2 0 1 20 -80 30 80 30 N
X ~ 1 0 150 110 D 50 50 1 1 P
X ~ 2 0 -150 110 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# CP
#
DEF CP C 0 10 N Y 1 F N
F0 "C" 25 100 50 H V L CNN
F1 "CP" 25 -100 50 H V L CNN
F2 "" 38 -150 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
CP_*
$ENDFPLIST
DRAW
S -90 20 -90 40 0 1 0 N
S -90 20 90 20 0 1 0 N
S 90 -20 -90 -40 0 1 0 F
S 90 40 -90 40 0 1 0 N
S 90 40 90 20 0 1 0 N
P 2 0 1 0 -70 90 -30 90 N
P 2 0 1 0 -50 110 -50 70 N
X ~ 1 0 150 110 D 50 50 1 1 P
X ~ 2 0 -150 110 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Conn_01x02
#
DEF Conn_01x02 J 0 40 Y N 1 F N
F0 "J" 0 100 50 H V C CNN
F1 "Conn_01x02" 0 -200 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_??x*mm*
Connector*:*1x??x*mm*
Pin?Header?Straight?1X*
Pin?Header?Angled?1X*
Socket?Strip?Straight?1X*
Socket?Strip?Angled?1X*
$ENDFPLIST
DRAW
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 50 50 -150 1 1 10 f
X Pin_1 1 -200 0 150 R 50 50 1 1 P
X Pin_2 2 -200 -100 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Conn_02x04_Odd_Even
#
DEF Conn_02x04_Odd_Even J 0 40 Y N 1 F N
F0 "J" 50 200 50 H V C CNN
F1 "Conn_02x04_Odd_Even" 50 -300 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*2x??x*mm*
Connector*:*2x???Pitch*
Pin_Header_Straight_2X*
Pin_Header_Angled_2X*
Socket_Strip_Straight_2X*
Socket_Strip_Angled_2X*
$ENDFPLIST
DRAW
S -50 -195 0 -205 1 1 6 N
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 150 150 -250 1 1 10 f
S 150 -195 100 -205 1 1 6 N
S 150 -95 100 -105 1 1 6 N
S 150 5 100 -5 1 1 6 N
S 150 105 100 95 1 1 6 N
X Pin_1 1 -200 100 150 R 50 50 1 1 P
X Pin_2 2 300 100 150 L 50 50 1 1 P
X Pin_3 3 -200 0 150 R 50 50 1 1 P
X Pin_4 4 300 0 150 L 50 50 1 1 P
X Pin_5 5 -200 -100 150 R 50 50 1 1 P
X Pin_6 6 300 -100 150 L 50 50 1 1 P
X Pin_7 7 -200 -200 150 R 50 50 1 1 P
X Pin_8 8 300 -200 150 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Conn_02x07_Odd_Even
#
DEF Conn_02x07_Odd_Even J 0 40 Y N 1 F N
F0 "J" 50 400 50 H V C CNN
F1 "Conn_02x07_Odd_Even" 50 -400 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*2x??x*mm*
Connector*:*2x???Pitch*
Pin_Header_Straight_2X*
Pin_Header_Angled_2X*
Socket_Strip_Straight_2X*
Socket_Strip_Angled_2X*
$ENDFPLIST
DRAW
S -50 -295 0 -305 1 1 6 N
S -50 -195 0 -205 1 1 6 N
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 205 0 195 1 1 6 N
S -50 305 0 295 1 1 6 N
S -50 350 150 -350 1 1 10 f
S 150 -295 100 -305 1 1 6 N
S 150 -195 100 -205 1 1 6 N
S 150 -95 100 -105 1 1 6 N
S 150 5 100 -5 1 1 6 N
S 150 105 100 95 1 1 6 N
S 150 205 100 195 1 1 6 N
S 150 305 100 295 1 1 6 N
X Pin_1 1 -200 300 150 R 50 50 1 1 P
X Pin_10 10 300 -100 150 L 50 50 1 1 P
X Pin_11 11 -200 -200 150 R 50 50 1 1 P
X Pin_12 12 300 -200 150 L 50 50 1 1 P
X Pin_13 13 -200 -300 150 R 50 50 1 1 P
X Pin_14 14 300 -300 150 L 50 50 1 1 P
X Pin_2 2 300 300 150 L 50 50 1 1 P
X Pin_3 3 -200 200 150 R 50 50 1 1 P
X Pin_4 4 300 200 150 L 50 50 1 1 P
X Pin_5 5 -200 100 150 R 50 50 1 1 P
X Pin_6 6 300 100 150 L 50 50 1 1 P
X Pin_7 7 -200 0 150 R 50 50 1 1 P
X Pin_8 8 300 0 150 L 50 50 1 1 P
X Pin_9 9 -200 -100 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# D
#
DEF D D 0 40 N N 1 F N
F0 "D" 0 100 50 H V C CNN
F1 "D" 0 -100 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
TO-???*
*SingleDiode
*_Diode_*
*SingleDiode*
D_*
$ENDFPLIST
DRAW
P 2 0 1 8 -50 50 -50 -50 N
P 2 0 1 0 50 0 -50 0 N
P 4 0 1 8 50 50 50 -50 -50 0 50 50 N
X K 1 -150 0 100 R 50 50 1 1 P
X A 2 150 0 100 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# DB9_Female
#
DEF DB9_Female J 0 40 Y N 1 F N
F0 "J" 0 550 50 H V C CNN
F1 "DB9_Female" 0 -575 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
DB*F*
$ENDFPLIST
DRAW
C -70 -400 30 0 1 0 N
C -70 -200 30 0 1 0 N
C -70 0 30 0 1 0 N
C -70 200 30 0 1 0 N
C -70 400 30 0 1 0 N
C 50 -300 30 0 1 0 N
C 50 -100 30 0 1 0 N
C 50 100 30 0 1 0 N
C 50 300 30 0 1 0 N
P 2 0 1 0 -150 -400 -100 -400 N
P 2 0 1 0 -150 -300 20 -300 N
P 2 0 1 0 -150 -200 -100 -200 N
P 2 0 1 0 -150 -100 20 -100 N
P 2 0 1 0 -150 0 -100 0 N
P 2 0 1 0 -150 100 20 100 N
P 2 0 1 0 -150 200 -100 200 N
P 2 0 1 0 -150 300 20 300 N
P 2 0 1 0 -150 400 -100 400 N
P 5 0 1 10 -150 525 -150 -525 150 -375 150 375 -150 525 f
X 1 1 -300 400 150 R 50 50 1 1 P
X 2 2 -300 200 150 R 50 50 1 1 P
X 3 3 -300 0 150 R 50 50 1 1 P
X 4 4 -300 -200 150 R 50 50 1 1 P
X 5 5 -300 -400 150 R 50 50 1 1 P
X 6 6 -300 300 150 R 50 50 1 1 P
X 7 7 -300 100 150 R 50 50 1 1 P
X 8 8 -300 -100 150 R 50 50 1 1 P
X 9 9 -300 -300 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# GND
#
DEF GND #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -250 50 H I C CNN
F1 "GND" 0 -150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
X GND 1 0 0 0 D 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# L
#
DEF L L 0 40 N N 1 F N
F0 "L" -50 0 50 V V C CNN
F1 "L" 75 0 50 V V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Choke_*
*Coil*
Inductor_*
L_*
$ENDFPLIST
DRAW
A 0 -75 25 -899 899 0 1 0 N 0 -100 0 -50
A 0 -25 25 -899 899 0 1 0 N 0 -50 0 0
A 0 25 25 -899 899 0 1 0 N 0 0 0 50
A 0 75 25 -899 899 0 1 0 N 0 50 0 100
X 1 1 0 150 50 D 50 50 1 1 P
X 2 2 0 -150 50 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# LM1117-3.3
#
DEF LM1117-3.3 U 0 10 Y Y 1 F N
F0 "U" -150 125 50 H V C CNN
F1 "LM1117-3.3" 0 125 50 H V L CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
SOT?223*
TO?263*
TO?252*
TO?220*
$ENDFPLIST
DRAW
S -200 -200 200 75 0 1 10 f
X GND 1 0 -300 100 U 50 50 1 1 W
X VO 2 300 0 100 L 50 50 1 1 w
X VI 3 -300 0 100 R 50 50 1 1 W
ENDDRAW
ENDDEF
#
# MAX3232
#
DEF MAX3232 U 0 40 Y Y 1 F N
F0 "U" -100 1125 50 H V R CNN
F1 "MAX3232" -100 1050 50 H V R CNN
F2 "" 50 -1050 50 H I L CNN
F3 "" 0 100 50 H I C CNN
$FPLIST
SOIC*Pitch1.27mm*
DIP*W7.62mm*
TSSOP*4.4x5mm*Pitch0.65mm*
$ENDFPLIST
DRAW
C -100 -700 25 0 1 10 N
C -100 -500 25 0 1 10 N
C 25 -300 25 0 1 10 N
C 25 -100 25 0 1 10 N
T 0 -450 -900 50 0 0 0 LOGIC Normal 0 C C
T 0 450 -900 50 0 0 0 RS232 Normal 0 C C
S -600 -1000 600 1000 0 1 10 f
P 2 0 1 10 -150 -300 -325 -300 N
P 2 0 1 10 -150 -100 -325 -100 N
P 2 0 1 10 -125 -700 -325 -700 N
P 2 0 1 10 -125 -500 -325 -500 N
P 2 0 1 10 50 -300 250 -300 N
P 2 0 1 10 50 -100 250 -100 N
P 2 0 1 10 75 -700 250 -700 N
P 2 0 1 10 75 -500 250 -500 N
P 4 0 1 10 -150 -225 -150 -375 0 -300 -150 -225 N
P 4 0 1 10 -150 -25 -150 -175 0 -100 -150 -25 N
P 4 0 1 10 75 -625 75 -775 -75 -700 75 -625 N
P 4 0 1 10 75 -425 75 -575 -75 -500 75 -425 N
X C1+ 1 -800 900 200 R 50 50 1 1 P
X T2IN 10 -800 -300 200 R 50 50 1 1 I
X T1IN 11 -800 -100 200 R 50 50 1 1 I
X R1OUT 12 -800 -500 200 R 50 50 1 1 O
X R1IN 13 800 -500 200 L 50 50 1 1 I
X T1OUT 14 800 -100 200 L 50 50 1 1 O
X GND 15 0 -1200 200 U 50 50 1 1 W
X VCC 16 0 1200 200 D 50 50 1 1 W
X VS+ 2 800 400 200 L 50 50 1 1 w
X C1- 3 -800 600 200 R 50 50 1 1 P
X C2+ 4 800 900 200 L 50 50 1 1 P
X C2- 5 800 600 200 L 50 50 1 1 P
X VS- 6 800 100 200 L 50 50 1 1 w
X T2OUT 7 800 -300 200 L 50 50 1 1 O
X R2IN 8 800 -700 200 L 50 50 1 1 I
X R2OUT 9 -800 -700 200 R 50 50 1 1 O
ENDDRAW
ENDDEF
#
# PWR_FLAG
#
DEF PWR_FLAG #FLG 0 0 N N 1 F P
F0 "#FLG" 0 75 50 H I C CNN
F1 "PWR_FLAG" 0 150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 6 0 1 0 0 0 0 50 -40 75 0 100 40 75 0 50 N
X pwr 1 0 0 0 U 50 50 0 0 w
ENDDRAW
ENDDEF
#
# Q_NMOS_GDS
#
DEF Q_NMOS_GDS Q 0 0 Y N 1 F N
F0 "Q" 200 50 50 H V L CNN
F1 "Q_NMOS_GDS" 200 -50 50 H V L CNN
F2 "" 200 100 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
C 65 0 111 0 1 10 N
C 100 -70 11 0 1 0 F
C 100 70 11 0 1 0 F
P 2 0 1 0 2 0 10 0 N
P 2 0 1 0 30 -70 100 -70 N
P 2 0 1 10 30 -50 30 -90 N
P 2 0 1 0 30 0 100 0 N
P 2 0 1 10 30 20 30 -20 N
P 2 0 1 0 30 70 100 70 N
P 2 0 1 10 30 90 30 50 N
P 2 0 1 0 100 -70 100 -100 N
P 2 0 1 0 100 -70 100 0 N
P 2 0 1 0 100 100 100 70 N
P 3 0 1 10 10 75 10 -75 10 -75 N
P 4 0 1 0 40 0 80 15 80 -15 40 0 F
P 4 0 1 0 100 -70 130 -70 130 70 100 70 N
P 4 0 1 0 110 20 115 15 145 15 150 10 N
P 4 0 1 0 130 15 115 -10 145 -10 130 15 N
X G 1 -200 0 200 R 50 50 1 1 I
X D 2 100 200 100 D 50 50 1 1 P
X S 3 100 -200 100 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Q_NMOS_GSD
#
DEF Q_NMOS_GSD Q 0 0 Y N 1 F N
F0 "Q" 200 50 50 H V L CNN
F1 "Q_NMOS_GSD" 200 -50 50 H V L CNN
F2 "" 200 100 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
C 65 0 111 0 1 10 N
C 100 -70 11 0 1 0 F
C 100 70 11 0 1 0 F
P 2 0 1 0 2 0 10 0 N
P 2 0 1 0 30 -70 100 -70 N
P 2 0 1 10 30 -50 30 -90 N
P 2 0 1 0 30 0 100 0 N
P 2 0 1 10 30 20 30 -20 N
P 2 0 1 0 30 70 100 70 N
P 2 0 1 10 30 90 30 50 N
P 2 0 1 0 100 -70 100 -100 N
P 2 0 1 0 100 -70 100 0 N
P 2 0 1 0 100 100 100 70 N
P 3 0 1 10 10 75 10 -75 10 -75 N
P 4 0 1 0 40 0 80 15 80 -15 40 0 F
P 4 0 1 0 100 -70 130 -70 130 70 100 70 N
P 4 0 1 0 110 20 115 15 145 15 150 10 N
P 4 0 1 0 130 15 115 -10 145 -10 130 15 N
X G 1 -200 0 200 R 50 50 1 1 I
X S 2 100 -200 100 U 50 50 1 1 P
X D 3 100 200 100 D 50 50 1 1 P
ENDDRAW
ENDDEF
#
# R
#
DEF R R 0 0 N Y 1 F N
F0 "R" 80 0 50 V V C CNN
F1 "R" 0 0 50 V V C CNN
F2 "" -70 0 50 V I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
R_*
R_*
$ENDFPLIST
DRAW
S -40 -100 40 100 0 1 10 N
X ~ 1 0 150 50 D 50 50 1 1 P
X ~ 2 0 -150 50 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# STM32F030F4Px
#
DEF STM32F030F4Px U 0 40 Y Y 1 L N
F0 "U" -1600 925 50 H V L BNN
F1 "STM32F030F4Px" 1600 925 50 H V R BNN
F2 "Housings_SSOP:TSSOP-20_4.4x6.5mm_Pitch0.65mm" 1600 875 50 H I R TNN
F3 "" 0 0 50 H I C CNN
DRAW
S -1600 -800 1600 900 0 1 10 f
X BOOT0 1 -1700 400 100 R 50 50 1 1 I
X ADC_IN4/SPI1_NSS/TIM14_CH1/USART1_CK/PA4 10 1700 200 100 L 50 50 1 1 B
X ADC_IN5/SPI1_SCK/PA5 11 1700 100 100 L 50 50 1 1 B
X ADC_IN6/SPI1_MISO/TIM16_CH1/TIM1_BKIN/TIM3_CH1/PA6 12 1700 0 100 L 50 50 1 1 B
X ADC_IN7/SPI1_MOSI/TIM14_CH1/TIM17_CH1/TIM1_CH1N/TIM3_CH2/PA7 13 1700 -100 100 L 50 50 1 1 B
X PB1/ADC_IN9/TIM14_CH1/TIM1_CH3N/TIM3_CH4 14 -1700 -500 100 R 50 50 1 1 B
X VSS 15 0 -900 100 U 50 50 1 1 W
X VDD 16 -100 1000 100 D 50 50 1 1 W
X I2C1_SCL/TIM1_CH2/USART1_TX/PA9 17 1700 -200 100 L 50 50 1 1 B
X I2C1_SDA/TIM17_BKIN/TIM1_CH3/USART1_RX/PA10 18 1700 -300 100 L 50 50 1 1 B
X IR_OUT/SYS_SWDIO/PA13 19 1700 -400 100 L 50 50 1 1 B
X PF0/RCC_OSC_IN 2 -1700 -200 100 R 50 50 1 1 I
X SYS_SWCLK/USART1_TX/PA14 20 1700 -500 100 L 50 50 1 1 B
X PF1/RCC_OSC_OUT 3 -1700 -300 100 R 50 50 1 1 I
X NRST 4 -1700 600 100 R 50 50 1 1 I
X VDDA 5 0 1000 100 D 50 50 1 1 W
X ADC_IN0/RTC_TAMP2/SYS_WKUP1/USART1_CTS/PA0 6 1700 600 100 L 50 50 1 1 B
X ADC_IN1/USART1_DE/USART1_RTS/PA1 7 1700 500 100 L 50 50 1 1 B
X ADC_IN2/USART1_TX/PA2 8 1700 400 100 L 50 50 1 1 B
X ADC_IN3/USART1_RX/PA3 9 1700 300 100 L 50 50 1 1 B
ENDDRAW
ENDDEF
#
# SW_Push
#
DEF SW_Push SW 0 40 N N 1 F N
F0 "SW" 50 100 50 H V L CNN
F1 "SW_Push" 0 -60 50 H V C CNN
F2 "" 0 200 50 H I C CNN
F3 "" 0 200 50 H I C CNN
DRAW
C -80 0 20 0 1 0 N
C 80 0 20 0 1 0 N
P 2 0 1 0 0 50 0 120 N
P 2 0 1 0 100 50 -100 50 N
X 1 1 -200 0 100 R 50 50 0 1 P
X 2 2 200 0 100 L 50 50 0 1 P
ENDDRAW
ENDDEF
#
#End Library

View File

@@ -0,0 +1,113 @@
"Source:","/home/eddy/Docs/SAO/ELECTRONICS/Chiller/kicad/Chiller_control.sch"
"Date:","ðÎ 28 ÑÎ× 2019 09:03:40"
"Tool:","Eeschema (6.0.0-rc1-dev-1613-ga55d9819b)"
"Generator:","/usr/local/share/kicad/plugins/bom_csv_grouped_by_value.py"
"Component Count:","68"
"Individual Components:"
"Item","Qty","Reference(s)","Value","LibPart","Footprint","Datasheet"
"","","BZ1","Buzzer","Device:Buzzer","Buzzer_Beeper:Buzzer_12x9.5RM7.6","~"
"","","C1","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C2","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C3","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C4","47u","Chiller_control-rescue:CP","Capacitor_Tantalum_SMD.pretty:CP_Tantalum_Case-A_EIA-3216-18_Hand",""
"","","C5","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C6","1u","Chiller_control-rescue:C","Capacitor_SMD.pretty:C_0805_HandSoldering",""
"","","C7","10u","Chiller_control-rescue:C","Capacitor_SMD.pretty:C_1206_HandSoldering",""
"","","C8","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C9","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C10","0.47","Chiller_control-rescue:C","Capacitor_SMD.pretty:C_0805_HandSoldering",""
"","","C11","0.47","Chiller_control-rescue:C","Capacitor_SMD.pretty:C_0805_HandSoldering",""
"","","C12","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C13","0.47","Chiller_control-rescue:C","Capacitor_SMD.pretty:C_0805_HandSoldering",""
"","","C14","1u","Chiller_control-rescue:C","Capacitor_SMD:C_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"","","C15","100u","Chiller_control-rescue:CP","Capacitor_THT:CP_Radial_D8.0mm_P3.50mm",""
"","","C16","1u","Chiller_control-rescue:C","Capacitor_SMD:C_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"","","C17","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C18","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C19","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C20","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","C21","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"","","D1","SS14","Chiller_control-rescue:D","Diode_SMD.pretty:D_SMA_Handsoldering",""
"","","J1","DB9_Female","Chiller_control-rescue:DB9_Female","modules:DB9-F",""
"","","J2","12VIN","Chiller_control-rescue:Conn_01x02","Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol",""
"","","J3","DC3-10P","Connector_Generic:Conn_02x05_Odd_Even","Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical","~"
"","","J4","DC3-10P","Connector_Generic:Conn_02x05_Odd_Even","Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical","~"
"","","J5","Cooler","Chiller_control-rescue:Conn_01x02","Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol",""
"","","J6","Heater","Chiller_control-rescue:Conn_01x02","Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol",""
"","","J7","Pump","Chiller_control-rescue:Conn_01x02","Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol",""
"","","L1","BMBA 0.1mH","Chiller_control-rescue:L","Resistors_SMD.pretty:R_0805_HandSoldering",""
"","","Q1","SI2300","Chiller_control-rescue:Q_NMOS_GSD","TO_SOT_Packages_SMD:SOT-23_Handsoldering",""
"","","Q2","SI2300","Chiller_control-rescue:Q_NMOS_GSD","TO_SOT_Packages_SMD:SOT-23_Handsoldering",""
"","","Q3","SI2300","Chiller_control-rescue:Q_NMOS_GSD","TO_SOT_Packages_SMD:SOT-23_Handsoldering",""
"","","Q4","IRL3303","Chiller_control-rescue:Q_NMOS_GDS","TO_SOT_Packages_THT:TO-220-3_Vertical",""
"","","Q5","IRL3303","Chiller_control-rescue:Q_NMOS_GDS","TO_SOT_Packages_THT:TO-220-3_Vertical",""
"","","R1","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R2","1k0.1%","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0805_HandSoldering",""
"","","R3","1k0.1%","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0805_HandSoldering",""
"","","R4","1k0.1%","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0805_HandSoldering",""
"","","R5","1k0.1%","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0805_HandSoldering",""
"","","R6","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R7","220","Chiller_control-rescue:R","Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"","","R8","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R9","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R10","510","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R11","220","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0805_HandSoldering",""
"","","R12","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R13","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R14","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R15","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R16","510","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R17","510","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R18","510","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R19","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R20","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R21","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"","","R22","220","Chiller_control-rescue:R","Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"","","R23","220","Chiller_control-rescue:R","Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"","","R24","0","Chiller_control-rescue:R","Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"","","R25","0","Chiller_control-rescue:R","Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"","","R26","220","Chiller_control-rescue:R","Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"","","SW1","Reset","Chiller_control-rescue:SW_Push","Buttons_Switches_SMD:SW_SPST_FSMSM",""
"","","SW2","Boot","Chiller_control-rescue:SW_Push","Buttons_Switches_SMD:SW_SPST_FSMSM",""
"","","U1","LM1117-3.3","Chiller_control-rescue:LM1117-3.3","TO_SOT_Packages_SMD:SOT-223",""
"","","U2","MAX3232","Chiller_control-rescue:MAX3232","Housings_SOIC:SOIC-16_3.9x9.9mm_Pitch1.27mm",""
"","","U3","STM32F030F4Px","Chiller_control-rescue:STM32F030F4Px","Housings_SSOP:TSSOP-20_4.4x6.5mm_Pitch0.65mm",""
"","","U4","L7805","Regulator_Linear:L7805","TO_SOT_Packages_THT:TO-220-3_Vertical","http://www.st.com/content/ccc/resource/technical/document/datasheet/41/4f/b3/b0/12/d4/47/88/CD00000444.pdf/files/CD00000444.pdf/jcr:content/translations/en.CD00000444.pdf"
"Collated Components:"
"Item","Qty","Reference(s)","Value","LibPart","Footprint","Datasheet"
"1","1","BZ1","Buzzer","Device:Buzzer","Buzzer_Beeper:Buzzer_12x9.5RM7.6","~"
"2","12","C1, C2, C3, C5, C8, C9, C12, C17, C18, C19, C20, C21","0.1","Chiller_control-rescue:C","Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder",""
"3","1","C4","47u","Chiller_control-rescue:CP","Capacitor_Tantalum_SMD.pretty:CP_Tantalum_Case-A_EIA-3216-18_Hand",""
"4","1","C6","1u","Chiller_control-rescue:C","Capacitor_SMD.pretty:C_0805_HandSoldering",""
"5","1","C7","10u","Chiller_control-rescue:C","Capacitor_SMD.pretty:C_1206_HandSoldering",""
"6","3","C10, C11, C13","0.47","Chiller_control-rescue:C","Capacitor_SMD.pretty:C_0805_HandSoldering",""
"7","2","C14, C16","1u","Chiller_control-rescue:C","Capacitor_SMD:C_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"8","1","C15","100u","Chiller_control-rescue:CP","Capacitor_THT:CP_Radial_D8.0mm_P3.50mm",""
"9","1","D1","SS14","Chiller_control-rescue:D","Diode_SMD.pretty:D_SMA_Handsoldering",""
"10","1","J1","DB9_Female","Chiller_control-rescue:DB9_Female","modules:DB9-F",""
"11","1","J2","12VIN","Chiller_control-rescue:Conn_01x02","Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol",""
"12","2","J3, J4","DC3-10P","Connector_Generic:Conn_02x05_Odd_Even","Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical","~"
"13","1","J5","Cooler","Chiller_control-rescue:Conn_01x02","Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol",""
"14","1","J6","Heater","Chiller_control-rescue:Conn_01x02","Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol",""
"15","1","J7","Pump","Chiller_control-rescue:Conn_01x02","Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol",""
"16","1","L1","BMBA 0.1mH","Chiller_control-rescue:L","Resistors_SMD.pretty:R_0805_HandSoldering",""
"17","3","Q1, Q2, Q3","SI2300","Chiller_control-rescue:Q_NMOS_GSD","TO_SOT_Packages_SMD:SOT-23_Handsoldering",""
"18","2","Q4, Q5","IRL3303","Chiller_control-rescue:Q_NMOS_GDS","TO_SOT_Packages_THT:TO-220-3_Vertical",""
"19","11","R1, R6, R8, R9, R12, R13, R14, R15, R19, R20, R21","10k","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"20","4","R2, R3, R4, R5","1k0.1%","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0805_HandSoldering",""
"21","4","R7, R22, R23, R26","220","Chiller_control-rescue:R","Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"22","4","R10, R16, R17, R18","510","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0603_HandSoldering",""
"23","1","R11","220","Chiller_control-rescue:R","Resistors_SMD.pretty:R_0805_HandSoldering",""
"24","2","R24, R25","0","Chiller_control-rescue:R","Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder",""
"25","1","SW1","Reset","Chiller_control-rescue:SW_Push","Buttons_Switches_SMD:SW_SPST_FSMSM",""
"26","1","SW2","Boot","Chiller_control-rescue:SW_Push","Buttons_Switches_SMD:SW_SPST_FSMSM",""
"27","1","U1","LM1117-3.3","Chiller_control-rescue:LM1117-3.3","TO_SOT_Packages_SMD:SOT-223",""
"28","1","U2","MAX3232","Chiller_control-rescue:MAX3232","Housings_SOIC:SOIC-16_3.9x9.9mm_Pitch1.27mm",""
"29","1","U3","STM32F030F4Px","Chiller_control-rescue:STM32F030F4Px","Housings_SSOP:TSSOP-20_4.4x6.5mm_Pitch0.65mm",""
"30","1","U4","L7805","Regulator_Linear:L7805","TO_SOT_Packages_THT:TO-220-3_Vertical","http://www.st.com/content/ccc/resource/technical/document/datasheet/41/4f/b3/b0/12/d4/47/88/CD00000444.pdf/files/CD00000444.pdf/jcr:content/translations/en.CD00000444.pdf"
1 Source: /home/eddy/Docs/SAO/ELECTRONICS/Chiller/kicad/Chiller_control.sch
2 Date: ðÎ 28 ÑÎ× 2019 09:03:40
3 Tool: Eeschema (6.0.0-rc1-dev-1613-ga55d9819b)
4 Generator: /usr/local/share/kicad/plugins/bom_csv_grouped_by_value.py
5 Component Count: 68
6 Individual Components:
7 Item Qty Reference(s) Value LibPart Footprint Datasheet
8 BZ1 Buzzer Device:Buzzer Buzzer_Beeper:Buzzer_12x9.5RM7.6 ~
9 C1 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
10 C2 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
11 C3 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
12 C4 47u Chiller_control-rescue:CP Capacitor_Tantalum_SMD.pretty:CP_Tantalum_Case-A_EIA-3216-18_Hand
13 C5 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
14 C6 1u Chiller_control-rescue:C Capacitor_SMD.pretty:C_0805_HandSoldering
15 C7 10u Chiller_control-rescue:C Capacitor_SMD.pretty:C_1206_HandSoldering
16 C8 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
17 C9 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
18 C10 0.47 Chiller_control-rescue:C Capacitor_SMD.pretty:C_0805_HandSoldering
19 C11 0.47 Chiller_control-rescue:C Capacitor_SMD.pretty:C_0805_HandSoldering
20 C12 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
21 C13 0.47 Chiller_control-rescue:C Capacitor_SMD.pretty:C_0805_HandSoldering
22 C14 1u Chiller_control-rescue:C Capacitor_SMD:C_0805_2012Metric_Pad1.29x1.40mm_HandSolder
23 C15 100u Chiller_control-rescue:CP Capacitor_THT:CP_Radial_D8.0mm_P3.50mm
24 C16 1u Chiller_control-rescue:C Capacitor_SMD:C_0805_2012Metric_Pad1.29x1.40mm_HandSolder
25 C17 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
26 C18 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
27 C19 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
28 C20 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
29 C21 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
30 D1 SS14 Chiller_control-rescue:D Diode_SMD.pretty:D_SMA_Handsoldering
31 J1 DB9_Female Chiller_control-rescue:DB9_Female modules:DB9-F
32 J2 12VIN Chiller_control-rescue:Conn_01x02 Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol
33 J3 DC3-10P Connector_Generic:Conn_02x05_Odd_Even Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical ~
34 J4 DC3-10P Connector_Generic:Conn_02x05_Odd_Even Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical ~
35 J5 Cooler Chiller_control-rescue:Conn_01x02 Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol
36 J6 Heater Chiller_control-rescue:Conn_01x02 Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol
37 J7 Pump Chiller_control-rescue:Conn_01x02 Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol
38 L1 BMBA 0.1mH Chiller_control-rescue:L Resistors_SMD.pretty:R_0805_HandSoldering
39 Q1 SI2300 Chiller_control-rescue:Q_NMOS_GSD TO_SOT_Packages_SMD:SOT-23_Handsoldering
40 Q2 SI2300 Chiller_control-rescue:Q_NMOS_GSD TO_SOT_Packages_SMD:SOT-23_Handsoldering
41 Q3 SI2300 Chiller_control-rescue:Q_NMOS_GSD TO_SOT_Packages_SMD:SOT-23_Handsoldering
42 Q4 IRL3303 Chiller_control-rescue:Q_NMOS_GDS TO_SOT_Packages_THT:TO-220-3_Vertical
43 Q5 IRL3303 Chiller_control-rescue:Q_NMOS_GDS TO_SOT_Packages_THT:TO-220-3_Vertical
44 R1 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
45 R2 1k0.1% Chiller_control-rescue:R Resistors_SMD.pretty:R_0805_HandSoldering
46 R3 1k0.1% Chiller_control-rescue:R Resistors_SMD.pretty:R_0805_HandSoldering
47 R4 1k0.1% Chiller_control-rescue:R Resistors_SMD.pretty:R_0805_HandSoldering
48 R5 1k0.1% Chiller_control-rescue:R Resistors_SMD.pretty:R_0805_HandSoldering
49 R6 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
50 R7 220 Chiller_control-rescue:R Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder
51 R8 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
52 R9 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
53 R10 510 Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
54 R11 220 Chiller_control-rescue:R Resistors_SMD.pretty:R_0805_HandSoldering
55 R12 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
56 R13 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
57 R14 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
58 R15 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
59 R16 510 Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
60 R17 510 Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
61 R18 510 Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
62 R19 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
63 R20 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
64 R21 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
65 R22 220 Chiller_control-rescue:R Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder
66 R23 220 Chiller_control-rescue:R Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder
67 R24 0 Chiller_control-rescue:R Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder
68 R25 0 Chiller_control-rescue:R Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder
69 R26 220 Chiller_control-rescue:R Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder
70 SW1 Reset Chiller_control-rescue:SW_Push Buttons_Switches_SMD:SW_SPST_FSMSM
71 SW2 Boot Chiller_control-rescue:SW_Push Buttons_Switches_SMD:SW_SPST_FSMSM
72 U1 LM1117-3.3 Chiller_control-rescue:LM1117-3.3 TO_SOT_Packages_SMD:SOT-223
73 U2 MAX3232 Chiller_control-rescue:MAX3232 Housings_SOIC:SOIC-16_3.9x9.9mm_Pitch1.27mm
74 U3 STM32F030F4Px Chiller_control-rescue:STM32F030F4Px Housings_SSOP:TSSOP-20_4.4x6.5mm_Pitch0.65mm
75 U4 L7805 Regulator_Linear:L7805 TO_SOT_Packages_THT:TO-220-3_Vertical http://www.st.com/content/ccc/resource/technical/document/datasheet/41/4f/b3/b0/12/d4/47/88/CD00000444.pdf/files/CD00000444.pdf/jcr:content/translations/en.CD00000444.pdf
76 Collated Components:
77 Item Qty Reference(s) Value LibPart Footprint Datasheet
78 1 1 BZ1 Buzzer Device:Buzzer Buzzer_Beeper:Buzzer_12x9.5RM7.6 ~
79 2 12 C1, C2, C3, C5, C8, C9, C12, C17, C18, C19, C20, C21 0.1 Chiller_control-rescue:C Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder
80 3 1 C4 47u Chiller_control-rescue:CP Capacitor_Tantalum_SMD.pretty:CP_Tantalum_Case-A_EIA-3216-18_Hand
81 4 1 C6 1u Chiller_control-rescue:C Capacitor_SMD.pretty:C_0805_HandSoldering
82 5 1 C7 10u Chiller_control-rescue:C Capacitor_SMD.pretty:C_1206_HandSoldering
83 6 3 C10, C11, C13 0.47 Chiller_control-rescue:C Capacitor_SMD.pretty:C_0805_HandSoldering
84 7 2 C14, C16 1u Chiller_control-rescue:C Capacitor_SMD:C_0805_2012Metric_Pad1.29x1.40mm_HandSolder
85 8 1 C15 100u Chiller_control-rescue:CP Capacitor_THT:CP_Radial_D8.0mm_P3.50mm
86 9 1 D1 SS14 Chiller_control-rescue:D Diode_SMD.pretty:D_SMA_Handsoldering
87 10 1 J1 DB9_Female Chiller_control-rescue:DB9_Female modules:DB9-F
88 11 1 J2 12VIN Chiller_control-rescue:Conn_01x02 Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol
89 12 2 J3, J4 DC3-10P Connector_Generic:Conn_02x05_Odd_Even Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical ~
90 13 1 J5 Cooler Chiller_control-rescue:Conn_01x02 Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol
91 14 1 J6 Heater Chiller_control-rescue:Conn_01x02 Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol
92 15 1 J7 Pump Chiller_control-rescue:Conn_01x02 Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol
93 16 1 L1 BMBA 0.1mH Chiller_control-rescue:L Resistors_SMD.pretty:R_0805_HandSoldering
94 17 3 Q1, Q2, Q3 SI2300 Chiller_control-rescue:Q_NMOS_GSD TO_SOT_Packages_SMD:SOT-23_Handsoldering
95 18 2 Q4, Q5 IRL3303 Chiller_control-rescue:Q_NMOS_GDS TO_SOT_Packages_THT:TO-220-3_Vertical
96 19 11 R1, R6, R8, R9, R12, R13, R14, R15, R19, R20, R21 10k Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
97 20 4 R2, R3, R4, R5 1k0.1% Chiller_control-rescue:R Resistors_SMD.pretty:R_0805_HandSoldering
98 21 4 R7, R22, R23, R26 220 Chiller_control-rescue:R Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder
99 22 4 R10, R16, R17, R18 510 Chiller_control-rescue:R Resistors_SMD.pretty:R_0603_HandSoldering
100 23 1 R11 220 Chiller_control-rescue:R Resistors_SMD.pretty:R_0805_HandSoldering
101 24 2 R24, R25 0 Chiller_control-rescue:R Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder
102 25 1 SW1 Reset Chiller_control-rescue:SW_Push Buttons_Switches_SMD:SW_SPST_FSMSM
103 26 1 SW2 Boot Chiller_control-rescue:SW_Push Buttons_Switches_SMD:SW_SPST_FSMSM
104 27 1 U1 LM1117-3.3 Chiller_control-rescue:LM1117-3.3 TO_SOT_Packages_SMD:SOT-223
105 28 1 U2 MAX3232 Chiller_control-rescue:MAX3232 Housings_SOIC:SOIC-16_3.9x9.9mm_Pitch1.27mm
106 29 1 U3 STM32F030F4Px Chiller_control-rescue:STM32F030F4Px Housings_SSOP:TSSOP-20_4.4x6.5mm_Pitch0.65mm
107 30 1 U4 L7805 Regulator_Linear:L7805 TO_SOT_Packages_THT:TO-220-3_Vertical http://www.st.com/content/ccc/resource/technical/document/datasheet/41/4f/b3/b0/12/d4/47/88/CD00000444.pdf/files/CD00000444.pdf/jcr:content/translations/en.CD00000444.pdf

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,920 @@
(export (version D)
(design
(source /home/eddy/Docs/SAO/ELECTRONICS/Chiller/kicad/Chiller_control.sch)
(date "Вс 27 янв 2019 17:08:13")
(tool "Eeschema 6.0.0-rc1-unknown")
(sheet (number 1) (name /) (tstamps /)
(title_block
(title)
(company)
(rev)
(date)
(source Chiller_control.sch)
(comment (number 1) (value ""))
(comment (number 2) (value ""))
(comment (number 3) (value ""))
(comment (number 4) (value "")))))
(components
(comp (ref C4)
(value 47u)
(footprint Capacitor_Tantalum_SMD.pretty:CP_Tantalum_Case-A_EIA-3216-18_Hand)
(libsource (lib Chiller_control-rescue) (part CP) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 58C454F6))
(comp (ref R1)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 590D30C8))
(comp (ref C2)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 590D4150))
(comp (ref C1)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 590D4832))
(comp (ref SW2)
(value Boot)
(footprint Buttons_Switches_SMD:SW_SPST_FSMSM)
(libsource (lib Chiller_control-rescue) (part SW_Push) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5909F6B6))
(comp (ref SW1)
(value Reset)
(footprint Buttons_Switches_SMD:SW_SPST_FSMSM)
(libsource (lib Chiller_control-rescue) (part SW_Push) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 590A0134))
(comp (ref J2)
(value 12VIN)
(footprint Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol)
(libsource (lib Chiller_control-rescue) (part Conn_01x02) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5A170C1F))
(comp (ref C3)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5A178C32))
(comp (ref U3)
(value STM32F030F4Px)
(footprint Housings_SSOP:TSSOP-20_4.4x6.5mm_Pitch0.65mm)
(libsource (lib Chiller_control-rescue) (part STM32F030F4Px) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5A189F52))
(comp (ref C6)
(value 1u)
(footprint Capacitor_SMD.pretty:C_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5A1AB970))
(comp (ref U1)
(value LM1117-3.3)
(footprint TO_SOT_Packages_SMD:SOT-223)
(libsource (lib Chiller_control-rescue) (part LM1117-3.3) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5A2588E7))
(comp (ref C5)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEE1D09))
(comp (ref D1)
(value SS14)
(footprint Diode_SMD.pretty:D_SMA_Handsoldering)
(libsource (lib Chiller_control-rescue) (part D) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEE236F))
(comp (ref L1)
(value "BMBA 0.1mH")
(footprint Resistors_SMD.pretty:R_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part L) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEE7949))
(comp (ref C7)
(value 10u)
(footprint Capacitor_SMD.pretty:C_1206_HandSoldering)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEE8065))
(comp (ref R8)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEA391))
(comp (ref R6)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEA7BE))
(comp (ref Q2)
(value SI2300)
(footprint TO_SOT_Packages_SMD:SOT-23_Handsoldering)
(libsource (lib Chiller_control-rescue) (part Q_NMOS_GSD) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEDCAD0))
(comp (ref R14)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEDD4AE))
(comp (ref R15)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEDD8A0))
(comp (ref R19)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEBD18))
(comp (ref R16)
(value 510)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEBD1E))
(comp (ref Q3)
(value SI2300)
(footprint TO_SOT_Packages_SMD:SOT-23_Handsoldering)
(libsource (lib Chiller_control-rescue) (part Q_NMOS_GSD) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEBD24))
(comp (ref R20)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEC934))
(comp (ref R17)
(value 510)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEC93A))
(comp (ref Q4)
(value IRL3303)
(footprint TO_SOT_Packages_THT:TO-220-3_Vertical)
(libsource (lib Chiller_control-rescue) (part Q_NMOS_GDS) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEC940))
(comp (ref R21)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEED557))
(comp (ref R18)
(value 510)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEED55D))
(comp (ref Q5)
(value IRL3303)
(footprint TO_SOT_Packages_THT:TO-220-3_Vertical)
(libsource (lib Chiller_control-rescue) (part Q_NMOS_GDS) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEED563))
(comp (ref R2)
(value 1k0.1%)
(footprint Resistors_SMD.pretty:R_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEF45BA))
(comp (ref R3)
(value 1k0.1%)
(footprint Resistors_SMD.pretty:R_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEF7CBC))
(comp (ref R4)
(value 1k0.1%)
(footprint Resistors_SMD.pretty:R_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEF8256))
(comp (ref R5)
(value 1k0.1%)
(footprint Resistors_SMD.pretty:R_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEFAAF1))
(comp (ref U2)
(value MAX3232)
(footprint Housings_SOIC:SOIC-16_3.9x9.9mm_Pitch1.27mm)
(libsource (lib Chiller_control-rescue) (part MAX3232) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEFC197))
(comp (ref C11)
(value 0.47)
(footprint Capacitor_SMD.pretty:C_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEFD47C))
(comp (ref C10)
(value 0.47)
(footprint Capacitor_SMD.pretty:C_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEFD7DB))
(comp (ref C13)
(value 0.47)
(footprint Capacitor_SMD.pretty:C_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEFD89D))
(comp (ref C9)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEFF11C))
(comp (ref C8)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BF0257F))
(comp (ref J1)
(value DB9_Female)
(footprint modules:DB9-F)
(libsource (lib Chiller_control-rescue) (part DB9_Female) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BF02D65))
(comp (ref J5)
(value Cooler)
(footprint Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol)
(libsource (lib Chiller_control-rescue) (part Conn_01x02) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BF1B9CF))
(comp (ref J6)
(value Heater)
(footprint Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol)
(libsource (lib Chiller_control-rescue) (part Conn_01x02) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BF1EE9B))
(comp (ref J7)
(value Pump)
(footprint Connectors_Terminal_Blocks:TerminalBlock_Pheonix_MKDS1.5-2pol)
(libsource (lib Chiller_control-rescue) (part Conn_01x02) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BF1F6CF))
(comp (ref R13)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEE33E1))
(comp (ref R11)
(value 220)
(footprint Resistors_SMD.pretty:R_0805_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEDB615))
(comp (ref Q1)
(value SI2300)
(footprint TO_SOT_Packages_SMD:SOT-23_Handsoldering)
(libsource (lib Chiller_control-rescue) (part Q_NMOS_GSD) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEB585))
(comp (ref R10)
(value 510)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEB37B))
(comp (ref R12)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEEB2E1))
(comp (ref C12)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5A386BD0))
(comp (ref R9)
(value 10k)
(footprint Resistors_SMD.pretty:R_0603_HandSoldering)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEE5083))
(comp (ref R7)
(value 220)
(footprint Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5BEDA6BA))
(comp (ref R22)
(value 220)
(footprint Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C509370))
(comp (ref R23)
(value 220)
(footprint Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C50F547))
(comp (ref C15)
(value 100u)
(footprint Capacitor_THT:CP_Radial_D8.0mm_P3.50mm)
(libsource (lib Chiller_control-rescue) (part CP) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C53FDA9))
(comp (ref R26)
(value 220)
(footprint Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C5422DE))
(comp (ref C16)
(value 1u)
(footprint Capacitor_SMD:C_0805_2012Metric_Pad1.29x1.40mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C548AFE))
(comp (ref R25)
(value 0)
(footprint Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C565B8F))
(comp (ref R24)
(value 0)
(footprint Resistor_SMD:R_0805_2012Metric_Pad1.29x1.40mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part R) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C56BFDC))
(comp (ref U4)
(value L7805)
(footprint TO_SOT_Packages_THT:TO-220-3_Vertical)
(datasheet http://www.st.com/content/ccc/resource/technical/document/datasheet/41/4f/b3/b0/12/d4/47/88/CD00000444.pdf/files/CD00000444.pdf/jcr:content/translations/en.CD00000444.pdf)
(libsource (lib Regulator_Linear) (part L7805) (description "Positive 1.5A 35V Linear Regulator, Fixed Output 5V, TO-220/TO-263/TO-252"))
(sheetpath (names /) (tstamps /))
(tstamp 5C573DC9))
(comp (ref C14)
(value 1u)
(footprint Capacitor_SMD:C_0805_2012Metric_Pad1.29x1.40mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C574153))
(comp (ref C18)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C5C6D73))
(comp (ref C20)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C5D4FAB))
(comp (ref C17)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C5D51AF))
(comp (ref C19)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C5D5336))
(comp (ref C21)
(value 0.1)
(footprint Capacitor_SMD:C_0603_1608Metric_Pad0.99x1.00mm_HandSolder)
(libsource (lib Chiller_control-rescue) (part C) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5C6511ED))
(comp (ref J4)
(value DC3-10P)
(footprint Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical)
(datasheet ~)
(libsource (lib Connector_Generic) (part Conn_02x05_Odd_Even) (description "Generic connector, double row, 02x05, odd/even pin numbering scheme (row 1 odd numbers, row 2 even numbers), script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5C71D1DB))
(comp (ref J3)
(value DC3-10P)
(footprint Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical)
(datasheet ~)
(libsource (lib Connector_Generic) (part Conn_02x05_Odd_Even) (description "Generic connector, double row, 02x05, odd/even pin numbering scheme (row 1 odd numbers, row 2 even numbers), script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5C81FA0E))
(comp (ref BZ1)
(value Buzzer)
(footprint Buzzer_Beeper:Buzzer_12x9.5RM7.6)
(datasheet ~)
(libsource (lib Device) (part Buzzer) (description "Buzzer, polar"))
(sheetpath (names /) (tstamps /))
(tstamp 5C83133C)))
(libparts
(libpart (lib Chiller_control-rescue) (part C)
(footprints
(fp C_*))
(fields
(field (name Reference) C)
(field (name Value) C))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib Chiller_control-rescue) (part CP)
(footprints
(fp CP_*))
(fields
(field (name Reference) C)
(field (name Value) CP))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib Chiller_control-rescue) (part Conn_01x02)
(footprints
(fp Connector*:*_??x*mm*)
(fp Connector*:*1x??x*mm*)
(fp Pin?Header?Straight?1X*)
(fp Pin?Header?Angled?1X*)
(fp Socket?Strip?Straight?1X*)
(fp Socket?Strip?Angled?1X*))
(fields
(field (name Reference) J)
(field (name Value) Conn_01x02))
(pins
(pin (num 1) (name Pin_1) (type passive))
(pin (num 2) (name Pin_2) (type passive))))
(libpart (lib Chiller_control-rescue) (part D)
(footprints
(fp TO-???*)
(fp *SingleDiode)
(fp *_Diode_*)
(fp *SingleDiode*)
(fp D_*))
(fields
(field (name Reference) D)
(field (name Value) D))
(pins
(pin (num 1) (name K) (type passive))
(pin (num 2) (name A) (type passive))))
(libpart (lib Chiller_control-rescue) (part DB9_Female)
(footprints
(fp DB*F*))
(fields
(field (name Reference) J)
(field (name Value) DB9_Female))
(pins
(pin (num 1) (name 1) (type passive))
(pin (num 2) (name 2) (type passive))
(pin (num 3) (name 3) (type passive))
(pin (num 4) (name 4) (type passive))
(pin (num 5) (name 5) (type passive))
(pin (num 6) (name 6) (type passive))
(pin (num 7) (name 7) (type passive))
(pin (num 8) (name 8) (type passive))
(pin (num 9) (name 9) (type passive))))
(libpart (lib Chiller_control-rescue) (part L)
(footprints
(fp Choke_*)
(fp *Coil*)
(fp Inductor_*)
(fp L_*))
(fields
(field (name Reference) L)
(field (name Value) L))
(pins
(pin (num 1) (name 1) (type passive))
(pin (num 2) (name 2) (type passive))))
(libpart (lib Chiller_control-rescue) (part LM1117-3.3)
(footprints
(fp SOT?223*)
(fp TO?263*)
(fp TO?252*)
(fp TO?220*))
(fields
(field (name Reference) U)
(field (name Value) LM1117-3.3))
(pins
(pin (num 1) (name GND) (type power_in))
(pin (num 2) (name VO) (type power_out))
(pin (num 3) (name VI) (type power_in))))
(libpart (lib Chiller_control-rescue) (part MAX3232)
(footprints
(fp SOIC*Pitch1.27mm*)
(fp DIP*W7.62mm*)
(fp TSSOP*4.4x5mm*Pitch0.65mm*))
(fields
(field (name Reference) U)
(field (name Value) MAX3232))
(pins
(pin (num 1) (name C1+) (type passive))
(pin (num 2) (name VS+) (type power_out))
(pin (num 3) (name C1-) (type passive))
(pin (num 4) (name C2+) (type passive))
(pin (num 5) (name C2-) (type passive))
(pin (num 6) (name VS-) (type power_out))
(pin (num 7) (name T2OUT) (type output))
(pin (num 8) (name R2IN) (type input))
(pin (num 9) (name R2OUT) (type output))
(pin (num 10) (name T2IN) (type input))
(pin (num 11) (name T1IN) (type input))
(pin (num 12) (name R1OUT) (type output))
(pin (num 13) (name R1IN) (type input))
(pin (num 14) (name T1OUT) (type output))
(pin (num 15) (name GND) (type power_in))
(pin (num 16) (name VCC) (type power_in))))
(libpart (lib Chiller_control-rescue) (part Q_NMOS_GDS)
(fields
(field (name Reference) Q)
(field (name Value) Q_NMOS_GDS))
(pins
(pin (num 1) (name G) (type input))
(pin (num 2) (name D) (type passive))
(pin (num 3) (name S) (type passive))))
(libpart (lib Chiller_control-rescue) (part Q_NMOS_GSD)
(fields
(field (name Reference) Q)
(field (name Value) Q_NMOS_GSD))
(pins
(pin (num 1) (name G) (type input))
(pin (num 2) (name S) (type passive))
(pin (num 3) (name D) (type passive))))
(libpart (lib Chiller_control-rescue) (part R)
(footprints
(fp R_*)
(fp R_*))
(fields
(field (name Reference) R)
(field (name Value) R))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib Chiller_control-rescue) (part STM32F030F4Px)
(fields
(field (name Reference) U)
(field (name Value) STM32F030F4Px)
(field (name Footprint) Housings_SSOP:TSSOP-20_4.4x6.5mm_Pitch0.65mm))
(pins
(pin (num 1) (name BOOT0) (type input))
(pin (num 2) (name PF0/RCC_OSC_IN) (type input))
(pin (num 3) (name PF1/RCC_OSC_OUT) (type input))
(pin (num 4) (name NRST) (type input))
(pin (num 5) (name VDDA) (type power_in))
(pin (num 6) (name ADC_IN0/RTC_TAMP2/SYS_WKUP1/USART1_CTS/PA0) (type BiDi))
(pin (num 7) (name ADC_IN1/USART1_DE/USART1_RTS/PA1) (type BiDi))
(pin (num 8) (name ADC_IN2/USART1_TX/PA2) (type BiDi))
(pin (num 9) (name ADC_IN3/USART1_RX/PA3) (type BiDi))
(pin (num 10) (name ADC_IN4/SPI1_NSS/TIM14_CH1/USART1_CK/PA4) (type BiDi))
(pin (num 11) (name ADC_IN5/SPI1_SCK/PA5) (type BiDi))
(pin (num 12) (name ADC_IN6/SPI1_MISO/TIM16_CH1/TIM1_BKIN/TIM3_CH1/PA6) (type BiDi))
(pin (num 13) (name ADC_IN7/SPI1_MOSI/TIM14_CH1/TIM17_CH1/TIM1_CH1N/TIM3_CH2/PA7) (type BiDi))
(pin (num 14) (name PB1/ADC_IN9/TIM14_CH1/TIM1_CH3N/TIM3_CH4) (type BiDi))
(pin (num 15) (name VSS) (type power_in))
(pin (num 16) (name VDD) (type power_in))
(pin (num 17) (name I2C1_SCL/TIM1_CH2/USART1_TX/PA9) (type BiDi))
(pin (num 18) (name I2C1_SDA/TIM17_BKIN/TIM1_CH3/USART1_RX/PA10) (type BiDi))
(pin (num 19) (name IR_OUT/SYS_SWDIO/PA13) (type BiDi))
(pin (num 20) (name SYS_SWCLK/USART1_TX/PA14) (type BiDi))))
(libpart (lib Chiller_control-rescue) (part SW_Push)
(fields
(field (name Reference) SW)
(field (name Value) SW_Push))
(pins
(pin (num 1) (name 1) (type passive))
(pin (num 2) (name 2) (type passive))))
(libpart (lib Connector_Generic) (part Conn_02x05_Odd_Even)
(description "Generic connector, double row, 02x05, odd/even pin numbering scheme (row 1 odd numbers, row 2 even numbers), script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs ~)
(footprints
(fp Connector*:*_2x??_*))
(fields
(field (name Reference) J)
(field (name Value) Conn_02x05_Odd_Even))
(pins
(pin (num 1) (name Pin_1) (type passive))
(pin (num 2) (name Pin_2) (type passive))
(pin (num 3) (name Pin_3) (type passive))
(pin (num 4) (name Pin_4) (type passive))
(pin (num 5) (name Pin_5) (type passive))
(pin (num 6) (name Pin_6) (type passive))
(pin (num 7) (name Pin_7) (type passive))
(pin (num 8) (name Pin_8) (type passive))
(pin (num 9) (name Pin_9) (type passive))
(pin (num 10) (name Pin_10) (type passive))))
(libpart (lib Device) (part Buzzer)
(description "Buzzer, polar")
(docs ~)
(footprints
(fp *Buzzer*))
(fields
(field (name Reference) BZ)
(field (name Value) Buzzer))
(pins
(pin (num 1) (name -) (type passive))
(pin (num 2) (name +) (type passive))))
(libpart (lib Regulator_Linear) (part L7805)
(aliases
(alias L7806)
(alias L7808)
(alias L7885)
(alias L7809)
(alias L7812)
(alias L7815)
(alias L7818)
(alias L7824))
(description "Positive 1.5A 35V Linear Regulator, Fixed Output 5V, TO-220/TO-263/TO-252")
(docs http://www.st.com/content/ccc/resource/technical/document/datasheet/41/4f/b3/b0/12/d4/47/88/CD00000444.pdf/files/CD00000444.pdf/jcr:content/translations/en.CD00000444.pdf)
(footprints
(fp TO?252*)
(fp TO?263*)
(fp TO?220*))
(fields
(field (name Reference) U)
(field (name Value) L7805))
(pins
(pin (num 1) (name IN) (type power_in))
(pin (num 2) (name GND) (type power_in))
(pin (num 3) (name OUT) (type power_out)))))
(libraries
(library (logical Chiller_control-rescue)
(uri /home/eddy/Docs/SAO/ELECTRONICS/Chiller/kicad/Chiller_control-rescue.lib))
(library (logical Connector_Generic)
(uri /usr/share/kicad/kicad-symbols//Connector_Generic.lib))
(library (logical Device)
(uri /usr/share/kicad/kicad-symbols//Device.lib))
(library (logical Regulator_Linear)
(uri /usr/share/kicad/kicad-symbols//Regulator_Linear.lib)))
(nets
(net (code 1) (name /W.levl)
(node (ref R13) (pin 2))
(node (ref R11) (pin 1))
(node (ref J3) (pin 5)))
(net (code 2) (name +3V3)
(node (ref R9) (pin 1))
(node (ref L1) (pin 1))
(node (ref U3) (pin 16))
(node (ref R14) (pin 2))
(node (ref U2) (pin 16))
(node (ref Q2) (pin 1))
(node (ref R6) (pin 1))
(node (ref BZ1) (pin 1))
(node (ref R8) (pin 1))
(node (ref SW2) (pin 2))
(node (ref C5) (pin 1))
(node (ref U1) (pin 2))
(node (ref R13) (pin 1))
(node (ref C4) (pin 1))
(node (ref C6) (pin 1))
(node (ref C9) (pin 2)))
(net (code 3) (name /DigIn0)
(node (ref R11) (pin 2))
(node (ref C12) (pin 1))
(node (ref U3) (pin 2)))
(net (code 4) (name "Net-(Q1-Pad1)")
(node (ref Q1) (pin 1))
(node (ref R10) (pin 1)))
(net (code 5) (name GND)
(node (ref Q3) (pin 2))
(node (ref R1) (pin 2))
(node (ref R21) (pin 1))
(node (ref C4) (pin 2))
(node (ref U3) (pin 15))
(node (ref SW1) (pin 2))
(node (ref U1) (pin 1))
(node (ref C3) (pin 2))
(node (ref J2) (pin 2))
(node (ref C2) (pin 2))
(node (ref C1) (pin 2))
(node (ref C18) (pin 2))
(node (ref U4) (pin 2))
(node (ref C21) (pin 1))
(node (ref C14) (pin 2))
(node (ref C20) (pin 2))
(node (ref C16) (pin 1))
(node (ref J3) (pin 4))
(node (ref J3) (pin 6))
(node (ref J3) (pin 10))
(node (ref R19) (pin 1))
(node (ref Q5) (pin 3))
(node (ref Q4) (pin 3))
(node (ref R20) (pin 1))
(node (ref C7) (pin 1))
(node (ref C19) (pin 1))
(node (ref C17) (pin 1))
(node (ref R4) (pin 2))
(node (ref R3) (pin 2))
(node (ref R2) (pin 2))
(node (ref C11) (pin 1))
(node (ref R5) (pin 2))
(node (ref U2) (pin 15))
(node (ref R12) (pin 1))
(node (ref C12) (pin 2))
(node (ref Q1) (pin 2))
(node (ref C9) (pin 1))
(node (ref C13) (pin 1))
(node (ref J1) (pin 5))
(node (ref C6) (pin 2))
(node (ref C5) (pin 2)))
(net (code 6) (name /DigOut1)
(node (ref U3) (pin 19))
(node (ref R6) (pin 2))
(node (ref R22) (pin 2)))
(net (code 7) (name /Out2)
(node (ref J3) (pin 3))
(node (ref R23) (pin 1)))
(net (code 8) (name /DigOut2)
(node (ref R23) (pin 2))
(node (ref R8) (pin 2))
(node (ref U3) (pin 20)))
(net (code 9) (name /Out1)
(node (ref J3) (pin 1))
(node (ref R22) (pin 1)))
(net (code 10) (name +12V)
(node (ref J5) (pin 1))
(node (ref J6) (pin 1))
(node (ref J7) (pin 1))
(node (ref J2) (pin 1))
(node (ref C15) (pin 1))
(node (ref R25) (pin 2))
(node (ref D1) (pin 2)))
(net (code 11) (name "Net-(C15-Pad2)")
(node (ref C15) (pin 2))
(node (ref J5) (pin 2))
(node (ref Q3) (pin 3)))
(net (code 12) (name /IN)
(node (ref R9) (pin 2))
(node (ref R7) (pin 1))
(node (ref J3) (pin 2)))
(net (code 13) (name /DigOut0)
(node (ref R12) (pin 2))
(node (ref U3) (pin 3))
(node (ref R10) (pin 2)))
(net (code 14) (name "Net-(J6-Pad2)")
(node (ref J6) (pin 2))
(node (ref Q4) (pin 2)))
(net (code 15) (name "Net-(J7-Pad2)")
(node (ref Q5) (pin 2))
(node (ref J7) (pin 2)))
(net (code 16) (name "Net-(J1-Pad2)")
(node (ref J1) (pin 2))
(node (ref U2) (pin 7)))
(net (code 17) (name "Net-(J1-Pad3)")
(node (ref J1) (pin 3))
(node (ref U2) (pin 8)))
(net (code 18) (name "Net-(C10-Pad1)")
(node (ref C10) (pin 1))
(node (ref U2) (pin 4)))
(net (code 19) (name "Net-(C10-Pad2)")
(node (ref C10) (pin 2))
(node (ref U2) (pin 5)))
(net (code 20) (name "Net-(C13-Pad2)")
(node (ref C13) (pin 2))
(node (ref U2) (pin 6)))
(net (code 21) (name "Net-(C11-Pad2)")
(node (ref U2) (pin 2))
(node (ref C11) (pin 2)))
(net (code 22) (name /Yellow)
(node (ref J3) (pin 9))
(node (ref R26) (pin 1)))
(net (code 23) (name "Net-(C8-Pad1)")
(node (ref C8) (pin 1))
(node (ref U2) (pin 3)))
(net (code 24) (name "Net-(C8-Pad2)")
(node (ref U2) (pin 1))
(node (ref C8) (pin 2)))
(net (code 25) (name "Net-(J4-Pad10)")
(node (ref J4) (pin 10)))
(net (code 26) (name /ADC2)
(node (ref R4) (pin 1))
(node (ref J4) (pin 3))
(node (ref U3) (pin 8))
(node (ref C20) (pin 1)))
(net (code 27) (name +3.3VADC)
(node (ref J4) (pin 6))
(node (ref J4) (pin 4))
(node (ref J4) (pin 2))
(node (ref J4) (pin 8))
(node (ref U3) (pin 5))
(node (ref L1) (pin 2))
(node (ref C7) (pin 2)))
(net (code 28) (name "Net-(J4-Pad9)")
(node (ref J4) (pin 9)))
(net (code 29) (name "Net-(J3-Pad8)")
(node (ref J3) (pin 8)))
(net (code 30) (name "Net-(BZ1-Pad2)")
(node (ref Q1) (pin 3))
(node (ref BZ1) (pin 2)))
(net (code 31) (name /ADC3)
(node (ref U3) (pin 9))
(node (ref C18) (pin 1))
(node (ref R5) (pin 1))
(node (ref J4) (pin 1)))
(net (code 32) (name /ADC1)
(node (ref J4) (pin 5))
(node (ref U3) (pin 7))
(node (ref R3) (pin 1))
(node (ref C19) (pin 2)))
(net (code 33) (name /Red)
(node (ref J3) (pin 7))
(node (ref R15) (pin 1))
(node (ref R25) (pin 1))
(node (ref R24) (pin 1)))
(net (code 34) (name +5V)
(node (ref R24) (pin 2))
(node (ref U4) (pin 3))
(node (ref C3) (pin 1))
(node (ref U1) (pin 3)))
(net (code 35) (name "Net-(C14-Pad1)")
(node (ref U4) (pin 1))
(node (ref C14) (pin 1))
(node (ref D1) (pin 1)))
(net (code 36) (name "Net-(C16-Pad2)")
(node (ref R26) (pin 2))
(node (ref R15) (pin 2))
(node (ref Q2) (pin 3))
(node (ref C16) (pin 2)))
(net (code 37) (name /ADC0)
(node (ref U3) (pin 6))
(node (ref C17) (pin 2))
(node (ref R2) (pin 1))
(node (ref J4) (pin 7)))
(net (code 38) (name "Net-(Q4-Pad1)")
(node (ref Q4) (pin 1))
(node (ref R17) (pin 1)))
(net (code 39) (name "Net-(Q5-Pad1)")
(node (ref R18) (pin 1))
(node (ref Q5) (pin 1)))
(net (code 40) (name "Net-(Q3-Pad1)")
(node (ref Q3) (pin 1))
(node (ref R16) (pin 1)))
(net (code 41) (name /BOOT0)
(node (ref SW2) (pin 1))
(node (ref C2) (pin 1))
(node (ref R1) (pin 1))
(node (ref U3) (pin 1)))
(net (code 42) (name /Tim14Ch1)
(node (ref R16) (pin 2))
(node (ref R19) (pin 2))
(node (ref U3) (pin 10)))
(net (code 43) (name /DigIn1)
(node (ref C21) (pin 2))
(node (ref U3) (pin 11))
(node (ref R7) (pin 2)))
(net (code 44) (name /TIM16_Ch1)
(node (ref R20) (pin 2))
(node (ref R17) (pin 2))
(node (ref U3) (pin 12)))
(net (code 45) (name /TIM17_Ch1)
(node (ref R18) (pin 2))
(node (ref R21) (pin 2))
(node (ref U3) (pin 13)))
(net (code 46) (name /TIM3_Ch4)
(node (ref U3) (pin 14))
(node (ref Q2) (pin 2))
(node (ref R14) (pin 1)))
(net (code 47) (name /USART_Tx)
(node (ref U3) (pin 17))
(node (ref U2) (pin 10)))
(net (code 48) (name /USART_Rx)
(node (ref U2) (pin 9))
(node (ref U3) (pin 18)))
(net (code 49) (name /NRST)
(node (ref SW1) (pin 1))
(node (ref C1) (pin 1))
(node (ref U3) (pin 4)))
(net (code 50) (name "Net-(U2-Pad14)")
(node (ref U2) (pin 14)))
(net (code 51) (name "Net-(U2-Pad13)")
(node (ref U2) (pin 13)))
(net (code 52) (name "Net-(J1-Pad9)")
(node (ref J1) (pin 9)))
(net (code 53) (name "Net-(U2-Pad11)")
(node (ref U2) (pin 11)))
(net (code 54) (name "Net-(U2-Pad12)")
(node (ref U2) (pin 12)))
(net (code 55) (name "Net-(J1-Pad4)")
(node (ref J1) (pin 4)))
(net (code 56) (name "Net-(J1-Pad6)")
(node (ref J1) (pin 6)))
(net (code 57) (name "Net-(J1-Pad7)")
(node (ref J1) (pin 7)))
(net (code 58) (name "Net-(J1-Pad8)")
(node (ref J1) (pin 8)))
(net (code 59) (name "Net-(J1-Pad1)")
(node (ref J1) (pin 1)))))

View File

@@ -0,0 +1,100 @@
update=Вс 27 янв 2019 15:05:22
version=1
last_client=kicad
[cvpcb]
version=1
NetIExt=net
[general]
version=1
[schematic_editor]
version=1
PageLayoutDescrFile=
PlotDirectoryName=
SubpartIdSeparator=0
SubpartFirstId=65
NetFmtName=Pcbnew
SpiceForceRefPrefix=0
SpiceUseNetNumbers=0
LabSize=60
[eeschema]
version=1
LibDir=
[pcbnew]
version=1
PageLayoutDescrFile=
LastNetListRead=Chiller_control.net
CopperLayerCount=2
BoardThickness=1.6
AllowMicroVias=0
AllowBlindVias=0
RequireCourtyardDefinitions=0
ProhibitOverlappingCourtyards=1
MinTrackWidth=0.2
MinViaDiameter=0.4
MinViaDrill=0.3
MinMicroViaDiameter=0.2
MinMicroViaDrill=0.09999999999999999
MinHoleToHole=0.25
TrackWidth1=0.5
TrackWidth2=0.25
TrackWidth3=0.5
TrackWidth4=1
TrackWidth5=2
ViaDiameter1=1.2
ViaDrill1=0.6
ViaDiameter2=1.2
ViaDrill2=0.6
ViaDiameter3=1.5
ViaDrill3=0.8
ViaDiameter4=2.5
ViaDrill4=1
dPairWidth1=0.2
dPairGap1=0.25
dPairViaGap1=0.25
SilkLineWidth=0.15
SilkTextSizeV=1
SilkTextSizeH=1
SilkTextSizeThickness=0.15
SilkTextItalic=0
SilkTextUpright=1
CopperLineWidth=0.2
CopperTextSizeV=1.5
CopperTextSizeH=1.5
CopperTextThickness=0.3
CopperTextItalic=0
CopperTextUpright=1
EdgeCutLineWidth=0.15
CourtyardLineWidth=0.05
OthersLineWidth=0.15
OthersTextSizeV=1
OthersTextSizeH=1
OthersTextSizeThickness=0.15
OthersTextItalic=0
OthersTextUpright=1
SolderMaskClearance=0.2
SolderMaskMinWidth=0.25
SolderPasteClearance=0
SolderPasteRatio=-0
[pcbnew/Netclasses]
[pcbnew/Netclasses/1]
Name=power
Clearance=0.3
TrackWidth=1
ViaDiameter=2.5
ViaDrill=0.8
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
dPairViaGap=0.25
[pcbnew/Netclasses/2]
Name=wide
Clearance=0.5
TrackWidth=2
ViaDiameter=2.5
ViaDrill=0.8
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
dPairViaGap=0.25

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
(fp_lib_table
(lib (name modules)(type KiCad)(uri modules.pretty)(options "")(descr ""))
)

Binary file not shown.

View File

@@ -0,0 +1,31 @@
(module DB9-F (layer F.Cu) (tedit 546362FD)
(descr "Connecteur DB9 femelle couche")
(tags "CONN DB9")
(fp_text reference XP** (at -6.3 -5.3) (layer F.SilkS)
(effects (font (thickness 0.3048)))
)
(fp_text value DB9F (at 7.7 -5.1) (layer F.SilkS)
(effects (font (thickness 0.3048)))
)
(fp_line (start -16.129 2.286) (end 16.383 2.286) (layer F.SilkS) (width 0.3048))
(fp_line (start 16.383 2.286) (end 16.383 -9.494) (layer F.SilkS) (width 0.3048))
(fp_line (start 16.383 -9.494) (end -16.129 -9.494) (layer F.SilkS) (width 0.3048))
(fp_line (start -16.129 -9.494) (end -16.129 2.286) (layer F.SilkS) (width 0.3048))
(fp_line (start -9.017 -7.874) (end 9.271 -7.874) (layer F.SilkS) (width 0.3048))
(pad "" thru_hole circle (at 12.827 -1.27) (size 3.81 3.81) (drill 3.048) (layers *.Cu *.Mask F.SilkS))
(pad "" thru_hole circle (at -12.573 -1.27) (size 3.81 3.81) (drill 3.048) (layers *.Cu *.Mask F.SilkS))
(pad 1 thru_hole rect (at -5.461 1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(pad 2 thru_hole circle (at -2.667 1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(pad 3 thru_hole circle (at 0 1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(pad 4 thru_hole circle (at 2.794 1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(pad 5 thru_hole circle (at 5.588 1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(pad 6 thru_hole circle (at -4.064 -1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(pad 7 thru_hole circle (at -1.27 -1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(pad 8 thru_hole circle (at 1.397 -1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(pad 9 thru_hole circle (at 4.191 -1.27) (size 1.524 1.524) (drill 1.016) (layers *.Cu *.Mask F.SilkS))
(model conn_DBxx/db9_female_pin90deg.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)

View File

@@ -0,0 +1,45 @@
(module TO-220-3_Horizontal_TabDown (layer F.Cu) (tedit 5BEBD722)
(descr "TO-220-3, Horizontal, RM 2.54mm, see https://www.vishay.com/docs/66542/to-220-1.pdf")
(tags "TO-220-3 Horizontal RM 2.54mm")
(fp_text reference Q1 (at 2.54 -20.58) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value IRL3303 (at 2.54 2) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_circle (center 2.54 -16.66) (end 4.39 -16.66) (layer F.Fab) (width 0.1))
(fp_line (start -2.46 -13.06) (end -2.46 -19.46) (layer F.Fab) (width 0.1))
(fp_line (start -2.46 -19.46) (end 7.54 -19.46) (layer F.Fab) (width 0.1))
(fp_line (start 7.54 -19.46) (end 7.54 -13.06) (layer F.Fab) (width 0.1))
(fp_line (start 7.54 -13.06) (end -2.46 -13.06) (layer F.Fab) (width 0.1))
(fp_line (start -2.46 -3.81) (end -2.46 -13.06) (layer F.Fab) (width 0.1))
(fp_line (start -2.46 -13.06) (end 7.54 -13.06) (layer F.Fab) (width 0.1))
(fp_line (start 7.54 -13.06) (end 7.54 -3.81) (layer F.Fab) (width 0.1))
(fp_line (start 7.54 -3.81) (end -2.46 -3.81) (layer F.Fab) (width 0.1))
(fp_line (start 0 -3.81) (end 0 0) (layer F.Fab) (width 0.1))
(fp_line (start 2.54 -3.81) (end 2.54 0) (layer F.Fab) (width 0.1))
(fp_line (start 5.08 -3.81) (end 5.08 0) (layer F.Fab) (width 0.1))
(fp_line (start -2.58 -3.69) (end 7.66 -3.69) (layer F.SilkS) (width 0.12))
(fp_line (start -2.58 -19.58) (end 7.66 -19.58) (layer F.SilkS) (width 0.12))
(fp_line (start -2.58 -19.58) (end -2.58 -3.69) (layer F.SilkS) (width 0.12))
(fp_line (start 7.66 -19.58) (end 7.66 -3.69) (layer F.SilkS) (width 0.12))
(fp_line (start 0 -3.69) (end 0 -1.15) (layer F.SilkS) (width 0.12))
(fp_line (start 2.54 -3.69) (end 2.54 -1.15) (layer F.SilkS) (width 0.12))
(fp_line (start 5.08 -3.69) (end 5.08 -1.15) (layer F.SilkS) (width 0.12))
(fp_line (start -2.71 -19.71) (end -2.71 1.25) (layer F.CrtYd) (width 0.05))
(fp_line (start -2.71 1.25) (end 7.79 1.25) (layer F.CrtYd) (width 0.05))
(fp_line (start 7.79 1.25) (end 7.79 -19.71) (layer F.CrtYd) (width 0.05))
(fp_line (start 7.79 -19.71) (end -2.71 -19.71) (layer F.CrtYd) (width 0.05))
(fp_text user %R (at 2.54 -20.58) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(pad 2 thru_hole rect (at 2.54 -16.66) (size 12 7) (drill 3.5) (layers *.Cu *.Mask))
(pad 1 thru_hole rect (at 0 0) (size 1.905 2) (drill 1.1) (layers *.Cu *.Mask))
(pad 2 thru_hole oval (at 2.54 0) (size 1.905 2) (drill 1.1) (layers *.Cu *.Mask))
(pad 3 thru_hole oval (at 5.08 0) (size 1.905 2) (drill 1.1) (layers *.Cu *.Mask))
(model ${KISYS3DMOD}/Package_TO_SOT_THT.3dshapes/TO-220-3_Horizontal_TabDown.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)

View File

@@ -0,0 +1,14 @@
(module hole_3mm (layer F.Cu) (tedit 5BF13739)
(fp_text reference hole_3mm (at 0 -2.54) (layer F.SilkS) hide
(effects (font (size 1.5 1.5) (thickness 0.3)))
)
(fp_text value Val** (at 0 3.175) (layer F.SilkS) hide
(effects (font (size 1.5 1.5) (thickness 0.3)))
)
(fp_line (start 0 2.5) (end 0 1.5) (layer F.SilkS) (width 0.3))
(fp_line (start -2.5 0) (end -1.5 0) (layer F.SilkS) (width 0.3))
(fp_line (start 2.5 0) (end 1.5 0) (layer F.SilkS) (width 0.3))
(fp_line (start 0 -1.5) (end 0 -2.5) (layer F.SilkS) (width 0.3))
(fp_circle (center 0 0) (end 2.5 0) (layer F.SilkS) (width 0.3))
(pad "" np_thru_hole circle (at 0 0) (size 3 3) (drill 1) (layers *.Cu *.Mask))
)

View File

@@ -0,0 +1,3 @@
(sym_lib_table
(lib (name Chiller_control-rescue)(type Legacy)(uri ${KIPRJMOD}/Chiller_control-rescue.lib)(options "")(descr ""))
)

View File

@@ -0,0 +1,111 @@
/*
* main.c
*
* Copyright 2018 Edward V. Emelianoff <eddy@sao.ru, edward.emelianoff@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <string.h> // memcpy
#include "stm32f0.h"
#include "hardware.h"
#include "usart.h"
#include "adc.h"
#include "protocol.h"
#include "mainloop.h"
volatile uint32_t Tms = 0;
volatile uint16_t flow_rate = 0; // flow sensor rate
volatile uint16_t flow_cntr = 0; // flow sensor trigger counter
// this variable is global as user need to clear it in protocol.c
uint8_t crit_error = 0; // got critical error, need user acknowledgement
// Called when systick fires
void sys_tick_handler(void){
++Tms;
}
static void print_state(uint8_t state){
if(state == ST_OK){
put_string("OK\n");
return;
}
if(state & ST_CRITICAL) put_string("CRIT"); // add prefix "CRIT" for critical states
if(!(state & ST_OK)){ // something changed
if(state & ST_OFF) put_string("OFF");
else{
if(state & ST_FASTER) put_string("FASTER");
else put_string("SLOWER");
}
}
put_char('\n');
}
int main(void){
uint32_t lastTflow = 0; // last flow measurement time
chiller_state ost = {ST_OK, ST_OK, ST_OK, ST_OK}, *st; // old & current chiller states
char *txt;
hw_setup();
SysTick_Config(6000, 1);
SEND_BLK("Chiller controller v0.1\n");
if(RCC->CSR & RCC_CSR_IWDGRSTF){ // watchdog reset occured
SEND_BLK("WDGRESET=1");
}
if(RCC->CSR & RCC_CSR_SFTRSTF){ // software reset occured
SEND_BLK("SOFTRESET=1");
}
RCC->CSR |= RCC_CSR_RMVF; // remove reset flags
while (1){
IWDG->KR = IWDG_REFRESH;
if(Tms - lastTflow > FLOW_RATE_MS){ // onse per one second check flow sensor counter
lastTflow = Tms;
flow_rate = flow_cntr;
flow_cntr = 0;
if(crit_error) SEND("CRITICAL=1\n");
}
if(usart1_getline(&txt)){ // usart1 received command, process it
txt = process_command(txt);
}else txt = NULL;
if(txt){ // text waits for sending
while(ALL_OK != usart1_send(txt, 0)){
IWDG->KR = IWDG_REFRESH;
}
}
IWDG->KR = IWDG_REFRESH;
//usart1_sendbuf();
st = mainloop();
// process state values
if(st->common_state != ST_OK){
if(st->common_state & ST_CRITICAL) crit_error = 1;
put_string("STATE=");
print_state(st->common_state);
}
// other states
if(st->pump_state != ST_OK){
put_string("PUMP=");
print_state(st->pump_state);
}
if(st->cooler_state != ST_OK){
put_string("COOLER=");
print_state(st->cooler_state);
}
if(st->heater_state != ST_OK){
put_string("HEATER=");
print_state(st->heater_state);
}
memcpy(&ost, st, sizeof(chiller_state));
usart1_sendbuf();
}
}

View File

@@ -0,0 +1,319 @@
/*
* This file is part of the Chiller project.
* Copyright 2019 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mainloop.h"
#include "hardware.h"
#include "adc.h"
int16_t Tset = 200; // temperature setpoint
int16_t NTCval[4] = {0,};
// common status for all functions from this file; pointer to this variable return @mainloop
static chiller_state retstatus = {
.common_state = ST_OK,
.heater_state = ST_OK,
.cooler_state = ST_OK,
.pump_state = ST_OK
};
/* error bit fields: */
// chiller_error==0 - no errors
#define CE_NOERROR (0)
// heater error (overheating)
#define CE_HEATER (1<<0)
// output was too hot
#define CE_OUTHOT (1<<1)
// output was too cool
#define CE_OUTCOOL (1<<2)
// no flow sensor pulses detected
#define CE_NOFLOW (1<<3)
// error code explaining why alarm is working
static uint8_t chiller_error;
static inline void increase_pump_pwm(){
uint16_t pwm = GET_PUMP_PWM();
if(pwm < 246){
SET_PUMP_PWM(pwm+10);
retstatus.pump_state = ST_FASTER;
}
}
static inline void decrease_pump_pwm(){
uint16_t pwm = GET_PUMP_PWM();
if(pwm > MIN_PUMP_PWM+9){
SET_PUMP_PWM(pwm-10);
retstatus.pump_state = 0; // "ST_SLOWER"
}
}
/**
* @brief binsrch - binary search for new good value
* @param oldval - previuos value
* @param curval - current value
* @param dir - direction (1 - increase, 0 - decrease)
* @return new value
*/
static inline uint16_t binsrch(uint16_t oldval, uint16_t curval, uint8_t dir){
if(oldval == curval){
if(dir) oldval = 256;
else oldval = 0;
}else{
if(dir){ // increase
if(oldval == 0) oldval = 256;
else if(oldval < curval){
oldval = 2*curval - oldval;
}
}else{ // decrease
if(curval == 0) oldval = 0;
else if(oldval > curval){
oldval = 2*curval - oldval;
}
}
}
oldval = (oldval + curval) / 2;
if(oldval > 255) oldval = 0;
return oldval;
}
// change PWM according to dir (1->up, 0->down)
static void change_heater_pwm(uint8_t dir){
static uint16_t oldpwm = 0;
uint16_t pwm = binsrch(oldpwm, GET_HEATER_PWM(), dir);
if(pwm != GET_HEATER_PWM()){
oldpwm = GET_HEATER_PWM();
SET_HEATER_PWM(pwm);
if(dir){ // up
retstatus.heater_state = ST_FASTER;
}else{ // down
if(pwm == 0) retstatus.heater_state = ST_OFF;
else retstatus.heater_state = 0; // "ST_SLOWER"
}
}
}
static void change_cooler_pwm(uint8_t dir){
uint16_t pwm = GET_COOLER_PWM();
if(dir){ // up
if(pwm < 224) SET_COOLER_PWM(pwm + 32);
else SET_COOLER_PWM(255);
if(pwm != GET_COOLER_PWM())
retstatus.cooler_state = ST_FASTER;
}else{ // down
if(pwm > MIN_COOLER_PWM + 31) SET_COOLER_PWM(pwm - 32);
else SET_COOLER_PWM(0);
if(pwm != GET_COOLER_PWM())
retstatus.cooler_state = GET_COOLER_PWM() ? 0 : ST_OFF; // "ST_SLOWER" / ST_OFF
}
}
/**
* @brief get_critical - check device for critical errors
* @return 1 if critical error occured
*/
static inline uint8_t get_critical(){
uint8_t ret = 0;
// critical state: heater can burn out!
// turn off heater & make signal
if(HEATER_TEMPERATURE > MAX_HEATER_T){
// change heater state to CRIT_HOFF
retstatus.heater_state = ST_CRITICAL;
if(GET_HEATER_PWM()){
SET_HEATER_PWM(0);
retstatus.heater_state |= ST_OFF;
}
chiller_error |= CE_HEATER;
ret = 1;
}
// very hot output: turn off heater, turn on cooler & make signal
if(OUTPUT_TEMPERATURE > MAX_OUTPUT_T){
// change chiller state to CRIT_HOT
retstatus.common_state = ST_CRITICAL;
if(GET_HEATER_PWM()){
SET_HEATER_PWM(0);
retstatus.heater_state = ST_OFF;
}
if(GET_COOLER_PWM() < 255){
SET_COOLER_PWM(255);
retstatus.cooler_state = ST_FASTER;
}
// if water @input is also too hot, turn pump to max speed
if(INPUT_TEMPERATURE > MAX_OUTPUT_T){
increase_pump_pwm();
}
chiller_error |= CE_OUTHOT;
ret = 1;
}
// very cool output: turn on heater (max power), turn off cooler & make signal
if(OUTPUT_TEMPERATURE < MIN_OUTPUT_T){
retstatus.common_state = ST_CRITICAL|ST_FASTER;
if(GET_HEATER_PWM() < 255){
SET_HEATER_PWM(255);
retstatus.heater_state = ST_FASTER;
}
if(GET_COOLER_PWM()){
SET_COOLER_PWM(0);
retstatus.cooler_state = ST_OFF;
}
chiller_error |= CE_OUTCOOL;
ret = 1;
}
// check flow rate & pump working
if(GET_PUMP_PWM() >= MIN_PUMP_PWM){ // pump working
if(flow_rate < MIN_FLOW_RATE){ // check pump
// change chiller state to CRIT_NOFLOW
retstatus.common_state = ST_CRITICAL|ST_OK;
// increase pump speed
//increase_pump_pwm();
retstatus.pump_state = ST_CRITICAL;
chiller_error |= CE_NOFLOW;
ret = 1;
}
}else{
// turn ON pump if PWM < minimal
// (pump should be never off!)
SET_PUMP_PWM(MIN_PUMP_PWM);
retstatus.pump_state = ST_FASTER;
}
return ret;
}
/**
* @brief check_alarm - check device status and turn off alarm if it is on
*/
static inline void check_alarm(){
if(!ALARM_STATE()) return;
// check errors & turn alarm OFF if there's no critical situations
if(chiller_error == CE_NOERROR){
// turn off alarm if there's no more errors
ALARM_OFF();
}else{
if(chiller_error & CE_HEATER){ // clear CE_HEATER if heater T is normal
if(HEATER_TEMPERATURE < NORMAL_HEATER_T){
chiller_error &= ~CE_HEATER;
}
}
if(chiller_error & CE_OUTHOT){ // clear CE_OUTHOT if Tout is normal
if(OUTPUT_TEMPERATURE < OUTPUT_T_H){
chiller_error &= ~CE_OUTHOT;
}
}
if(chiller_error & CE_OUTCOOL){ // clear CE_OUTCOOL if Tout is normal
if(OUTPUT_TEMPERATURE > OUTPUT_T_L){
chiller_error &= ~CE_OUTCOOL;
}
}
if(chiller_error & CE_NOFLOW){ // clear CE_NOFLOW if there's flow pulses
if(flow_rate > NORMAL_FLOW_RATE){
chiller_error &= ~CE_NOFLOW;
}
}
}
}
static inline void checkOutT(){
// check that T is between limits
int8_t hc = 0; // need heating or cooling?
if(OUTPUT_TEMPERATURE > Tset + TEMP_TOLERANCE) hc = -1; // need cooling
else if(OUTPUT_TEMPERATURE < Tset - TEMP_TOLERANCE) hc = 1; // need heating
if(hc){// out of limits -> check
if(hc > 0){ // need heating: turn off cooler & turn on heater
if(GET_COOLER_PWM()){
SET_COOLER_PWM(0);
retstatus.cooler_state = ST_OFF;
}
if(GET_HEATER_PWM() < 255){
SET_HEATER_PWM(255);
retstatus.heater_state = ST_FASTER;
}else{
// bad situation: need MORE heating!
}
}else{ // need cooling: turn off heater & turn on cooler
if(GET_HEATER_PWM()){
SET_HEATER_PWM(0);
retstatus.heater_state = ST_OFF;
}
if(GET_COOLER_PWM() < 255){
SET_COOLER_PWM(255);
retstatus.cooler_state = ST_FASTER;
}else{
// bad situation: need MORE cooling!
}
}
}else{ // T inside borders -> correct heating/cooling speed
// Tout > Tset -> heater PWM up & cooler PWM down
// else -> vice versa
uint8_t ht = 2; // don't need heater/cooler change
if(OUTPUT_TEMPERATURE < Tset - DT_TOLERANCE) ht = 1; // need heating
else if(OUTPUT_TEMPERATURE > Tset + DT_TOLERANCE) ht = 0; // need cooling
if(ht != 2){
change_heater_pwm(ht);
change_cooler_pwm(!ht);
}
}
// if all OK, make pump slower
if(retstatus.pump_state == ST_OK){
decrease_pump_pwm();
}
}
/**
* @brief mainloop - the main chiller loop
* by timer check current states & change them
*/
chiller_state *mainloop(){
static uint32_t lastTmeas = 0xffff; // Temperatures measurement time
static uint32_t lastTchk = 0xffff; // last state checking time
retstatus.common_state = ST_OK;
retstatus.heater_state = ST_OK;
retstatus.cooler_state = ST_OK;
retstatus.pump_state = ST_OK;
// 1. Get temperatures and check critical situations
if(Tms - lastTmeas < TMEASURE_MS) return &retstatus;
lastTmeas = Tms;
for(int i = 0; i < 4; ++i) // refresh NTC values
NTCval[i] = getNTC(i);
uint8_t alrm = get_critical();
// check cooler
if(GET_COOLER_PWM() > MIN_COOLER_PWM){ // cooler working
// air temperature is very hot - cooler useless
if(AIR_TEMPERATURE > OUTPUT_TEMPERATURE + TEMP_TOLERANCE){
// change cooler state to OFF
if(GET_COOLER_PWM()){
SET_COOLER_PWM(0);
retstatus.cooler_state = ST_OFF;
}
}
}else{
if(GET_COOLER_PWM()){
SET_COOLER_PWM(0);
retstatus.cooler_state = ST_OFF;
}
}
// check alarm
if(alrm){
ALARM_ON();
return &retstatus;
}
// there wasn't critical cases in this iteration, go further
check_alarm();
// Now check thermal data and decide what to do
if(Tms - lastTchk < TCHECK_MS) return &retstatus;
lastTchk = Tms;
checkOutT();
return &retstatus;
}

View File

@@ -0,0 +1,55 @@
/*
* This file is part of the Chiller project.
* Copyright 2019 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stm32f0.h"
// temperature setpoint
extern int16_t Tset;
// temperatures of NTC
extern int16_t NTCval[4];
// meaning of each array member: in/out, heater and air
#define TI_IDX (0)
#define TO_IDX (1)
#define TH_IDX (2)
#define TA_IDX (3)
#define INPUT_TEMPERATURE NTCval[TI_IDX]
#define OUTPUT_TEMPERATURE NTCval[TO_IDX]
#define HEATER_TEMPERATURE NTCval[TH_IDX]
#define AIR_TEMPERATURE NTCval[TA_IDX]
/* status bits */
// ==1 if no changes
#define ST_OK (1<<0)
// (ST_OK=0) == 1 if moving faster (or hotter), 0 if slower (or cooler)
#define ST_FASTER (1<<1)
// turn OFF
#define ST_OFF (1<<2)
// critical error
#define ST_CRITICAL (1<<7)
/* chiller status codes */
typedef struct{
uint8_t common_state; // common state != ST_OK if some other states changed
uint8_t heater_state;
uint8_t cooler_state;
uint8_t pump_state;
} chiller_state;
chiller_state *mainloop();

View File

@@ -0,0 +1,189 @@
/*
* This file is part of the Chiller project.
* Copyright 2018 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "hardware.h"
#include "protocol.h"
#include "usart.h"
#include "adc.h"
#include "mainloop.h"
extern uint8_t crit_error;
#ifdef EBUG
/**
* @brief debugging_proc - debugging functions
* @param command - rest of cmd
*/
static void debugging_proc(const char *command){
const char *ptr = command;
int i;
switch(*ptr++){
case 'w':
usart1_send("Test watchdog", 0);
while(1){nop();}
break;
case 'A': // raw ADC values depending on next symbol
i = *ptr++ - '0';
if(i < 0 || i > NUMBER_OF_ADC_CHANNELS){
usart1_send("Wrong channel nuber!", 0);
return;
}
put_string("ADC value: ");
put_uint(getADCval(i));
put_string(", ");
usart1_sendbuf();
break;
case 'F':
put_string("PB_IDR, flow_cntr: ");
put_uint(GPIOB->IDR);
put_string(", ");
put_uint(flow_cntr);
usart1_sendbuf();
break;
case 'T': // all raw T values
for(i = 0; i < 4; ++i){
put_uint(getADCval(i));
put_char('\t');
}
usart1_sendbuf();
break;
default:
break;
}
}
#endif
/**
* @brief get_ntc - show value of ith NTC temperature
* @param str (i) - user string, first char should be '0'..'3'
*/
static void get_ntc(const char *str){
uint8_t N = *str - '0';
if(N > 3) return;
put_string("NTC");
put_char(*str);
put_char('=');
put_int(NTCval[N]);
}
#define STR(a) XSTR(a)
#define XSTR(a) #a
/**
* @brief process_command - command parser
* @param command - command text (all inside [] without spaces)
* @return text to send over terminal or NULL
*/
char *process_command(const char *command){
const char *ptr = command;
char *ret = NULL;
int32_t N;
usart1_sendbuf(); // send buffer (if it is already filled)
switch(*ptr++){
case '?': // help
SEND_BLK(
"Ax - alarm on(1)/off(0)\n"
"Cx - cooler PWM\n"
"CLR- clear critical error\n"
"F - get flow sensor rate for " FLOWRATESTR "s (5880 pulses per liter)\n"
"Hx - heater PWM\n"
"L - check water level\n"
"Px - pump PWM\n"
"R - reset\n"
"Sx - change temperature setpoint\n"
"Tx - get NTC[x] temperature\n"
"t - get MCU temperature (approx.)\n"
"V - get Vdd"
);
#ifdef EBUG
SEND_BLK("d -> goto debug:\n"
"\tAx - get raw ADCx value\n"
"\tF - get flow_cntr\n"
"\tT - show raw T values\n"
"\tw - test watchdog"
);
#endif
break;
case 'A': // turn alarm on/off
if(*ptr == '1') ALARM_ON();
else if(*ptr == '0') ALARM_OFF();
put_string("ALRM=");
put_char(ALARM_STATE() + '0');
break;
case 'C': // "CLR" - clear critical error flag, 'C' - cooler PWM - TIM14CH1
if(ptr[0] == 'L' && ptr[1] == 'R' && ptr[2] == 0){
crit_error = 0;
return "CLRERR=1\n";
}
if(getnum(ptr, &N) && N > -1 && N < 256){
SET_COOLER_PWM(N);
}
put_string("COOLERPWM=");
put_int(GET_COOLER_PWM());
break;
case 'F':
put_string("FLOWRATE=");
put_uint(flow_rate);
break;
case 'H': // heater PWM - TIM16CH1
if(getnum(ptr, &N) && N > -1 && N < 256){
SET_HEATER_PWM(N);
}
put_string("HEATERPWM=");
put_int(GET_HEATER_PWM());
break;
case 'L': // water level
put_string("WATERLEVEL=");
put_char('0' + pin_read(GPIOF, 1));
break;
case 'P': // pump PWM - TIM17CH1
if(getnum(ptr, &N) && N > -1 && N < 256){
SET_PUMP_PWM(N);
}
put_string("PUMPPWM=");
put_int(GET_PUMP_PWM());
break;
case 'R': // reset MCU
NVIC_SystemReset();
break;
case 'S':
if(getnum(ptr, &N) && N > OUTPUT_T_L + TEMP_TOLERANCE && N < OUTPUT_T_H - TEMP_TOLERANCE){
Tset = N;
}
put_string("TSET=");
put_int(Tset);
break;
case 'T': // get temperature of NTC(x)
get_ntc(ptr);
break;
case 't': // get mcu T
put_string("MCUTEMP10=");
put_int(getMCUtemp());
break;
case 'V': // get Vdd
put_string("VDD100=");
put_uint(getVdd());
break;
#ifdef EBUG
case 'd':
debugging_proc(ptr);
return NULL;
break;
#endif
}
usart1_sendbuf();
return ret;
}

View File

@@ -0,0 +1,24 @@
/*
* This file is part of the Chiller project.
* Copyright 2018 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PROTOCOL_C
#define PROTOCOL_C
#include "stm32f0.h"
char *process_command(const char *command);
#endif // PROTOCOL_C

View File

@@ -0,0 +1,294 @@
/*
* usart.c
*
* Copyright 2018 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include "usart.h"
#include <string.h> // memcpy
extern volatile uint32_t Tms;
static int datalen[2] = {0,0}; // received data line length (including '\n')
uint8_t bufovr = 0; // input buffer overfull
static uint8_t linerdy = 0 // received data ready
,dlen = 0 // length of data in current buffer
,txrdy = 1 // transmission done
;
static int rbufno = 0; // current rbuf number
static char rbuf[2][UARTBUFSZ+1], tbuf[UARTBUFSZ]; // receive & transmit buffers
static char *recvdata = NULL;
static char trbuf[UARTBUFSZ+1]; // auxiliary buffer for data transmission
static int trbufidx = 0;
int put_char(char c){
if(trbufidx >= UARTBUFSZ - 1){
if(ALL_OK != usart1_sendbuf()) return 1;
}
trbuf[trbufidx++] = c;
return 0;
}
// write zero-terminated string
int put_string(const char *str){
while(*str){
if(put_char(*str++)) return 1; //error! shouldn't be!!!
}
return 0; // all OK
}
/**
* Fill trbuf with integer value
* @param N - integer value
* @return 1 if buffer overflow; oterwise return 0
*/
int put_int(int32_t N){
if(N < 0){
if(put_char('-')) return 1;
N = -N;
}
return put_uint((uint32_t) N);
}
int put_uint(uint32_t N){
char buf[10];
int L = 0;
if(N){
while(N){
buf[L++] = N % 10 + '0';
N /= 10;
}
while(L--) if(put_char(buf[L])) return 1;
}else if(put_char('0')) return 1;
return 0;
}
/**
* @brief usart1_sendbuf - send temporary transmission buffer (trbuf) over USART
* @return Tx status
*/
TXstatus usart1_sendbuf(){
int len = trbufidx;
trbufidx = 0;
if(len == 0) return ALL_OK;
else if(len > UARTBUFSZ) len = UARTBUFSZ;
return usart1_send(trbuf, len);
}
void USART1_config(){
/* Enable the peripheral clock of GPIOA */
RCC->AHBENR |= RCC_AHBENR_GPIOAEN;
/* GPIO configuration for USART1 signals */
/* (1) Select AF mode (10) on PA9 and PA10 */
/* (2) AF1 for USART1 signals */
GPIOA->MODER = (GPIOA->MODER & ~(GPIO_MODER_MODER9|GPIO_MODER_MODER10))\
| (GPIO_MODER_MODER9_1 | GPIO_MODER_MODER10_1); /* (1) */
GPIOA->AFR[1] = (GPIOA->AFR[1] &~ (GPIO_AFRH_AFRH1 | GPIO_AFRH_AFRH2))\
| (1 << (1 * 4)) | (1 << (2 * 4)); /* (2) */
/* Enable the peripheral clock USART1 */
RCC->APB2ENR |= RCC_APB2ENR_USART1EN;
/* Configure USART1 */
/* (1) oversampling by 16, 115200 baud */
/* (2) 8 data bit, 1 start bit, 1 stop bit, no parity */
USART1->BRR = 480000 / 1152; /* (1) */
USART1->CR1 = USART_CR1_TE | USART_CR1_RE | USART_CR1_UE; /* (2) */
/* polling idle frame Transmission */
while(!(USART1->ISR & USART_ISR_TC)){}
USART1->ICR |= USART_ICR_TCCF; /* clear TC flag */
USART1->CR1 |= USART_CR1_RXNEIE; /* enable TC, TXE & RXNE interrupt */
RCC->AHBENR |= RCC_AHBENR_DMA1EN;
DMA1_Channel2->CPAR = (uint32_t) &(USART1->TDR); // periph
DMA1_Channel2->CMAR = (uint32_t) tbuf; // mem
DMA1_Channel2->CCR |= DMA_CCR_MINC | DMA_CCR_DIR | DMA_CCR_TCIE; // 8bit, mem++, mem->per, transcompl irq
USART1->CR3 = USART_CR3_DMAT;
NVIC_SetPriority(DMA1_Channel2_3_IRQn, 3);
NVIC_EnableIRQ(DMA1_Channel2_3_IRQn);
/* Configure IT */
/* (3) Set priority for USART1_IRQn */
/* (4) Enable USART1_IRQn */
NVIC_SetPriority(USART1_IRQn, 0); /* (3) */
NVIC_EnableIRQ(USART1_IRQn); /* (4) */
}
void usart1_isr(){
static uint8_t timeout = 1 // == 0 for human interface without timeout
,nctr = 0 // counter of '#' received
,incmd = 0 // ==1 - inside command
;
static uint32_t tmout = 0;
if(USART1->ISR & USART_ISR_RXNE){ // RX not emty - receive next char
// read RDR clears flag
uint8_t rb = USART1->RDR;
if(timeout && rb == '#'){ // chek '#' without timeout
if(++nctr == 4){ // "####" received - turn off timeout
timeout = 0;
nctr = 0;
datalen[rbufno] = 0; // reset all incoming data
incmd = 0;
return;
}
}else nctr = 0;
if(!incmd){
if(rb == '['){ // open command or reset previoud input
datalen[rbufno] = 0;
incmd = 1;
}
return;
}
if(timeout){ // check timeout only inside commands
if(tmout && Tms >= tmout){ // set overflow flag
bufovr = 1;
datalen[rbufno] = 0;
}else{
tmout = Tms + TIMEOUT_MS;
if(!tmout) tmout = 1; // prevent 0
}
}
switch(rb){
case '[':
datalen[rbufno] = 0;
tmout = 0;
break;
case ']': // close command - line ready!
dlen = datalen[rbufno];
if(dlen){
linerdy = 1;
incmd = 0;
recvdata = rbuf[rbufno];
rbuf[rbufno][dlen] = 0;
rbufno = !rbufno;
datalen[rbufno] = 0;
}
tmout = 0;
break;
case '\r':
case '\n':
case ' ':
case '\t':
return;
break;
default:
break;
}
if(datalen[rbufno] < UARTBUFSZ){ // put next char into buf
rbuf[rbufno][datalen[rbufno]++] = rb;
}else{ // buffer overrun
bufovr = 1;
datalen[rbufno] = 0;
incmd = 0;
tmout = 0;
}
}
}
void dma1_channel2_3_isr(){
if(DMA1->ISR & DMA_ISR_TCIF2){ // Tx
DMA1->IFCR |= DMA_IFCR_CTCIF2; // clear TC flag
txrdy = 1;
}
}
/**
* return length of received data (without trailing zero)
*/
int usart1_getline(char **line){
if(!linerdy) return 0;
linerdy = 0;
if(bufovr){
bufovr = 0;
return 0;
}
*line = recvdata;
return dlen;
}
/**
* @brief usart1_send send buffer `str` adding trailing '\n'
* @param str - string to send (without '\n' at end)
* @param len - its length or 0 to auto count
* @return
*/
TXstatus usart1_send(const char *str, int len){
if(!txrdy) return LINE_BUSY;
if(len > UARTBUFSZ - 1) return STR_TOO_LONG;
txrdy = 0;
if(len == 0){
const char *ptr = str;
while(*ptr++) ++len;
}
if(len == 0) return ALL_OK;
DMA1_Channel2->CCR &= ~DMA_CCR_EN;
memcpy(tbuf, str, len);
tbuf[len++] = '\n';
DMA1_Channel2->CNDTR = len;
DMA1_Channel2->CCR |= DMA_CCR_EN; // start transmission
return ALL_OK;
}
TXstatus usart1_send_blocking(const char *str, int len){
if(!txrdy) return LINE_BUSY;
if(len == 0){
const char *ptr = str;
while(*ptr++) ++len;
}
if(len == 0) return ALL_OK;
for(int i = 0; i < len; ++i){
USART1->TDR = *str++;
while(!(USART1->ISR & USART_ISR_TXE));
}
USART1->TDR = '\n';
while(!(USART1->ISR & USART_ISR_TC));
txrdy = 1;
return ALL_OK;
}
// read `buf` and get first integer `N` in it
// @return pointer to first non-number if all OK or NULL if first symbol isn't a space or number
char *getnum(const char *buf, int32_t *N){
char c;
int positive = -1;
int32_t val = 0;
//usart1_send_blocking(buf, 0);
while((c = *buf++)){
if(c == '\t' || c == ' '){
if(positive < 0) continue; // beginning spaces
else break; // spaces after number
}
if(c == '-'){
if(positive < 0){
positive = 0;
continue;
}else break; // there already was `-` or number
}
if(c < '0' || c > '9') break;
if(positive < 0) positive = 1;
val = val * 10 + (int32_t)(c - '0');
}
if(positive != -1){
if(positive == 0){
if(val == 0) return NULL; // single '-'
val = -val;
}
*N = val;
}else return NULL;
/* usart1_sendbuf();
put_uint(val);
put_char('\n');*/
return (char*)buf-1;
}

View File

@@ -0,0 +1,59 @@
/*
* usart.h
*
* Copyright 2018 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#pragma once
#ifndef __USART_H__
#define __USART_H__
#include "stm32f0.h"
// input and output buffers size
#define UARTBUFSZ (64)
// timeout between data bytes
#define TIMEOUT_MS (100)
typedef enum{
ALL_OK,
LINE_BUSY,
STR_TOO_LONG
} TXstatus;
#define usart1ovr() (bufovr)
// send constant string
#define SEND_BLK(x) do{while(LINE_BUSY == usart1_send_blocking(x, sizeof(x)-1));}while(0)
#define SEND(x) do{while(LINE_BUSY == usart1_send(x, sizeof(x)-1));}while(0)
extern uint8_t bufovr;
void USART1_config();
int usart1_getline(char **line);
TXstatus usart1_send(const char *str, int len);
TXstatus usart1_send_blocking(const char *str, int len);
TXstatus usart1_sendbuf();
int put_char(char c);
int put_string(const char *str);
int put_int(int32_t N);
int put_uint(uint32_t N);
char *getnum(const char *buf, int32_t *N);
#endif // __USART_H__