From: Pat Thoyts Date: Sat, 2 Jan 2016 01:29:55 +0000 (+0000) Subject: Included GEDA gschem schematic for the fan control board. X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=f9897a80dd7825e7e5a73e7aa32f6fc39824954f;p=avr%2Ffan_control.git Included GEDA gschem schematic for the fan control board. --- diff --git a/.gitignore b/.gitignore index 2859f3f..013dbba 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,9 @@ *.o *.elf *.hex - +*.net +*.bom +*.cmd +*.bak +PCB.*.backup +*.new.pcb diff --git a/Makefile b/Makefile index a37ca5d..be1996d 100755 --- a/Makefile +++ b/Makefile @@ -12,8 +12,12 @@ OBJS = $(CSRCS:.c=.o) CC := avr-gcc LD := avr-gcc OBJCOPY := avr-objcopy +ifeq ($(uname_S),Linux) +RM := rm -f +else RM := del >NUL -CFLAGS :=-Wall -Wmissing-prototypes -Wcast-align -Wshadow \ +endif +CFLAGS :=-Wall -Wcast-align -Wshadow \ -std=gnu99 -fshort-enums -pedantic-errors -Os -mcall-prologues \ -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) LDFLAGS := -Wall -mmcu=$(DEVICE)# -Wl,-v @@ -68,3 +72,30 @@ clean: # For 8MHz internal: -U hfuse:w:0xd7:m -U lfuse:w:0xe2:m fuse: $(AVRDUDE) -U hfuse:w:0xd7:m -U lfuse:w:0xe2:m + +# GEDA targets + +GAFPROJECT := $(PROJECT).gafprj +GAFNAME := $(shell sed -n 's/^output-name //p' $(GAFPROJECT)) +SCHEMAS := $(shell sed -n 's/^schematics //p' $(GAFPROJECT)) + +net: netlist +netlist: $(GAFNAME).net +bom: $(GAFNAME).bom +gerber: $(GAFNAME).zip + +$(GAFNAME).net: $(SCHEMAS) + @gsch2pcb --use-files $(GAFPROJECT) + +$(GAFNAME).bom: $(SCHEMAS) attribs + @gnetlist -g bom -o $@ $(SCHEMAS) + +drc: $(SCHEMAS) + @gnetlist -g drc2 -o /dev/stdout $^ + +$(GAFNAME).zip: $(GAFNAME).pcb + rm -f gerber/* $@ + pcb -x gerber --gerberfile "gerber/$(GAFNAME)" --name-style hackvana $(GAFNAME).pcb + zip -j $@ gerber/* + +.PHONY: drc bom net netlist gerber diff --git a/attribs b/attribs new file mode 100644 index 0000000..5912c6e --- /dev/null +++ b/attribs @@ -0,0 +1,9 @@ +device +value +footprint +manufacturer +manufacturer_part_number +vendor +vendor_part_number +description + diff --git a/fan_control.gafprj b/fan_control.gafprj new file mode 100644 index 0000000..a7b30d3 --- /dev/null +++ b/fan_control.gafprj @@ -0,0 +1,8 @@ +schematics fan_control.sch +output-name fan_control +elements-dir ~/gaf/libraries/luciani.org +elements-dir ~/gaf/libraries/patthoyts/footprints +elements-dir ~/gaf/libraries/knaak/footprints +;;elements-dir /usr/share/pcb/newlib +;;elements-dir /usr/share/pcb/pcblib-newlib + diff --git a/fan_control.sch b/fan_control.sch new file mode 100644 index 0000000..6b59721 --- /dev/null +++ b/fan_control.sch @@ -0,0 +1,404 @@ +v 20140308 2 +C 40900 38200 0 0 0 title-A3-2.sym +{ +T 53200 39500 15 30 1 1 0 4 1 +Title=Fan Control +T 52300 38500 15 16 1 1 0 4 1 +filename=filename.sch +T 56750 39700 15 16 1 1 0 4 1 +revision=1 +T 56950 38300 15 16 1 1 0 6 1 +page=1 +T 57100 38300 15 16 1 1 0 0 1 +number_of_pages=1 +T 56750 39050 15 12 1 1 0 4 1 +date=1/1/2016 +T 55350 38650 15 16 1 1 0 4 1 +author=Pat Thoyts +T 41100 50500 15 8 0 0 0 0 1 +symversion=1.0 +} +C 43900 47400 1 0 0 78L05.sym +{ +T 44200 48600 5 10 1 1 0 0 1 +value=78L05 +T 44200 48800 5 10 1 1 0 0 1 +refdes=U1 +T 44200 48400 5 8 1 1 0 0 1 +footprint=SO8 +} +C 41400 47700 1 0 0 pwrjack-1.sym +{ +T 41500 48200 5 10 0 0 0 0 1 +device=PWRJACK +T 41400 47500 5 10 1 1 0 0 1 +refdes=CONN1 +T 41400 47300 5 10 1 1 0 0 1 +value=POWER IN +T 41400 47100 5 10 0 1 0 0 1 +footprint=pwrjack21.fp +} +C 42800 48000 1 270 0 capacitor-4.sym +{ +T 43900 47800 5 10 0 0 270 0 1 +device=POLARIZED_CAPACITOR +T 43300 47600 5 10 1 1 0 0 1 +refdes=C1 +T 43500 47800 5 10 0 0 270 0 1 +symversion=0.1 +T 43300 47400 5 10 1 1 0 0 1 +value=4.7uF +T 43300 47200 5 10 0 1 0 0 1 +footprint=EIA3216 +} +C 45800 48000 1 270 0 capacitor-4.sym +{ +T 46900 47800 5 10 0 0 270 0 1 +device=POLARIZED_CAPACITOR +T 46300 47600 5 10 1 1 0 0 1 +refdes=C2 +T 46500 47800 5 10 0 0 270 0 1 +symversion=0.1 +T 46300 47400 5 10 1 1 0 0 1 +value=1uF +T 45800 48000 5 10 0 1 0 0 1 +footprint=EIA3216 +} +C 46700 48000 1 270 0 capacitor-1.sym +{ +T 47400 47800 5 10 0 0 270 0 1 +device=CAPACITOR +T 47200 47600 5 10 1 1 0 0 1 +refdes=C3 +T 47600 47800 5 10 0 0 270 0 1 +symversion=0.1 +T 47200 47400 5 10 1 1 0 0 1 +value=100nF +T 46700 48000 5 10 0 1 0 0 1 +footprint=0805 +} +C 41200 43900 1 0 0 con_1x2.sym +{ +T 41200 44300 5 10 1 1 0 0 1 +refdes=CONN2 +T 41200 44100 5 10 1 1 0 0 1 +value=FAN +T 41200 43900 5 8 1 1 0 0 1 +footprint=1x2PIN +T 41200 46100 5 8 0 0 0 0 1 +symversion=2.0 +} +C 43100 42900 1 0 1 nmosfet_power.sym +{ +T 42400 43500 5 10 1 1 0 6 1 +refdes=Q1 +T 41600 43300 5 10 1 1 0 0 1 +value=2N7000 +T 42400 43100 5 8 1 1 0 6 1 +footprint=TO92 +T 42800 44900 5 8 0 0 0 6 1 +symversion=1.1 +} +C 43300 42200 1 0 0 res_vert.sym +{ +T 43400 45000 5 8 0 0 0 0 1 +device=resistor +T 43600 42400 5 8 1 1 0 0 1 +footprint=0805 +T 43600 42800 5 10 1 1 0 0 1 +refdes=R1 +T 43600 42600 5 10 1 1 0 0 1 +value=1M +T 43400 44200 5 8 0 0 0 0 1 +symversion=1.0 +} +C 42300 44300 1 0 0 diode_vert.sym +{ +T 42850 44900 5 10 1 1 0 0 1 +refdes=D1 +T 42850 44700 5 10 1 1 0 0 1 +value=CD4148 +T 42850 44500 5 8 1 1 0 0 1 +footprint=dio_0805 +T 42500 46300 5 8 0 0 0 0 1 +symversion=1.0 +} +N 42300 47800 42500 47800 4 +N 42500 46900 42500 47800 4 +N 46900 47100 46900 46900 4 +N 46900 46900 42500 46900 4 +N 44700 47400 44700 46900 4 +N 46000 47100 46000 46900 4 +N 43000 47100 43000 46900 4 +N 42300 48000 43900 48000 4 +N 45500 48000 46900 48000 4 +C 42500 48300 1 0 0 12V-plus-1.sym +C 43900 46600 1 0 0 gnd-1.sym +N 42700 48300 42700 48000 4 +N 46400 48300 46400 48000 4 +N 41700 45100 42600 45100 4 +C 42000 45700 1 0 0 12V-plus-1.sym +N 42200 45700 42200 45100 4 +N 42600 43700 42600 44600 4 +C 42500 41900 1 0 0 gnd-1.sym +N 43100 43100 44000 43100 4 +N 43400 43100 43400 43000 4 +N 43400 42400 43400 42200 4 +N 42600 42200 43400 42200 4 +N 41700 44700 42100 44700 4 +N 42100 44700 42100 44400 4 +N 42600 42900 42600 42200 4 +N 42100 44400 42600 44400 4 +C 45400 43000 1 0 1 input-2.sym +{ +T 45400 43200 5 10 0 0 0 6 1 +net=FAN:1 +T 44800 43700 5 10 0 0 0 6 1 +device=none +T 44400 43100 5 10 1 1 0 1 1 +value=FAN +} +C 49000 43300 1 0 0 attiny85.sym +{ +T 52900 45500 5 10 1 1 0 6 1 +refdes=U2 +T 49300 46600 5 10 0 0 0 0 1 +device=ATtiny85 +T 49300 46800 5 10 0 0 0 0 1 +footprint=SOIC-127P-1030L1-8N +} +C 47600 44200 1 270 0 capacitor-1.sym +{ +T 48300 44000 5 10 0 0 270 0 1 +device=CAPACITOR +T 48100 43800 5 10 1 1 0 0 1 +refdes=C3 +T 48500 44000 5 10 0 0 270 0 1 +symversion=0.1 +T 48100 43600 5 10 1 1 0 0 1 +value=100nF +T 47600 44200 5 10 0 1 0 0 1 +footprint=0805 +} +C 53200 43600 1 0 0 nc-right-1.sym +{ +T 53300 44100 5 10 0 0 0 0 1 +value=NoConnection +T 53300 44300 5 10 0 0 0 0 1 +device=DRC_Directive +} +C 54800 43900 1 0 0 output-2.sym +{ +T 55700 44100 5 10 0 0 0 0 1 +net=FAN:1 +T 55000 44600 5 10 0 0 0 0 1 +device=none +T 55100 44000 5 10 1 1 0 1 1 +value=FAN +} +C 54800 44200 1 0 0 output-2.sym +{ +T 55700 44400 5 10 0 0 0 0 1 +net=LED:1 +T 55000 44900 5 10 0 0 0 0 1 +device=none +T 55100 44300 5 10 1 1 0 1 1 +value=LED +} +C 48400 43000 1 0 0 gnd-1.sym +N 49000 43300 47800 43300 4 +N 49000 43700 49000 43300 4 +N 49000 44200 47800 44200 4 +N 48500 44300 48500 44200 4 +C 40700 40000 1 0 0 input-2.sym +{ +T 40700 40200 5 10 0 0 0 0 1 +net=LED:1 +T 41300 40700 5 10 0 0 0 0 1 +device=none +T 41700 40100 5 10 1 1 0 7 1 +value=LED +} +C 42000 39600 1 0 0 res_horiz.sym +{ +T 42300 42600 5 8 0 0 0 0 1 +device=resistor +T 42300 39800 5 10 1 1 0 0 1 +refdes=R3 +T 42300 39600 5 10 1 1 0 0 1 +value=1K +T 42300 39400 5 8 1 1 0 0 1 +footprint=0805 +T 42300 41600 5 8 0 0 0 0 1 +symversion=1.0 +} +C 43100 39400 1 0 0 led.sym +{ +T 43800 40000 5 10 1 1 0 0 1 +refdes=D2 +T 43800 39600 5 8 1 1 0 0 1 +footprint=0805 +T 43800 39800 5 10 1 1 0 0 1 +value=yellow +T 43100 39400 5 10 0 1 0 0 1 +footprint=switch.fp +} +C 43400 39100 1 0 0 gnd-1.sym +N 42100 40100 42200 40100 4 +N 42800 40100 43500 40100 4 +N 43500 39600 43500 39400 4 +C 54300 47700 1 0 0 icsp6-mpan-4.sym +{ +T 54000 47800 5 10 0 1 0 0 1 +device=HEADER6 +T 54295 47698 5 10 0 1 0 0 1 +footprint=HEADER6_2 +T 54300 47700 5 10 0 2 0 0 1 +value=ICSP +T 54300 47700 5 10 0 0 0 0 1 +documentation=ICSP programming header may be unpopulated if using pogo pins. +T 55100 48600 5 10 1 1 0 0 1 +refdes=CONN141 +} +C 56100 48600 1 0 0 vcc-1.sym +C 56200 47600 1 0 0 gnd-1.sym +N 56100 48400 56300 48400 4 +N 56300 48400 56300 48600 4 +N 56100 48000 56300 48000 4 +N 56300 48000 56300 47900 4 +C 57500 48100 1 0 1 input-2.sym +{ +T 57500 48300 5 10 0 0 0 6 1 +net=MOSI:1 +T 56900 48800 5 10 0 0 0 6 1 +device=none +T 56400 48200 5 10 1 1 0 1 1 +value=MOSI +} +C 54300 47900 1 0 1 output-2.sym +{ +T 53400 48100 5 10 0 0 0 6 1 +net=RST:1 +T 54100 48600 5 10 0 0 0 6 1 +device=none +T 54000 48000 5 10 1 1 0 7 1 +value=RST +} +C 54300 48100 1 0 1 output-2.sym +{ +T 53400 48300 5 10 0 0 0 6 1 +net=SCK:1 +T 54100 48800 5 10 0 0 0 6 1 +device=none +T 54000 48200 5 10 1 1 0 7 1 +value=SCK +} +C 54300 48300 1 0 1 output-2.sym +{ +T 53400 48500 5 10 0 0 0 6 1 +net=MISO:1 +T 54100 49000 5 10 0 0 0 6 1 +device=none +T 54100 48400 5 10 1 1 0 7 1 +value=MISO +} +B 53200 47500 3800 1900 3 0 1 0 -1 -1 0 -1 -1 -1 -1 -1 +T 53400 49100 9 10 1 0 0 0 1 +4: ICSP header +C 46200 48300 1 0 0 vcc-1.sym +C 48300 44300 1 0 0 vcc-1.sym +C 46500 39400 1 0 0 res_horiz.sym +{ +T 46800 42400 5 8 0 0 0 0 1 +device=resistor +T 46800 39600 5 10 1 1 0 0 1 +refdes=R2 +T 46800 39400 5 10 1 1 0 0 1 +value=10K +T 46800 39200 5 8 1 1 0 0 1 +footprint=0805 +T 46800 41400 5 8 0 0 0 0 1 +symversion=1.0 +} +C 45300 39800 1 0 0 input-2.sym +{ +T 45300 40000 5 10 0 0 0 0 1 +net=RST:1 +T 45900 40500 5 10 0 0 0 0 1 +device=none +T 46300 39900 5 10 1 1 0 7 1 +value=RST +} +C 47600 45100 1 0 0 input-2.sym +{ +T 47600 45300 5 10 0 0 0 0 1 +net=RST:1 +T 48200 45800 5 10 0 0 0 0 1 +device=none +T 48600 45200 5 10 1 1 0 7 1 +value=RST +} +C 47300 40300 1 0 0 vcc-1.sym +N 47300 39900 47800 39900 4 +N 47500 39900 47500 40300 4 +C 54600 44500 1 0 1 input-2.sym +{ +T 54600 44700 5 10 0 0 0 6 1 +net=MISO:1 +T 54000 45200 5 10 0 0 0 6 1 +device=none +T 53500 44600 5 10 1 1 0 1 1 +value=MISO +} +C 54600 45700 1 90 1 input-2.sym +{ +T 54400 45700 5 10 0 0 90 6 1 +net=SCK:1 +T 53900 45100 5 10 0 0 90 6 1 +device=none +T 54500 44600 5 10 1 1 90 1 1 +value=SCK +} +C 53200 44800 1 0 0 output-2.sym +{ +T 54100 45000 5 10 0 0 0 0 1 +net=MOSI:1 +T 53400 45500 5 10 0 0 0 0 1 +device=none +T 53500 44900 5 10 1 1 0 1 1 +value=MOSI +} +N 54800 44300 53200 44300 4 +N 54800 44000 53200 44000 4 +C 47800 39900 1 0 0 switch-pushbutton-no-1.sym +{ +T 48200 40200 5 10 1 1 0 0 1 +refdes=S1 +T 48200 40500 5 10 0 0 0 0 1 +device=SWITCH_PUSHBUTTON_NO +T 47800 39900 5 10 0 1 0 0 1 +footprint=SW_Small +} +C 48900 39300 1 0 0 gnd-1.sym +N 48800 39900 49000 39900 4 +N 49000 39900 49000 39600 4 +B 41100 46500 6900 2900 3 0 1 0 -1 -1 0 -1 -1 -1 -1 -1 +B 45600 38700 4000 2400 3 0 1 0 -1 -1 0 -1 -1 -1 -1 -1 +B 41100 38700 4100 2500 3 0 1 0 -1 -1 0 -1 -1 -1 -1 -1 +B 41100 41700 4400 4500 3 0 1 0 -1 -1 0 -1 -1 -1 -1 -1 +B 47000 42300 8700 3800 3 0 1 0 -1 -1 0 -1 -1 -1 -1 -1 +T 47300 45800 9 12 1 0 0 0 1 +1: Microcontroller +T 41200 49100 9 12 1 0 0 0 1 +2: Power regulation +T 44000 45900 9 12 1 0 0 0 1 +3: Fan control +T 41200 40800 9 12 1 0 0 0 1 +5: Heartbeat indicator +T 45700 40800 9 12 1 0 0 0 1 +6: Reset circuit +T 52200 40200 9 10 1 0 0 0 4 +Fan marked as 24V 0.033A. +Measured 20mA normal use, 40mA stalled at 12V. +Note: Inductive load hence bypass diode. +2N7000 max continuous current Id is 200mA. diff --git a/gafrc b/gafrc new file mode 100644 index 0000000..7408ef0 --- /dev/null +++ b/gafrc @@ -0,0 +1 @@ +(component-library "./sym") diff --git a/sym/attiny85.sym b/sym/attiny85.sym new file mode 100644 index 0000000..c087323 --- /dev/null +++ b/sym/attiny85.sym @@ -0,0 +1,108 @@ +v 20140308 2 +P 4200 1600 3900 1600 1 0 0 +{ +T 4000 1650 5 8 1 1 0 0 1 +pinnumber=5 +T 4300 1750 5 8 0 1 0 2 1 +pinseq=5 +T 3850 1600 9 8 1 1 0 6 1 +pinlabel=PB0/AREF/DI/OC1A/AIN0/OC0A/SDA/MOSI +T 3850 1600 5 8 0 1 0 8 1 +pintype=io +} +P 0 1900 300 1900 1 0 0 +{ +T 200 1950 5 8 1 1 0 6 1 +pinnumber=1 +T -100 2050 5 8 0 1 0 8 1 +pinseq=1 +T 350 1900 9 8 1 1 0 0 1 +pinlabel=PB5/\_RESET\_/dW/ADC0 +T 350 1900 5 8 0 1 0 2 1 +pintype=io +} +P 4200 1300 3900 1300 1 0 0 +{ +T 4000 1350 5 8 1 1 0 0 1 +pinnumber=6 +T 4300 1450 5 8 0 1 0 2 1 +pinseq=6 +T 3850 1300 9 8 1 1 0 6 1 +pinlabel=PB1/DO/OC1A/AIN1/OC0B/MISO +T 3850 1300 5 8 0 1 0 8 1 +pintype=io +} +P 4200 1000 3900 1000 1 0 0 +{ +T 4000 1050 5 8 1 1 0 0 1 +pinnumber=7 +T 4300 1150 5 8 0 1 0 2 1 +pinseq=7 +T 3850 1000 9 8 1 1 0 6 1 +pinlabel=PB2/ADC1/T0/ISCK/INT0/SCL/SCK +T 3850 1000 5 8 0 1 0 8 1 +pintype=io +} +P 0 900 300 900 1 0 0 +{ +T 200 950 5 8 1 1 0 6 1 +pinnumber=8 +T 200 850 5 8 0 1 0 8 1 +pinseq=8 +T 350 900 9 8 1 1 0 0 1 +pinlabel=VCC +T 350 900 5 8 0 1 0 2 1 +pintype=pwr +} +P 0 400 300 400 1 0 0 +{ +T 200 450 5 8 1 1 0 6 1 +pinnumber=4 +T 200 350 5 8 0 1 0 8 1 +pinseq=4 +T 350 400 9 8 1 1 0 0 1 +pinlabel=GND +T 350 400 5 8 0 1 0 2 1 +pintype=pwr +} +B 300 100 3600 2000 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1 +T 3900 2200 8 10 1 1 0 6 1 +refdes=U? +T 300 2200 9 10 1 0 0 0 1 +ATtiny85 +T 300 3300 5 10 0 0 0 0 1 +device=ATtiny85 +T 300 3500 5 10 0 0 0 0 1 +footprint=SOIC-127P-1030L1-8N +T 300 3700 5 10 0 0 0 0 1 +author=pat.thoyts@gmail.com +T 300 3900 5 10 0 0 0 0 1 +documentation=http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf +T 300 4100 5 10 0 0 0 0 1 +description=ATtiny85 microcontroller +T 300 4300 5 10 0 0 0 0 1 +dist-license=GPL +T 300 4500 5 10 0 0 0 0 1 +use-license=unlimited +P 4200 700 3900 700 1 0 0 +{ +T 4000 750 5 8 1 1 0 0 1 +pinnumber=2 +T 4300 850 5 8 0 1 0 2 1 +pinseq=2 +T 3850 700 9 8 1 1 0 6 1 +pinlabel=PB3/XTAL1/OC1B/CLKI/ADC3 +T 3850 700 5 8 0 1 0 8 1 +pintype=io +} +P 4200 400 3900 400 1 0 0 +{ +T 4000 450 5 8 1 1 0 0 1 +pinnumber=3 +T 4300 550 5 8 0 1 0 2 1 +pinseq=3 +T 3850 400 9 8 1 1 0 6 1 +pinlabel=PB4/XTAL2/OC1B/CLKO/ADC2 +T 3850 400 5 8 0 1 0 8 1 +pintype=io +}