added 3 & 4 digit voltmeter schematics

This commit is contained in:
Eddy 2015-02-17 01:41:28 +03:00
parent 1b567fe1ee
commit b300fb8d06
19 changed files with 1601 additions and 94 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
*.drl
.hg*
*.tgz
.dropbox.attr

View File

@ -22,6 +22,7 @@
#include "ports_definition.h"
#include "main.h"
#include "stepper.h"
#include "soft_i2c.h"
// Top Level Interrupt
INTERRUPT_HANDLER(TLI_IRQHandler, 0){}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View File

@ -0,0 +1,84 @@
update=Вт 17 фев 2015 00:35:25
version=1
last_client=eeschema
[cvpcb]
version=1
NetIExt=net
[cvpcb/libraries]
EquName1=devcms
[pcbnew]
version=1
LastNetListRead=
PadDrlX=320
PadDimH=550
PadDimV=550
BoardThickness=620
TxtPcbV=600
TxtPcbH=600
TxtModV=500
TxtModH=500
TxtModW=100
VEgarde=100
DrawLar=120
EdgeLar=80
TxtLar=120
MSegLar=120
[pcbnew/libraries]
LibDir=
LibName1=sockets
LibName2=connect
LibName3=discret
LibName4=pin_array
LibName5=divers
LibName6=libcms
LibName7=display
LibName8=led
LibName9=dip_sockets
LibName10=pga_sockets
LibName11=valves
[general]
version=1
[eeschema]
version=1
LibDir=/home/eddy/Docs/ELECTRONICS/STM8/voltmeters/kicad
NetFmtName=
RptD_X=0
RptD_Y=100
RptLab=1
LabSize=60
[eeschema/libraries]
LibName1=power
LibName2=device
LibName3=transistors
LibName4=conn
LibName5=linear
LibName6=regul
LibName7=74xx
LibName8=cmos4000
LibName9=adc-dac
LibName10=memory
LibName11=xilinx
LibName12=special
LibName13=microcontrollers
LibName14=dsp
LibName15=microchip
LibName16=analog_switches
LibName17=motorola
LibName18=texas
LibName19=intel
LibName20=audio
LibName21=interface
LibName22=digital-audio
LibName23=philips
LibName24=display
LibName25=cypress
LibName26=siliconi
LibName27=opto
LibName28=atmel
LibName29=contrib
LibName30=valves
LibName31=stm8
LibName32=ht7136
LibName33=mcp3421
LibName34=seven_segm
LibName35=stm8s003

View File

@ -0,0 +1,473 @@
EESchema Schematic File Version 2
LIBS:power
LIBS:device
LIBS:transistors
LIBS:conn
LIBS:linear
LIBS:regul
LIBS:74xx
LIBS:cmos4000
LIBS:adc-dac
LIBS:memory
LIBS:xilinx
LIBS:special
LIBS:microcontrollers
LIBS:dsp
LIBS:microchip
LIBS:analog_switches
LIBS:motorola
LIBS:texas
LIBS:intel
LIBS:audio
LIBS:interface
LIBS:digital-audio
LIBS:philips
LIBS:display
LIBS:cypress
LIBS:siliconi
LIBS:opto
LIBS:atmel
LIBS:contrib
LIBS:valves
LIBS:stm8
LIBS:ht7136
LIBS:mcp3421
LIBS:seven_segm
LIBS:stm8s003
LIBS:3digit_voltmeter-cache
EELAYER 27 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 1
Title ""
Date "16 feb 2015"
Rev ""
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L STM8S003F3P6 IC1
U 1 1 54CCE7DB
P 5050 4600
F 0 "IC1" H 5050 5200 60 0000 C CNN
F 1 "STM8S003F3P6" H 5050 3800 60 0000 C CNN
F 2 "TSSOP20" H 4950 5100 60 0001 C CNN
F 3 "~" H 5050 4600 60 0000 C CNN
1 5050 4600
1 0 0 -1
$EndComp
$Comp
L R_PACK4 RP2
U 1 1 54CCE809
P 7200 4200
F 0 "RP2" H 7200 4650 40 0000 C CNN
F 1 "220" H 7200 4150 40 0000 C CNN
F 2 "" H 7200 4200 60 0000 C CNN
F 3 "" H 7200 4200 60 0000 C CNN
1 7200 4200
1 0 0 1
$EndComp
$Comp
L ARK-SP410361N DIS2
U 1 1 54CCF1F0
P 6550 3100
F 0 "DIS2" H 6550 3600 60 0000 C CNN
F 1 "ARK-SP410361N" H 6550 2650 60 0000 C CNN
F 2 "~" H 6300 3100 60 0000 C CNN
F 3 "~" H 6300 3100 60 0000 C CNN
1 6550 3100
1 0 0 -1
$EndComp
$Comp
L HT7136 U2
U 1 1 54CD13ED
P 3200 3050
F 0 "U2" H 3350 2854 60 0000 C CNN
F 1 "HT7136" H 3200 3250 60 0000 C CNN
F 2 "~" H 3200 3050 60 0000 C CNN
F 3 "~" H 3200 3050 60 0000 C CNN
1 3200 3050
1 0 0 -1
$EndComp
$Comp
L GND #PWR01
U 1 1 54CD1463
P 3200 3400
F 0 "#PWR01" H 3200 3400 30 0001 C CNN
F 1 "GND" H 3200 3330 30 0001 C CNN
F 2 "" H 3200 3400 60 0000 C CNN
F 3 "" H 3200 3400 60 0000 C CNN
1 3200 3400
1 0 0 -1
$EndComp
Wire Wire Line
3200 3400 3200 3300
$Comp
L C C1
U 1 1 54CD1475
P 2700 3350
F 0 "C1" H 2750 3450 50 0000 L CNN
F 1 "100n" H 2750 3250 50 0000 L CNN
F 2 "" H 2700 3350 60 0000 C CNN
F 3 "" H 2700 3350 60 0000 C CNN
1 2700 3350
1 0 0 -1
$EndComp
Wire Wire Line
2700 3150 2700 3000
$Comp
L GND #PWR02
U 1 1 54CD148D
P 2700 3650
F 0 "#PWR02" H 2700 3650 30 0001 C CNN
F 1 "GND" H 2700 3580 30 0001 C CNN
F 2 "" H 2700 3650 60 0000 C CNN
F 3 "" H 2700 3650 60 0000 C CNN
1 2700 3650
1 0 0 -1
$EndComp
Wire Wire Line
2700 3550 2700 3650
$Comp
L CP1 C2
U 1 1 54CD14C2
P 3750 3200
F 0 "C2" H 3800 3300 50 0000 L CNN
F 1 "100u" H 3800 3100 50 0000 L CNN
F 2 "" H 3750 3200 60 0000 C CNN
F 3 "" H 3750 3200 60 0000 C CNN
1 3750 3200
1 0 0 -1
$EndComp
Wire Wire Line
3600 3000 3900 3000
$Comp
L GND #PWR03
U 1 1 54CD271D
P 3750 3500
F 0 "#PWR03" H 3750 3500 30 0001 C CNN
F 1 "GND" H 3750 3430 30 0001 C CNN
F 2 "" H 3750 3500 60 0000 C CNN
F 3 "" H 3750 3500 60 0000 C CNN
1 3750 3500
1 0 0 -1
$EndComp
Wire Wire Line
3750 3400 3750 3500
Connection ~ 3750 3000
$Comp
L VCC #PWR04
U 1 1 54CD31C2
P 3900 3000
F 0 "#PWR04" H 3900 3100 30 0001 C CNN
F 1 "VCC" H 3900 3100 30 0000 C CNN
F 2 "" H 3900 3000 60 0000 C CNN
F 3 "" H 3900 3000 60 0000 C CNN
1 3900 3000
1 0 0 -1
$EndComp
$Comp
L CONN_4 P1
U 1 1 54CD436B
P 4900 2950
F 0 "P1" V 4850 2950 50 0000 C CNN
F 1 "CONN_5" V 4950 2950 50 0000 C CNN
F 2 "" H 4900 2950 60 0000 C CNN
F 3 "" H 4900 2950 60 0000 C CNN
1 4900 2950
0 1 -1 0
$EndComp
Wire Wire Line
5050 3450 5050 3300
$Comp
L R_PACK4 RP1
U 1 1 54CD4EA1
P 6950 4800
F 0 "RP1" H 6950 5250 40 0000 C CNN
F 1 "220" H 6950 4750 40 0000 C CNN
F 2 "" H 6950 4800 60 0000 C CNN
F 3 "" H 6950 4800 60 0000 C CNN
1 6950 4800
1 0 0 1
$EndComp
Text Label 7400 4350 0 60 ~ 0
G
Text Label 7400 4450 0 60 ~ 0
DP
Text Label 7150 4950 0 60 ~ 0
A
Text Label 7150 5050 0 60 ~ 0
F
Text Label 7400 4550 0 60 ~ 0
D
Text Label 7150 4850 0 60 ~ 0
E
Text Label 7400 4250 0 60 ~ 0
C
Text Label 7150 5150 0 60 ~ 0
B
Text Label 5450 3250 2 60 ~ 0
G
Text Label 5450 3050 2 60 ~ 0
DP
Text Label 7600 2950 0 60 ~ 0
A
Text Label 7600 3050 0 60 ~ 0
F
Text Label 5450 2950 2 60 ~ 0
D
Text Label 5450 2850 2 60 ~ 0
E
Text Label 5450 3150 2 60 ~ 0
C
Text Label 7600 3350 0 60 ~ 0
B
Text Label 4850 3300 3 60 ~ 0
SWIM
Text Label 4750 3300 3 60 ~ 0
RST
Text Label 7600 2850 0 60 ~ 0
A1
Text Label 7600 3150 0 60 ~ 0
A2
Text Label 7600 3250 0 60 ~ 0
A3
$Comp
L VCC #PWR05
U 1 1 54CD9F1D
P 3750 5050
F 0 "#PWR05" H 3750 5150 30 0001 C CNN
F 1 "VCC" H 3750 5150 30 0000 C CNN
F 2 "" H 3750 5050 60 0000 C CNN
F 3 "" H 3750 5050 60 0000 C CNN
1 3750 5050
0 -1 -1 0
$EndComp
$Comp
L GND #PWR06
U 1 1 54CDA116
P 3700 4850
F 0 "#PWR06" H 3700 4850 30 0001 C CNN
F 1 "GND" H 3700 4780 30 0001 C CNN
F 2 "" H 3700 4850 60 0000 C CNN
F 3 "" H 3700 4850 60 0000 C CNN
1 3700 4850
0 1 1 0
$EndComp
$Comp
L C C3
U 1 1 54CDA380
P 3600 5450
F 0 "C3" H 3600 5550 40 0000 L CNN
F 1 "0.68u" H 3606 5365 40 0000 L CNN
F 2 "" H 3638 5300 30 0000 C CNN
F 3 "" H 3600 5450 60 0000 C CNN
1 3600 5450
1 0 0 -1
$EndComp
Wire Wire Line
3600 4450 3600 5250
Wire Wire Line
3600 4950 3800 4950
$Comp
L GND #PWR07
U 1 1 54CDA4A6
P 3600 5750
F 0 "#PWR07" H 3600 5750 30 0001 C CNN
F 1 "GND" H 3600 5680 30 0001 C CNN
F 2 "" H 3600 5750 60 0000 C CNN
F 3 "" H 3600 5750 60 0000 C CNN
1 3600 5750
1 0 0 -1
$EndComp
Wire Wire Line
3600 5750 3600 5650
Text Label 3800 4350 2 60 ~ 0
A3
Text Label 3800 4250 2 60 ~ 0
A2
Wire Wire Line
3600 4450 3800 4450
Connection ~ 3600 4950
Wire Wire Line
3700 4850 3800 4850
Wire Wire Line
3750 5050 3800 5050
Wire Wire Line
2700 3000 2800 3000
Text Label 3800 4550 2 60 ~ 0
RST
Text Label 6400 4450 0 60 ~ 0
SWIM
Text Label 3800 5150 2 60 ~ 0
A1
Wire Wire Line
6400 5150 6750 5150
Wire Wire Line
6400 5050 6750 5050
Wire Wire Line
6400 4950 6750 4950
Wire Wire Line
6400 4850 6750 4850
$Comp
L CONN_2 P2
U 1 1 54E2B17F
P 1400 2950
F 0 "P2" V 1350 2950 40 0000 C CNN
F 1 "CONN_2" V 1450 2950 40 0000 C CNN
F 2 "" H 1400 2950 60 0000 C CNN
F 3 "" H 1400 2950 60 0000 C CNN
1 1400 2950
-1 0 0 1
$EndComp
$Comp
L GND #PWR08
U 1 1 54E2B1F6
P 1750 3200
F 0 "#PWR08" H 1750 3200 30 0001 C CNN
F 1 "GND" H 1750 3130 30 0001 C CNN
F 2 "" H 1750 3200 60 0000 C CNN
F 3 "" H 1750 3200 60 0000 C CNN
1 1750 3200
1 0 0 -1
$EndComp
Wire Wire Line
1750 3050 1750 3200
Text Label 1750 2850 0 60 ~ 0
VIN
Text Label 2700 3000 2 60 ~ 0
VIN
Text Label 4950 3300 3 60 ~ 0
VIN
$Comp
L GND #PWR09
U 1 1 54CD4689
P 5050 3450
F 0 "#PWR09" H 5050 3450 30 0001 C CNN
F 1 "GND" H 5050 3380 30 0001 C CNN
F 2 "" H 5050 3450 60 0000 C CNN
F 3 "" H 5050 3450 60 0000 C CNN
1 5050 3450
1 0 0 -1
$EndComp
$Comp
L R R3
U 1 1 54E2B6E2
P 2550 4450
F 0 "R3" V 2630 4450 40 0000 C CNN
F 1 "absent" V 2557 4451 40 0000 C CNN
F 2 "" V 2480 4450 30 0000 C CNN
F 3 "" H 2550 4450 30 0000 C CNN
1 2550 4450
1 0 0 -1
$EndComp
$Comp
L VCC #PWR010
U 1 1 54E2B7D6
P 2550 4100
F 0 "#PWR010" H 2550 4200 30 0001 C CNN
F 1 "VCC" H 2550 4200 30 0000 C CNN
F 2 "" H 2550 4100 60 0000 C CNN
F 3 "" H 2550 4100 60 0000 C CNN
1 2550 4100
1 0 0 -1
$EndComp
Wire Wire Line
2550 4100 2550 4200
$Comp
L R R2
U 1 1 54E2B804
P 2550 5050
F 0 "R2" V 2630 5050 40 0000 C CNN
F 1 "10k" V 2557 5051 40 0000 C CNN
F 2 "" V 2480 5050 30 0000 C CNN
F 3 "" H 2550 5050 30 0000 C CNN
1 2550 5050
1 0 0 -1
$EndComp
Wire Wire Line
2550 4800 2550 4700
$Comp
L C C4
U 1 1 54E2BAD0
P 2850 5100
F 0 "C4" H 2850 5200 40 0000 L CNN
F 1 "absent" H 2856 5015 40 0000 L CNN
F 2 "" H 2888 4950 30 0000 C CNN
F 3 "" H 2850 5100 60 0000 C CNN
1 2850 5100
1 0 0 -1
$EndComp
Text Label 6400 4250 0 60 ~ 0
AIN
Text Label 3000 4750 0 60 ~ 0
AIN
Connection ~ 2550 4750
Wire Wire Line
2550 5300 2850 5300
Wire Wire Line
2850 4900 2850 4750
Connection ~ 2850 4750
Wire Wire Line
2150 4750 3000 4750
Wire Wire Line
6400 4750 6850 4750
Wire Wire Line
6400 4650 6800 4650
Wire Wire Line
6400 4550 6750 4550
Wire Wire Line
6850 4750 6850 4550
Wire Wire Line
6850 4550 7000 4550
Wire Wire Line
6800 4650 6800 4450
Wire Wire Line
6800 4450 7000 4450
Wire Wire Line
6750 4550 6750 4350
Wire Wire Line
6750 4350 7000 4350
Wire Wire Line
6400 4450 6650 4450
Wire Wire Line
6650 4450 6650 4250
Wire Wire Line
6650 4250 7000 4250
$Comp
L R R1
U 1 1 54E2D592
P 2150 4400
F 0 "R1" V 2230 4400 40 0000 C CNN
F 1 "91k" V 2157 4401 40 0000 C CNN
F 2 "" V 2080 4400 30 0000 C CNN
F 3 "" H 2150 4400 30 0000 C CNN
1 2150 4400
1 0 0 -1
$EndComp
Wire Wire Line
2150 4750 2150 4650
Text Label 2150 4150 2 60 ~ 0
VIN
NoConn ~ 3800 4650
NoConn ~ 3800 4750
NoConn ~ 6400 4350
$Comp
L GND #PWR?
U 1 1 54E2711D
P 2700 5400
F 0 "#PWR?" H 2700 5400 30 0001 C CNN
F 1 "GND" H 2700 5330 30 0001 C CNN
F 2 "" H 2700 5400 60 0000 C CNN
F 3 "" H 2700 5400 60 0000 C CNN
1 2700 5400
1 0 0 -1
$EndComp
Wire Wire Line
2700 5400 2700 5300
Connection ~ 2700 5300
$EndSCHEMATC

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -0,0 +1,84 @@
update=Вт 17 фев 2015 00:35:02
version=1
last_client=eeschema
[cvpcb]
version=1
NetIExt=net
[cvpcb/libraries]
EquName1=devcms
[pcbnew]
version=1
LastNetListRead=
PadDrlX=320
PadDimH=550
PadDimV=550
BoardThickness=620
TxtPcbV=600
TxtPcbH=600
TxtModV=500
TxtModH=500
TxtModW=100
VEgarde=100
DrawLar=120
EdgeLar=80
TxtLar=120
MSegLar=120
[pcbnew/libraries]
LibDir=
LibName1=sockets
LibName2=connect
LibName3=discret
LibName4=pin_array
LibName5=divers
LibName6=libcms
LibName7=display
LibName8=led
LibName9=dip_sockets
LibName10=pga_sockets
LibName11=valves
[general]
version=1
[eeschema]
version=1
LibDir=/home/eddy/Docs/ELECTRONICS/STM8/voltmeters/kicad
NetFmtName=
RptD_X=0
RptD_Y=100
RptLab=1
LabSize=60
[eeschema/libraries]
LibName1=power
LibName2=device
LibName3=transistors
LibName4=conn
LibName5=linear
LibName6=regul
LibName7=74xx
LibName8=cmos4000
LibName9=adc-dac
LibName10=memory
LibName11=xilinx
LibName12=special
LibName13=microcontrollers
LibName14=dsp
LibName15=microchip
LibName16=analog_switches
LibName17=motorola
LibName18=texas
LibName19=intel
LibName20=audio
LibName21=interface
LibName22=digital-audio
LibName23=philips
LibName24=display
LibName25=cypress
LibName26=siliconi
LibName27=opto
LibName28=atmel
LibName29=contrib
LibName30=valves
LibName31=stm8
LibName32=ht7136
LibName33=mcp3421
LibName34=seven_segm
LibName35=stm8s003

View File

@ -0,0 +1,553 @@
EESchema Schematic File Version 2
LIBS:power
LIBS:device
LIBS:transistors
LIBS:conn
LIBS:linear
LIBS:regul
LIBS:74xx
LIBS:cmos4000
LIBS:adc-dac
LIBS:memory
LIBS:xilinx
LIBS:special
LIBS:microcontrollers
LIBS:dsp
LIBS:microchip
LIBS:analog_switches
LIBS:motorola
LIBS:texas
LIBS:intel
LIBS:audio
LIBS:interface
LIBS:digital-audio
LIBS:philips
LIBS:display
LIBS:cypress
LIBS:siliconi
LIBS:opto
LIBS:atmel
LIBS:contrib
LIBS:valves
LIBS:stm8
LIBS:ht7136
LIBS:mcp3421
LIBS:seven_segm
LIBS:stm8s003
LIBS:4digit_voltmeter-cache
EELAYER 27 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 1
Title ""
Date "16 feb 2015"
Rev ""
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L STM8S003F3P6 IC1
U 1 1 54CCE7DB
P 5050 4600
F 0 "IC1" H 5050 5200 60 0000 C CNN
F 1 "STM8S003F3P6" H 5050 3800 60 0000 C CNN
F 2 "TSSOP20" H 4950 5100 60 0001 C CNN
F 3 "~" H 5050 4600 60 0000 C CNN
1 5050 4600
1 0 0 -1
$EndComp
$Comp
L R_PACK4 RP2
U 1 1 54CCE809
P 7100 4900
F 0 "RP2" H 7100 5350 40 0000 C CNN
F 1 "220" H 7100 4850 40 0000 C CNN
F 2 "" H 7100 4900 60 0000 C CNN
F 3 "" H 7100 4900 60 0000 C CNN
1 7100 4900
1 0 0 -1
$EndComp
$Comp
L HT7136 U2
U 1 1 54CD13ED
P 2700 3300
F 0 "U2" H 2850 3104 60 0000 C CNN
F 1 "HT7136" H 2700 3500 60 0000 C CNN
F 2 "~" H 2700 3300 60 0000 C CNN
F 3 "~" H 2700 3300 60 0000 C CNN
1 2700 3300
1 0 0 -1
$EndComp
$Comp
L CONN_3 K1
U 1 1 54CD13FC
P 850 3250
F 0 "K1" V 800 3250 50 0000 C CNN
F 1 "CONN_3" V 900 3250 40 0000 C CNN
F 2 "" H 850 3250 60 0000 C CNN
F 3 "" H 850 3250 60 0000 C CNN
1 850 3250
-1 0 0 1
$EndComp
$Comp
L GND #PWR01
U 1 1 54CD1415
P 1300 3450
F 0 "#PWR01" H 1300 3450 30 0001 C CNN
F 1 "GND" H 1300 3380 30 0001 C CNN
F 2 "" H 1300 3450 60 0000 C CNN
F 3 "" H 1300 3450 60 0000 C CNN
1 1300 3450
1 0 0 -1
$EndComp
Wire Wire Line
1300 3450 1300 3350
Wire Wire Line
1300 3350 1200 3350
$Comp
L DIODESCH D1
U 1 1 54CD143B
P 1950 3250
F 0 "D1" H 1950 3350 40 0000 C CNN
F 1 "0.24V" H 1950 3150 40 0000 C CNN
F 2 "" H 1950 3250 60 0000 C CNN
F 3 "" H 1950 3250 60 0000 C CNN
1 1950 3250
1 0 0 -1
$EndComp
Wire Wire Line
1200 3250 1750 3250
Wire Wire Line
2150 3250 2300 3250
$Comp
L GND #PWR02
U 1 1 54CD1463
P 2700 3650
F 0 "#PWR02" H 2700 3650 30 0001 C CNN
F 1 "GND" H 2700 3580 30 0001 C CNN
F 2 "" H 2700 3650 60 0000 C CNN
F 3 "" H 2700 3650 60 0000 C CNN
1 2700 3650
1 0 0 -1
$EndComp
Wire Wire Line
2700 3650 2700 3550
$Comp
L C C1
U 1 1 54CD1475
P 1850 5550
F 0 "C1" H 1900 5650 50 0000 L CNN
F 1 "100n" H 1900 5450 50 0000 L CNN
F 2 "" H 1850 5550 60 0000 C CNN
F 3 "" H 1850 5550 60 0000 C CNN
1 1850 5550
1 0 0 -1
$EndComp
Wire Wire Line
2200 3400 2200 3250
Connection ~ 2200 3250
$Comp
L GND #PWR03
U 1 1 54CD148D
P 2200 3900
F 0 "#PWR03" H 2200 3900 30 0001 C CNN
F 1 "GND" H 2200 3830 30 0001 C CNN
F 2 "" H 2200 3900 60 0000 C CNN
F 3 "" H 2200 3900 60 0000 C CNN
1 2200 3900
1 0 0 -1
$EndComp
Wire Wire Line
2200 3800 2200 3900
$Comp
L CP1 C4
U 1 1 54CD14C2
P 3250 3450
F 0 "C4" H 3300 3550 50 0000 L CNN
F 1 "100u" H 3300 3350 50 0000 L CNN
F 2 "" H 3250 3450 60 0000 C CNN
F 3 "" H 3250 3450 60 0000 C CNN
1 3250 3450
1 0 0 -1
$EndComp
Wire Wire Line
3100 3250 3400 3250
$Comp
L GND #PWR04
U 1 1 54CD271D
P 3250 3750
F 0 "#PWR04" H 3250 3750 30 0001 C CNN
F 1 "GND" H 3250 3680 30 0001 C CNN
F 2 "" H 3250 3750 60 0000 C CNN
F 3 "" H 3250 3750 60 0000 C CNN
1 3250 3750
1 0 0 -1
$EndComp
Wire Wire Line
3250 3650 3250 3750
Connection ~ 3250 3250
$Comp
L VCC #PWR05
U 1 1 54CD31C2
P 3400 3250
F 0 "#PWR05" H 3400 3350 30 0001 C CNN
F 1 "VCC" H 3400 3350 30 0000 C CNN
F 2 "" H 3400 3250 60 0000 C CNN
F 3 "" H 3400 3250 60 0000 C CNN
1 3400 3250
1 0 0 -1
$EndComp
Text Label 1200 3250 0 60 ~ 0
power
Text Label 1250 3350 0 60 ~ 0
GND
$Comp
L CONN_5 P1
U 1 1 54CD436B
P 4100 3250
F 0 "P1" V 4050 3250 50 0000 C CNN
F 1 "CONN_5" V 4150 3250 50 0000 C CNN
F 2 "" H 4100 3250 60 0000 C CNN
F 3 "" H 4100 3250 60 0000 C CNN
1 4100 3250
0 -1 -1 0
$EndComp
$Comp
L VCC #PWR06
U 1 1 54CD457D
P 3600 3700
F 0 "#PWR06" H 3600 3800 30 0001 C CNN
F 1 "VCC" H 3600 3800 30 0000 C CNN
F 2 "" H 3600 3700 60 0000 C CNN
F 3 "" H 3600 3700 60 0000 C CNN
1 3600 3700
1 0 0 -1
$EndComp
$Comp
L GND #PWR07
U 1 1 54CD4689
P 4100 3950
F 0 "#PWR07" H 4100 3950 30 0001 C CNN
F 1 "GND" H 4100 3880 30 0001 C CNN
F 2 "" H 4100 3950 60 0000 C CNN
F 3 "" H 4100 3950 60 0000 C CNN
1 4100 3950
1 0 0 -1
$EndComp
Wire Wire Line
4100 3950 4100 3650
$Comp
L R_PACK4 RP1
U 1 1 54CD4EA1
P 7100 5450
F 0 "RP1" H 7100 5900 40 0000 C CNN
F 1 "220" H 7100 5400 40 0000 C CNN
F 2 "" H 7100 5450 60 0000 C CNN
F 3 "" H 7100 5450 60 0000 C CNN
1 7100 5450
1 0 0 -1
$EndComp
Text Label 7300 5100 0 60 ~ 0
G
Text Label 7300 4750 0 60 ~ 0
DP
Text Label 7300 5300 0 60 ~ 0
A
Text Label 7300 5400 0 60 ~ 0
F
Text Label 7300 4650 0 60 ~ 0
D
Text Label 7300 4550 0 60 ~ 0
E
Text Label 7300 4850 0 60 ~ 0
C
Text Label 7300 5200 0 60 ~ 0
B
Text Label 4650 3500 2 60 ~ 0
G
Text Label 4650 3300 2 60 ~ 0
DP
Text Label 7550 3200 0 60 ~ 0
A
Text Label 7550 3300 0 60 ~ 0
F
Text Label 4650 3200 2 60 ~ 0
D
Text Label 4650 3100 2 60 ~ 0
E
Text Label 4650 3400 2 60 ~ 0
C
Text Label 7550 3600 0 60 ~ 0
B
Text Label 3800 5150 2 60 ~ 0
A1
Text Label 3800 4450 2 60 ~ 0
A2
Text Label 3800 4250 2 60 ~ 0
A3
Text Label 4300 3650 3 60 ~ 0
SWIM
Text Label 4200 3650 3 60 ~ 0
RST
Text Label 7550 3100 0 60 ~ 0
A1
Text Label 7550 3400 0 60 ~ 0
A2
Text Label 7550 3500 0 60 ~ 0
A3
$Comp
L VCC #PWR08
U 1 1 54CD9F1D
P 2750 4950
F 0 "#PWR08" H 2750 5050 30 0001 C CNN
F 1 "VCC" H 2750 5050 30 0000 C CNN
F 2 "" H 2750 4950 60 0000 C CNN
F 3 "" H 2750 4950 60 0000 C CNN
1 2750 4950
1 0 0 -1
$EndComp
$Comp
L GND #PWR09
U 1 1 54CDA116
P 2950 4900
F 0 "#PWR09" H 2950 4900 30 0001 C CNN
F 1 "GND" H 2950 4830 30 0001 C CNN
F 2 "" H 2950 4900 60 0000 C CNN
F 3 "" H 2950 4900 60 0000 C CNN
1 2950 4900
1 0 0 -1
$EndComp
Wire Wire Line
2950 4900 2950 4850
Wire Wire Line
2950 4850 3800 4850
Wire Wire Line
2750 4950 2750 5050
Wire Wire Line
2750 5050 3800 5050
$Comp
L C C3
U 1 1 54CDA380
P 3050 5450
F 0 "C3" H 3050 5550 40 0000 L CNN
F 1 "0.68u" H 3056 5365 40 0000 L CNN
F 2 "" H 3088 5300 30 0000 C CNN
F 3 "" H 3050 5450 60 0000 C CNN
1 3050 5450
1 0 0 -1
$EndComp
Wire Wire Line
3050 5250 3050 4950
Wire Wire Line
3050 4950 3800 4950
$Comp
L GND #PWR010
U 1 1 54CDA4A6
P 3050 5750
F 0 "#PWR010" H 3050 5750 30 0001 C CNN
F 1 "GND" H 3050 5680 30 0001 C CNN
F 2 "" H 3050 5750 60 0000 C CNN
F 3 "" H 3050 5750 60 0000 C CNN
1 3050 5750
1 0 0 -1
$EndComp
Wire Wire Line
3050 5750 3050 5650
$Comp
L 4-digit,common_cathode DIS1
U 1 1 54E265C9
P 6100 3350
F 0 "DIS1" H 6100 3850 60 0000 C CNN
F 1 "4-digit,common_cathode" H 6100 2900 60 0000 C CNN
F 2 "" H 5650 3350 60 0000 C CNN
F 3 "" H 5650 3350 60 0000 C CNN
1 6100 3350
1 0 0 -1
$EndComp
Text Label 4650 3600 2 60 ~ 0
A4
Text Label 3900 3650 3 60 ~ 0
IN
Wire Wire Line
3600 3700 3600 3800
Wire Wire Line
3600 3800 4000 3800
Wire Wire Line
4000 3800 4000 3650
Text Label 3800 4550 2 60 ~ 0
RST
Text Label 6400 4450 0 60 ~ 0
SWIM
NoConn ~ 3800 4350
NoConn ~ 3800 4750
Wire Wire Line
3800 4650 3450 4650
Wire Wire Line
3450 4650 3450 5700
Wire Wire Line
3450 5700 6550 5700
Wire Wire Line
6400 4850 6900 4850
Wire Wire Line
6400 4750 6900 4750
Wire Wire Line
6400 4650 6900 4650
Wire Wire Line
6400 4550 6900 4550
Wire Wire Line
6400 4950 6900 4950
Wire Wire Line
6900 4950 6900 5100
Wire Wire Line
6900 5200 6800 5200
Wire Wire Line
6800 5200 6800 5050
Wire Wire Line
6800 5050 6400 5050
Wire Wire Line
6400 5150 6400 5300
Wire Wire Line
6400 5300 6900 5300
Wire Wire Line
6550 5400 6900 5400
Wire Wire Line
6550 5700 6550 5400
Text Label 6400 4350 0 60 ~ 0
AIN
NoConn ~ 6400 4250
$Comp
L C C5
U 1 1 54E26E32
P 2200 3600
F 0 "C5" H 2250 3700 50 0000 L CNN
F 1 "100n" H 2250 3500 50 0000 L CNN
F 2 "" H 2200 3600 60 0000 C CNN
F 3 "" H 2200 3600 60 0000 C CNN
1 2200 3600
1 0 0 -1
$EndComp
Text Label 1200 3150 0 60 ~ 0
IN
$Comp
L R R6
U 1 1 54E26FDE
P 1500 4250
F 0 "R6" V 1580 4250 50 0000 C CNN
F 1 "91k" V 1500 4250 50 0000 C CNN
F 2 "" H 1500 4250 60 0000 C CNN
F 3 "" H 1500 4250 60 0000 C CNN
1 1500 4250
1 0 0 -1
$EndComp
$Comp
L POT RV1
U 1 1 54E26FFC
P 1500 4900
F 0 "RV1" H 1500 4800 50 0000 C CNN
F 1 "2.2k" H 1500 4900 50 0000 C CNN
F 2 "" H 1500 4900 60 0000 C CNN
F 3 "" H 1500 4900 60 0000 C CNN
1 1500 4900
0 1 1 0
$EndComp
$Comp
L R R5
U 1 1 54E270FA
P 1750 4250
F 0 "R5" V 1830 4250 50 0000 C CNN
F 1 "91k" V 1750 4250 50 0000 C CNN
F 2 "" H 1750 4250 60 0000 C CNN
F 3 "" H 1750 4250 60 0000 C CNN
1 1750 4250
1 0 0 -1
$EndComp
Text Label 1500 4000 1 60 ~ 0
power
Text Label 1750 4000 1 60 ~ 0
IN
Wire Notes Line
700 4550 2000 4550
Wire Notes Line
2000 4550 2000 4050
Wire Notes Line
2000 4050 700 4050
Wire Notes Line
700 4050 700 4550
Text Notes 800 4250 0 60 ~ 0
Solder only\none of them
Wire Wire Line
1500 4500 1750 4500
Wire Wire Line
1500 4650 1500 4500
$Comp
L R R2
U 1 1 54E27291
P 1500 5500
F 0 "R2" V 1580 5500 50 0000 C CNN
F 1 "10k" V 1500 5500 50 0000 C CNN
F 2 "" H 1500 5500 60 0000 C CNN
F 3 "" H 1500 5500 60 0000 C CNN
1 1500 5500
1 0 0 -1
$EndComp
Wire Wire Line
1500 5250 1500 5150
$Comp
L GND #PWR011
U 1 1 54E272DC
P 1500 5850
F 0 "#PWR011" H 1500 5850 30 0001 C CNN
F 1 "GND" H 1500 5780 30 0001 C CNN
F 2 "" H 1500 5850 60 0000 C CNN
F 3 "" H 1500 5850 60 0000 C CNN
1 1500 5850
1 0 0 -1
$EndComp
Wire Wire Line
1500 5750 1500 5850
Wire Wire Line
1850 5350 1850 4900
Wire Wire Line
1650 4900 2500 4900
Wire Wire Line
1500 5800 1850 5800
Wire Wire Line
1850 5800 1850 5750
Connection ~ 1500 5800
$Comp
L R RX
U 1 1 54E274FF
P 2250 4650
F 0 "RX" V 2330 4650 50 0000 C CNN
F 1 "10M" V 2250 4650 50 0000 C CNN
F 2 "" H 2250 4650 60 0000 C CNN
F 3 "" H 2250 4650 60 0000 C CNN
1 2250 4650
1 0 0 -1
$EndComp
Connection ~ 1850 4900
$Comp
L VCC #PWR012
U 1 1 54E2754A
P 2250 4300
F 0 "#PWR012" H 2250 4400 30 0001 C CNN
F 1 "VCC" H 2250 4400 30 0000 C CNN
F 2 "" H 2250 4300 60 0000 C CNN
F 3 "" H 2250 4300 60 0000 C CNN
1 2250 4300
1 0 0 -1
$EndComp
Wire Wire Line
2250 4300 2250 4400
Connection ~ 2250 4900
Text Label 2500 4900 0 60 ~ 0
AIN
Text Label 6700 4450 0 60 ~ 0
A4
Wire Wire Line
6700 4450 6400 4450
$EndSCHEMATC

View File

@ -1,6 +1,6 @@
update=Сб 31 янв 2015 21:44:03
update=Вт 17 фев 2015 00:34:33
version=1
last_client=kicad
last_client=eeschema
[cvpcb]
version=1
NetIExt=net
@ -40,13 +40,8 @@ LibName11=valves
version=1
[eeschema]
version=1
PageLayoutDescrFile=
SubpartIdSeparator=0
SubpartFirstId=65
LibDir=/Data/documents/00__Electronics/STM8/voltmeters/kicad
LibDir=/home/eddy/Docs/ELECTRONICS/STM8/voltmeters/kicad/5-digit;/home/eddy/Docs/ELECTRONICS/STM8/voltmeters/kicad
NetFmtName=
SpiceForceRefPrefix=0
SpiceUseNetNumbers=0
RptD_X=0
RptD_Y=100
RptLab=1

View File

@ -35,13 +35,13 @@ LIBS:mcp3421
LIBS:seven_segm
LIBS:stm8s003
LIBS:5digit_voltmeter-cache
EELAYER 24 0
EELAYER 27 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 1
Title ""
Date "31 jan 2015"
Date "16 feb 2015"
Rev ""
Comp ""
Comment1 ""
@ -124,10 +124,10 @@ F 3 "" H 1500 1700 60 0000 C CNN
-1 0 0 1
$EndComp
$Comp
L GND #PWR2
L GND #PWR01
U 1 1 54CD1415
P 1950 1900
F 0 "#PWR2" H 1950 1900 30 0001 C CNN
F 0 "#PWR01" H 1950 1900 30 0001 C CNN
F 1 "GND" H 1950 1830 30 0001 C CNN
F 2 "" H 1950 1900 60 0000 C CNN
F 3 "" H 1950 1900 60 0000 C CNN
@ -156,10 +156,10 @@ Wire Wire Line
Wire Wire Line
2800 1700 2950 1700
$Comp
L GND #PWR6
L GND #PWR02
U 1 1 54CD1463
P 3350 2100
F 0 "#PWR6" H 3350 2100 30 0001 C CNN
F 0 "#PWR02" H 3350 2100 30 0001 C CNN
F 1 "GND" H 3350 2030 30 0001 C CNN
F 2 "" H 3350 2100 60 0000 C CNN
F 3 "" H 3350 2100 60 0000 C CNN
@ -183,10 +183,10 @@ Wire Wire Line
2850 1850 2850 1700
Connection ~ 2850 1700
$Comp
L GND #PWR4
L GND #PWR03
U 1 1 54CD148D
P 2850 2350
F 0 "#PWR4" H 2850 2350 30 0001 C CNN
F 0 "#PWR03" H 2850 2350 30 0001 C CNN
F 1 "GND" H 2850 2280 30 0001 C CNN
F 2 "" H 2850 2350 60 0000 C CNN
F 3 "" H 2850 2350 60 0000 C CNN
@ -220,10 +220,10 @@ F 3 "" H 2900 3100 60 0000 C CNN
1 0 0 -1
$EndComp
$Comp
L GND #PWR11
L GND #PWR04
U 1 1 54CD271D
P 3900 2200
F 0 "#PWR11" H 3900 2200 30 0001 C CNN
F 0 "#PWR04" H 3900 2200 30 0001 C CNN
F 1 "GND" H 3900 2130 30 0001 C CNN
F 2 "" H 3900 2200 60 0000 C CNN
F 3 "" H 3900 2200 60 0000 C CNN
@ -233,10 +233,10 @@ $EndComp
Wire Wire Line
3900 2100 3900 2200
$Comp
L GND #PWR9
L GND #PWR05
U 1 1 54CD284F
P 3600 3000
F 0 "#PWR9" H 3600 3000 30 0001 C CNN
F 0 "#PWR05" H 3600 3000 30 0001 C CNN
F 1 "GND" H 3600 2930 30 0001 C CNN
F 2 "" H 3600 3000 60 0000 C CNN
F 3 "" H 3600 3000 60 0000 C CNN
@ -248,10 +248,10 @@ Wire Wire Line
Wire Wire Line
3600 2950 3450 2950
$Comp
L GND #PWR3
L GND #PWR06
U 1 1 54CD287F
P 2200 3150
F 0 "#PWR3" H 2200 3150 30 0001 C CNN
F 0 "#PWR06" H 2200 3150 30 0001 C CNN
F 1 "GND" H 2200 3080 30 0001 C CNN
F 2 "" H 2200 3150 60 0000 C CNN
F 3 "" H 2200 3150 60 0000 C CNN
@ -333,10 +333,10 @@ $EndComp
Wire Wire Line
2000 3250 2350 3250
$Comp
L VCC #PWR12
L VCC #PWR07
U 1 1 54CD31C2
P 4050 1700
F 0 "#PWR12" H 4050 1800 30 0001 C CNN
F 0 "#PWR07" H 4050 1800 30 0001 C CNN
F 1 "VCC" H 4050 1800 30 0000 C CNN
F 2 "" H 4050 1700 60 0000 C CNN
F 3 "" H 4050 1700 60 0000 C CNN
@ -344,10 +344,10 @@ F 3 "" H 4050 1700 60 0000 C CNN
1 0 0 -1
$EndComp
$Comp
L VCC #PWR1
L VCC #PWR08
U 1 1 54CD31E4
P 1500 3250
F 0 "#PWR1" H 1500 3350 30 0001 C CNN
F 0 "#PWR08" H 1500 3350 30 0001 C CNN
F 1 "VCC" H 1500 3350 30 0000 C CNN
F 2 "" H 1500 3250 60 0000 C CNN
F 3 "" H 1500 3250 60 0000 C CNN
@ -361,10 +361,10 @@ power
Text Label 1900 1800 0 60 ~ 0
GND
$Comp
L VCC #PWR7
L VCC #PWR09
U 1 1 54CD3437
P 3750 2950
F 0 "#PWR7" H 3750 3050 30 0001 C CNN
F 0 "#PWR09" H 3750 3050 30 0001 C CNN
F 1 "VCC" H 3750 3050 30 0000 C CNN
F 2 "" H 3750 2950 60 0000 C CNN
F 3 "" H 3750 2950 60 0000 C CNN
@ -432,10 +432,10 @@ Wire Wire Line
Wire Wire Line
6350 2100 6700 2100
$Comp
L VCC #PWR14
L VCC #PWR010
U 1 1 54CD457D
P 6700 2100
F 0 "#PWR14" H 6700 2200 30 0001 C CNN
F 0 "#PWR010" H 6700 2200 30 0001 C CNN
F 1 "VCC" H 6700 2200 30 0000 C CNN
F 2 "" H 6700 2100 60 0000 C CNN
F 3 "" H 6700 2100 60 0000 C CNN
@ -443,10 +443,10 @@ F 3 "" H 6700 2100 60 0000 C CNN
1 0 0 -1
$EndComp
$Comp
L GND #PWR13
L GND #PWR011
U 1 1 54CD4689
P 6450 2000
F 0 "#PWR13" H 6450 2000 30 0001 C CNN
F 0 "#PWR011" H 6450 2000 30 0001 C CNN
F 1 "GND" H 6450 1930 30 0001 C CNN
F 2 "" H 6450 2000 60 0000 C CNN
F 3 "" H 6450 2000 60 0000 C CNN
@ -571,10 +571,10 @@ A4
Text Label 7300 2550 2 60 ~ 0
A5
$Comp
L VCC #PWR5
L VCC #PWR012
U 1 1 54CD9F1D
P 3300 4950
F 0 "#PWR5" H 3300 5050 30 0001 C CNN
F 0 "#PWR012" H 3300 5050 30 0001 C CNN
F 1 "VCC" H 3300 5050 30 0000 C CNN
F 2 "" H 3300 4950 60 0000 C CNN
F 3 "" H 3300 4950 60 0000 C CNN
@ -582,10 +582,10 @@ F 3 "" H 3300 4950 60 0000 C CNN
1 0 0 -1
$EndComp
$Comp
L GND #PWR8
L GND #PWR013
U 1 1 54CDA116
P 3500 4900
F 0 "#PWR8" H 3500 4900 30 0001 C CNN
F 0 "#PWR013" H 3500 4900 30 0001 C CNN
F 1 "GND" H 3500 4830 30 0001 C CNN
F 2 "" H 3500 4900 60 0000 C CNN
F 3 "" H 3500 4900 60 0000 C CNN
@ -601,11 +601,11 @@ Wire Wire Line
Wire Wire Line
3300 5050 3800 5050
$Comp
L C 0.68u
L C C3
U 1 1 54CDA380
P 3600 5450
F 0 "0.68u" H 3600 5550 40 0000 L CNN
F 1 "C3" H 3606 5365 40 0000 L CNN
F 0 "C3" H 3600 5550 40 0000 L CNN
F 1 "0.68u" H 3606 5365 40 0000 L CNN
F 2 "" H 3638 5300 30 0000 C CNN
F 3 "" H 3600 5450 60 0000 C CNN
1 3600 5450
@ -616,10 +616,10 @@ Wire Wire Line
Wire Wire Line
3600 4950 3800 4950
$Comp
L GND #PWR10
L GND #PWR014
U 1 1 54CDA4A6
P 3600 5750
F 0 "#PWR10" H 3600 5750 30 0001 C CNN
F 0 "#PWR014" H 3600 5750 30 0001 C CNN
F 1 "GND" H 3600 5680 30 0001 C CNN
F 2 "" H 3600 5750 60 0000 C CNN
F 3 "" H 3600 5750 60 0000 C CNN

View File

@ -1,13 +1,77 @@
EESchema-LIBRARY Version 2.3 Date: Сб 31 янв 2015 18:14:19
EESchema-LIBRARY Version 2.3
#encoding utf-8
#
# 4-digit,common_cathode
#
DEF 4-digit,common_cathode DIS 0 40 Y Y 1 F N
F0 "DIS" 0 500 60 H V C CNN
F1 "4-digit,common_cathode" 0 -450 60 H V C CNN
F2 "" -450 0 60 H V C CNN
F3 "" -450 0 60 H V C CNN
DRAW
C -520 -320 20 0 1 0 F
C -70 -320 20 0 1 0 F
C 380 -320 20 0 1 0 F
C 830 -320 20 0 1 0 F
S -1150 400 1150 -400 0 1 0 N
P 6 0 1 0 -850 -20 -550 -20 -600 -320 -900 -320 -850 -20 -850 -20 N
P 6 0 1 0 -800 320 -500 320 -550 20 -850 20 -800 320 -800 320 N
P 6 0 1 0 -400 -20 -100 -20 -150 -320 -450 -320 -400 -20 -400 -20 N
P 6 0 1 0 -350 320 -50 320 -100 20 -400 20 -350 320 -350 320 N
P 6 0 1 0 50 -20 350 -20 300 -320 0 -320 50 -20 50 -20 N
P 6 0 1 0 100 320 400 320 350 20 50 20 100 320 100 320 N
P 6 0 1 0 500 -20 800 -20 750 -320 450 -320 500 -20 500 -20 N
P 6 0 1 0 550 320 850 320 800 20 500 20 550 320 550 320 N
X E 1 -1450 250 300 R 50 50 1 1 I
X D 2 -1450 150 300 R 50 50 1 1 I
X DP 3 -1450 50 300 R 50 50 1 1 I
X C 4 -1450 -50 300 R 50 50 1 1 I
X G 5 -1450 -150 300 R 50 50 1 1 I
X DIG4 6 -1450 -250 300 R 50 50 1 1 I
X B 7 1450 -250 300 L 50 50 1 1 I
X DIG3 8 1450 -150 300 L 50 50 1 1 I
X DIG2 9 1450 -50 300 L 50 50 1 1 I
X F 10 1450 50 300 L 50 50 1 1 I
X A 11 1450 150 300 L 50 50 1 1 I
X DIG1 12 1450 250 300 L 50 50 1 1 I
ENDDRAW
ENDDEF
#
# ARK-SN410362N
#
DEF ARK-SN410362N DIS 0 40 Y Y 1 F N
F0 "DIS" 0 500 60 H V C CNN
F1 "ARK-SN410362N" 0 -450 60 H V C CNN
F2 "" 0 0 60 H V C CNN
F3 "" 0 0 60 H V C CNN
DRAW
C -70 -320 20 0 1 0 F
C 430 -320 20 0 1 0 F
S 550 -400 -550 450 0 1 0 N
P 6 0 1 0 -400 -20 -100 -20 -150 -320 -450 -320 -400 -20 -400 -20 N
P 6 0 1 0 -350 320 -50 320 -100 20 -400 20 -350 320 -350 320 N
P 6 0 1 0 100 -20 400 -20 350 -320 50 -320 100 -20 100 -20 N
P 6 0 1 0 150 320 450 320 400 20 100 20 150 320 150 320 N
X G 1 -850 300 300 R 50 50 1 1 I
X DP 2 -850 150 300 R 50 50 1 1 I
X A 3 -850 0 300 R 50 50 1 1 I
X F 4 -850 -150 300 R 50 50 1 1 I
X DIG2 5 -850 -300 300 R 50 50 1 1 I
X D 6 850 -300 300 L 50 50 1 1 I
X E 7 850 -150 300 L 50 50 1 1 I
X C 8 850 0 300 L 50 50 1 1 I
X B 9 850 150 300 L 50 50 1 1 I
X DIG1 10 850 300 300 L 50 50 1 1 I
ENDDRAW
ENDDEF
#
# ARK-SP410361N
#
DEF ARK-SP410361N DIS 0 40 Y Y 1 F N
F0 "DIS" 0 500 60 H V C CNN
F1 "ARK-SP410361N" 0 -450 60 H V C CNN
F2 "~" -250 0 60 H V C CNN
F3 "~" -250 0 60 H V C CNN
F2 "" -250 0 60 H V C CNN
F3 "" -250 0 60 H V C CNN
DRAW
C -320 -320 20 0 1 0 F
C 130 -320 20 0 1 0 F
@ -34,34 +98,4 @@ X DIG1 12 1050 250 300 L 50 50 1 1 I
ENDDRAW
ENDDEF
#
#
# ARK-SN410362N
#
DEF ARK-SN410362N DIS 0 40 Y Y 1 F N
F0 "DIS" 0 500 60 H V C CNN
F1 "ARK-SN410362N" 0 -450 60 H V C CNN
F2 "~" 0 0 60 H V C CNN
F3 "~" 0 0 60 H V C CNN
DRAW
C -70 -320 20 0 1 0 F
C 430 -320 20 0 1 0 F
S 550 -400 -550 450 0 1 0 N
P 6 0 1 0 -400 -20 -100 -20 -150 -320 -450 -320 -400 -20 -400 -20 N
P 6 0 1 0 -350 320 -50 320 -100 20 -400 20 -350 320 -350 320 N
P 6 0 1 0 100 -20 400 -20 350 -320 50 -320 100 -20 100 -20 N
P 6 0 1 0 150 320 450 320 400 20 100 20 150 320 150 320 N
X G 1 -850 300 300 R 50 50 1 1 I
X DP 2 -850 150 300 R 50 50 1 1 I
X A 3 -850 0 300 R 50 50 1 1 I
X F 4 -850 -150 300 R 50 50 1 1 I
X DIG2 5 -850 -300 300 R 50 50 1 1 I
X D 6 850 -300 300 L 50 50 1 1 I
X E 7 850 -150 300 L 50 50 1 1 I
X C 8 850 0 300 L 50 50 1 1 I
X B 9 850 150 300 L 50 50 1 1 I
X DIG1 10 850 300 300 L 50 50 1 1 I
ENDDRAW
#
ENDDEF
#End Library

View File

@ -21,6 +21,7 @@
#include "stm8l.h"
#include "interrupts.h"
#include "soft_i2c.h"
// Top Level Interrupt
INTERRUPT_HANDLER(TLI_IRQHandler, 0){}
@ -85,26 +86,15 @@ INTERRUPT_HANDLER(TIM5_CAP_COM_IRQHandler, 14){}
INTERRUPT_HANDLER(TIM2_UPD_OVF_BRK_IRQHandler, 13){}
// Timer2 Capture/Compare Interrupt
// store the current counter value and wait for next pulse
// process soft I2C
INTERRUPT_HANDLER(TIM2_CAP_COM_IRQHandler, 14){
/*
TIM2_CR1 = 0; // stop timer
if(TIM2_SR2){ // overcapture: noice etc.
TIM2_SR2 = 0;
TIM2_SR1 = 0;
ZW_off();
return;
if(TIM2_SR1 & TIM_SR1_UIF){
TIM2_SR1 &= ~TIM_SR1_UIF; // take off flag
tick_counter++;
process_soft_I2C();
}
ZW_catch_bit();
TIM2_SR1 = 0;
TIM2_CNTRH = 0;
TIM2_CNTRL = 0;
*/
}
/*
TIM2_CCMR2 = 1; // IC2 is mapped on TI2FP2
TIM2_CCMR1 = 2; // IC1 is mapped on TI2FP1
*/
#endif // STM8S903
#if defined (STM8S208) || defined(STM8S207) || defined(STM8S007) || defined(STM8S105) || \

View File

@ -22,6 +22,7 @@
#include "main.h"
#include "interrupts.h"
#include "led.h"
#include "soft_i2c.h"
U32 Global_time = 0L; // global time in ms
eeprom_data *saved_data = (eeprom_data*)EEPROM_START_ADDR;
@ -66,7 +67,8 @@ void eeprom_default_setup(){
int main() {
U32 T_LED = 0L; // time of last digit update
U32 T_time = 0L; // timer
long voltage = 0L;
U8 cntr = 0;
// Configure clocking
CLK_CKDIVR = 0; // F_HSI = 16MHz, f_CPU = 16MHz
// Configure pins
@ -103,18 +105,46 @@ int main() {
TIM2_IER = TIM_IER_CC2IE;
*/
eeprom_default_setup();
soft_I2C_setup();
soft_I2C_write_config(0xd0, 0x1c); // write configuration
// enable all interrupts
enableInterrupts();
set_display_buf("-----"); // on init show -----
// Loop
do {
if(((unsigned int)(Global_time - T_time) > 1000) || (T_time > Global_time)){ // once per 3 seconds we start measurement
// onse per 300ms refresh displayed value
if(((unsigned int)(Global_time - T_time) > 300) || (T_time > Global_time)){
T_time = Global_time;
display_long(testtimer++,0);
switch (soft_I2C_state){
case SOFT_I2C_NO_DEVICE:
set_display_buf(" EEE "); // error
break;
default: // refresh data
voltage /= cntr;
display_long(voltage, 1);
cntr = 0;
voltage = 0;
}
//display_long(testtimer++,0);
}
if((U8)(Global_time - T_LED) > LED_delay){
if(soft_I2C_state == SOFT_I2C_DATA_READ_OK){
if((readed_data & 1<<7) == 0){ // !RDY == 0
readed_data >>= 8;
// prepare data for rounded output
voltage += (long)(readed_data & 0x3ffff);
cntr++;
}
}
T_LED = Global_time;
show_next_digit();
// refresh data
if(soft_I2C_state == SOFT_I2C_NO_DEVICE){ // try to repeat writing config after an error
soft_I2C_write_config(0xd0, 0x1c);
}else{
soft_I2C_read4bytes(0xd0);
}
}
} while(1);
}

View File

@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#pragma once
#ifndef __MAIN_H__
#define __MAIN_H__
#include "stm8l.h"
@ -31,3 +34,7 @@ typedef struct{
U32 max_ADU;
}eeprom_data;
#define CONCAT(a,b) a##_##b
#define PORT(a,b) CONCAT(a,b)
#endif // __MAIN_H__

View File

@ -0,0 +1,203 @@
/*
* soft_i2c.c - functions emulating I2C
*
* Copyright 2015 Edward V. Emelianoff <eddy@sao.ru>
*
* 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 "soft_i2c.h"
#include "main.h"
// data to transmit: MSB is devaddr, LSB is configuration byte
U16 transmit_cmd;
// == 0 when transmission is in progress
U8 transmission_over = 1;
// tick counter: two ticks for one bit writting and two ticks for empty
U8 tick_counter;
soft_I2C_errors soft_I2C_state = SOFT_I2C_BUSY;
U16 tr_mask = 0; // mask that would be &`ded with transmit_cmd
U32 readed_data; // data readed by I2C
U32 rd_counter = 0; // counter of readed bits == 64 in start of reading; decrements in each readed bit
/*
********************* GPIO (page 111) ********************
* Px_ODR - Output data register bits
* Px_IDR - Pin input values
* Px_DDR - Data direction bits (1 - output)
* Px_CR1 - DDR=0: 0 - floating, 1 - pull-up input; DDR=1: 0 - pseudo-open-drain, 1 - push-pull output [not for "T"]
* Px_CR2 - DDR=0: 0/1 - EXTI disabled/enabled; DDR=1: 0/1 - 2/10MHz
*
*/
/**
* configure pins: SDA - open-drain output
* SCL - push/pull
* configure timer2 as CLK (default speed is 100kHz)
*/
void soft_I2C_setup(){
PORT(I2C_SCL_PORT, DDR) |= I2C_SCL_PIN;
PORT(I2C_SDA_PORT, DDR) |= I2C_SDA_PIN;
PORT(I2C_SDA_PORT, CR1) |= I2C_SDA_PIN;
// Configure timer 2 to generate signals for CLK
TIM2_PSCR = 0; // 16MHz
TIM2_IER = TIM_IER_UIE; // update interrupt enable
TIM2_CR1 |= TIM_CR1_APRE | TIM_CR1_URS; // auto reload + interrupt on overflow
TIM2_ARRH = 0; // set 2.5ms period (100kHz)
TIM2_ARRL = 10;
}
/**
* Set speed of soft I2C
* @param Pulse_len - period (in us) of one pulse
*/
void soft_I2C_set_speed(U16 Pulse_len){
Pulse_len << 2; // multiply on 4 as we have four pulses for each bit, each pulse is 62.5ns
TIM2_ARRH = Pulse_len >> 8; // set speed
TIM2_ARRL = Pulse_len & 0xff;
}
/*
* The data transmission runs only when SCL==1 & SDA have constant level,
* otherwice, if SCL==1 and SDA changes, this is: START(1->0) or STOP(0->1)
*/
void i2c_transmit(){
soft_I2C_state = SOFT_I2C_BUSY;
transmission_over = 0;
tick_counter = 0;
rd_counter = 0;
readed_data = 0;
TIM2_CR1 |= TIM_CR1_CEN; // turn on timer
}
/**
* write a byte to config register of device dev
* @param dev - device address
* @param conf - configuration byte data
*/
U8 soft_I2C_write_config(U8 dev, U8 conf){
if(!transmission_over || (TIM2_CR1&TIM_CR1_CEN)) return SOFT_I2C_BUSY;
dev &= 0xfe; // make sure that r/!w clear
transmit_cmd = dev<<8 || conf;
i2c_transmit();
return SOFT_I2C_OK;
}
/**
* prepare to read 4 bytes of data
* @param dev - device address
*/
U8 soft_I2C_read4bytes(U8 dev){
if(!transmission_over || (TIM2_CR1&TIM_CR1_CEN)) return SOFT_I2C_BUSY;
dev |= 1; // make sure that r/!w is set
transmit_cmd = dev<<8;
i2c_transmit();
return SOFT_I2C_OK;
}
void process_soft_I2C(){
U8 nbit, bitinbyte, tick; // bit number
if(transmission_over){
TIM2_CR1 &= ~TIM_CR1_CEN; // turn off timer
// return line to NOT BUSY state
PORT(I2C_SCL_PORT, ODR) |= I2C_SCL_PIN;
PORT(I2C_SDA_PORT, ODR) |= I2C_SDA_PIN;
return;
}
nbit = tick_counter >> 2; // divide by 4
if(nbit == 0){ // start
switch (tick_counter){
case 1: // 2nd half of start pulse
PORT(I2C_SDA_PORT, ODR) &= ~I2C_SDA_PIN; // clear SDA - Start bit
break;
case 3: // turn to zero both SCL & SDA
PORT(I2C_SCL_PORT, ODR) &= ~I2C_SCL_PIN; // clear SCL, SDA is already cleared
break;
default: // keep current state
;
}
tr_mask = 1<<15; // MSB first
return;
}
bitinbyte = (nbit-1) % 9; // bit counter in each byte
tick = tick_counter % 4; // this is a tick inside bit
// now prepare data
if(bitinbyte == 8){ // ACK
switch (tick){
case 0: // ACK bit
if(nbit == 9) // check line - set ACK to 1
PORT(I2C_SDA_PORT, ODR) |= I2C_SDA_PIN;
else // set ACK to 0 - we are in reading mode
PORT(I2C_SDA_PORT, ODR) &= ~I2C_SDA_PIN;
break;
case 1: // check ACK
if(nbit == 9 && (PORT(I2C_SDA_PORT, ODR) & I2C_SDA_PIN)){ // not zero - very bad
transmission_over = 1;
soft_I2C_state = SOFT_I2C_NO_DEVICE;
return;
}
break;
default: // do nothing
;
}
}else{//data transmision; or STOP
if((tr_mask == 0) && (rd_counter == 0)){ // data sent, now we should send STOP in write mode
// in reading mode - send STOP only when rd_mask == 0
if(tick == 1){ // STOP is 0->1 when CLK is high
PORT(I2C_SDA_PORT, ODR) |= I2C_SDA_PIN;
transmission_over = 1;
if(transmit_cmd & 1<<8) // reading mode
soft_I2C_state = SOFT_I2C_DATA_READ_OK;
else // writting mode
soft_I2C_state = SOFT_I2C_DATA_SEND_OK;
}
}
if(tick == 0){ // start of bit
if(tr_mask){ // transmission
if(transmit_cmd & tr_mask){ // send one
PORT(I2C_SDA_PORT, ODR) |= I2C_SDA_PIN;
} // if we need to send 0, we already have data in zero state
tr_mask >>= 1;
// stop transmission after first byte in read mode
if((tr_mask == 1<<7) && (transmit_cmd & 1<<8)){ // go to reading mode
tr_mask = 0;
rd_counter = 64;
}
}
}else if(tick == 1){ // capture readed data
if((tr_mask == 0) && (transmit_cmd & 1<<8)){ // we are waiting for data
rd_counter--;
readed_data <<= 1;
if(PORT(I2C_SDA_PORT, IDR) & I2C_SDA_PIN) // read 1
readed_data |= 1;
}
}
}
// and at last - set level of SCL
switch (tick){ // set proper value of SCL
case 0: // high pulse
PORT(I2C_SCL_PORT, ODR) |= I2C_SCL_PIN;
break;
case 3: // low pulse & clear SDA
PORT(I2C_SDA_PORT, ODR) &= ~I2C_SDA_PIN;
PORT(I2C_SCL_PORT, ODR) &= ~I2C_SCL_PIN;
break;
default: // do nothing
;
}
}

View File

@ -0,0 +1,52 @@
/*
* soft_i2c.h
*
* Copyright 2015 Edward V. Emelianoff <eddy@sao.ru>
*
* 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 __SOFT_I2C_H__
#define __SOFT_I2C_H__
#include "stm8l.h"
// SDA - PC7, SCL - PD1
#define I2C_SDA_PORT PC
#define I2C_SDA_PIN GPIO_PIN7
#define I2C_SCL_PORT PD
#define I2C_SCL_PIN GPIO_PIN1
typedef enum{
SOFT_I2C_OK // all OK
,SOFT_I2C_BUSY // previous transmission is active
,SOFT_I2C_NO_DEVICE // no device found
,SOFT_I2C_DATA_SEND_OK // data transmitted without errors
,SOFT_I2C_DATA_READ_OK // data readed without errors
} soft_I2C_errors;
extern soft_I2C_errors soft_I2C_state;
extern U32 readed_data;
extern U8 tick_counter;
void soft_I2C_setup();
void soft_I2C_set_speed(U16 Pulse_len);
void process_soft_I2C();
U8 soft_I2C_write_config(U8 dev, U8 conf);
U8 soft_I2C_read4bytes(U8 dev);
#endif // __SOFT_I2C_H__

Binary file not shown.