SafeASP - Schematic by section

Three sheets, simplified symbols, with the parts of each sheet; the same Sheet 1, 2, 3 as on the BOM and Wiring pages. Draw the real schematic in EasyEDA.

Design stage. Planned design, not a finished schematic or PCB and not built yet: nets come from tools/data.py, pin numbers of U1, U4, U5 were read from the datasheets, but every symbol and footprint must still be checked in EasyEDA.

Jump to: U1 ATmega8A pin guide · U4 / U5 level-shifter pins · J1 USB-C pins

Planning drawing. Symbols are simplified: draw the real schematic in EasyEDA from this page and the Wiring page. Check all pin numbers in the EasyEDA symbols.

Setup in EasyEDA

1. Open EasyEDA Pro (web), new project SafeASP (USBasp V6) with one schematic and one PCB.
2. Make 3 schematic sheets named as above (1_USB_POWER, 2_MCU, 3_SHIFT_ISP).
3. Place parts by searching the LCSC number (C#) in the library search; set the Designator to the Ref in the table.
4. Use net labels for every connection that leaves a page; use the same name on both pages. Names are case-sensitive.
5. Run the schematic check after each page and fix every warning.

Sheet 1: USB-C, V-USB interface, target power

J1 USB-CTYPE-C-31-M-12VBUSGNDCC1CC2D+ (A6,B6)D- (A7,B7)VBUSR1 5.1kR2 5.1kC2100nU2USBLC6-2SC6I/O1 1,6I/O2 3,4VBUS 5GND 2USB_DP_JUSB_DN_JF1PTC 500 mA+5VC110uV-USB line interface (as the original USBasp): 68 R series, 3.6 V zener clamps, 2.2 k pull-up on D-USB_DP_JR368RD13.6 V zenerUSB_DPUSB_DN_JR468RD23.6 V zenerUSB_DNR52.2k+5VUSB_DP goes to PB1 (pin 13) AND PD2 / INT0 (pin 32)USB_DN goes to PB0 (pin 12)(USBasp usbconfig.h: D- = PB0, D+ = PB1, interrupt INT0)Zener: cathode (bar) on the data line, anode to GND.Target power: JP1 picks 5 V, 3.3 V or nothing; F2 limits a shorted targetU3AP2112K-3.3VIN 1EN 3VOUT 5GND 2+5VC810u+3V3C910uJP11x3 header1 5V2 OUT3 3V3+5Vjumper 1-2 = 5 V to the targetjumper 2-3 = 3.3 V to the targetno jumper = target has its own supplyVTGT_SUPF2PTC 200 mAVTGTto U4 / U5 VCCB and ISP pin 2R91kLED3yellowVTGT_SUPLED3 shows that THIS board is powering the target (it sits before F2, so it does not load a self-powered target).

Nets leaving this page: +5V, +3V3, VTGT, GND, USB_DP, USB_DN.

Zener orientation: the bar (cathode) on the data line. The USB-C shell must go to GND.

Parts of this sheet

RefQtyFunctionPartLCSC
J11USB-C 16-pin receptacle (USB 2.0)TYPE-C-31-M-12C165948
R1, R225.1 k 12061206W4F5101T5EC26033
U21USBLC6-2SC6 ESD on D+ / D-USBLC6-2SC6C7519
F11PTC 500 mA 1206, VBUS to +5V1206L050YRC163512
C21100 nF 1206 on VBUSCL31B104KBCNNNCC24497
R3, R4268 R 12061206W4F680JT5EC17976
D1, D223.6 V zenerBZT52C3V6-TPC725453
R512.2 k 1206, D- pull-up (low speed)1206W4F2201T5EC17948
C1, C8, C9310 uF 1206CL31A106KAHNNNEC9807
U31AP2112K-3.3 LDO, SOT-25AP2112K-3.3TRG1C51118
JP111x3 header: target supply 5 V (1-2) / 3.3 V (2-3) / offPZ254V-11-03PC492402
F21PTC 200 mA 1206, target supply limit1206L020YRC207035
LED31Yellow LED: powering the targetXL-1608UYC-04C965803
R911 k 1206, LED3 series1206W4F1001T5EC4410
Build steps (tick as you draw this sheet)
1. J1 USB-C (C165948): VBUS pins (A4B9, B4A9) to VBUS, GND pins and the 4 shell tabs to GND, A5 CC1 to R1 5.1 k to GND, B5 CC2 to R2 5.1 k to GND (two separate resistors!), SBU1 / SBU2 No-Connect.
2. D+ pins A6 and B6 joined = USB_DP_J, D- pins A7 and B7 joined = USB_DN_J. U2 USBLC6: pins 1 and 6 to USB_DP_J, pins 3 and 4 to USB_DN_J, pin 5 VBUS, pin 2 GND. C2 100 nF on VBUS.
3. F1 PTC 500 mA from VBUS to +5V. C1 10 uF on +5V.
4. R3 68 R from USB_DP_J to USB_DP, R4 68 R from USB_DN_J to USB_DN. D1 zener: cathode USB_DP, anode GND. D2 zener: cathode USB_DN, anode GND. R5 2.2 k from +5V to USB_DN.
5. U3 AP2112K: pin 1 VIN and pin 3 EN to +5V, pin 2 GND, pin 5 VOUT to +3V3, pin 4 No-Connect. C8 10 uF on +5V, C9 10 uF on +3V3.
6. JP1 1x3: pin 1 +5V, pin 2 VTGT_SUP, pin 3 +3V3. F2 PTC 200 mA from VTGT_SUP to VTGT. R9 1 k from VTGT_SUP to LED3 (yellow) anode, cathode to GND.

Sheet 2: ATmega8A core

U1ATmega8A-AU (TQFP-32)29 RESET7 XTAL18 XTAL24 VCC6 VCC18 AVCC3 GND5 GND21 GND12 PB013 PB132 PD2/INT014 PB215 PB3/MOSI16 PB4/MISO17 PB5/SCK23 PC024 PC125 PC2USB_DNUSB_DPUSB_DPRST_MMOSI_MMISO_MSCK_MLED_G_KBUSY_NSLOW_SCK+5V+5V+5VMCU_RSTXTAL1XTAL2Not connected (No-Connect flag): pins 1, 2, 9, 10, 11 (PD3-PD7), 19, 22 (ADC6/7), 20 (AREF), 26-28 (PC3-PC5), 30, 31 (PD0/PD1).12 MHz crystalXTAL1C322pXTAL2C422pY112 MHzY1 pads 2 and 4 (case) to GNDReset and decoupling+5VR610kMCU_RST+5VC5100n pin 4+5VC6100n pin 6+5VC7100n AVCC 18Status LEDs (active low, as the USBasp firmware)+5VR71kLED1red: programmingBUSY_N+5VR81kLED2green: USB readyLED_G_KBUSY_N (PC1) also drives U4 OE# on sheet 3.J4: port to flash THIS ATmega8A (another programmer plugs in here). JP2: slow SCK jumper.J42x3 header1 MISO3 SCK5 RST2 VCC4 MOSI6 GNDMISO_MSCK_MMCU_RST+5VMOSI_MJP21x2 header12SLOW_SCKFit JP2 when the target clock is below 1.5 MHz(SCK drops from 375 kHz to about 8 kHz;PC2 uses the firmware's internal pull-up).Unplug USB-C while flashing through J4.

Every _M net here appears again on sheet 3 (U4 / U5). BUSY_N is used three times: PC1, LED1 cathode, U4 OE# (+ R10).

Pin numbers are TQFP-32 numbers, not the DIP-28 numbers of the old v4 / v5 boards.

Parts of this sheet

RefQtyFunctionPartLCSC
U11ATmega8A-AU, TQFP-32ATMEGA8A-AUC16190
Y1112 MHz crystal 3225X322512MSB4SIC9002
C3, C4222 pF 0805CL21C220JBANNNCC1804
C5, C6, C73100 nF 1206CL31B104KBCNNNCC24497
R6110 k 1206, RESET pull-up1206W4F1002T5EC17902
LED11Red LED: programming (PC1 low)XL-1608SURC-04C965798
R7, R821 k 12061206W4F1001T5EC4410
LED21Green LED: USB ready (PC0 low)19-217/GHC-YR1S2/6TC2986059
J412x3 header: flash THIS ATmega8A (self-programming port)2.54-2*3PC65114
JP211x2 header: slow SCK jumper (PC2 to GND)PZ254V-11-02PC492401
Build steps (tick as you draw this sheet)
1. Place U1 ATmega8A-AU (C16190). Pins 4, 6 and 18 (AVCC) to +5V, pins 3, 5, 21 to GND. C5, C6, C7 100 nF, one next to each supply pin.
2. Crystal: pin 7 XTAL1, pin 8 XTAL2 to Y1 pads 1 and 3; Y1 pads 2 and 4 to GND; C3 22 pF XTAL1-GND, C4 22 pF XTAL2-GND.
3. Pin 29 RESET = MCU_RST with R6 10 k to +5V.
4. USB: pin 12 PB0 = USB_DN; pin 13 PB1 AND pin 32 PD2 = USB_DP (both pins on the same net).
5. ISP (5 V side): pin 14 PB2 = RST_M, pin 15 PB3 = MOSI_M, pin 16 PB4 = MISO_M, pin 17 PB5 = SCK_M.
6. LEDs: R7 1 k from +5V to LED1 (red) anode, LED1 cathode to pin 24 PC1 = BUSY_N. R8 1 k from +5V to LED2 (green) anode, cathode to pin 23 PC0 = LED_G_K.
7. JP2 1x2: pin 1 to pin 25 PC2 = SLOW_SCK, pin 2 GND. J4 2x3: 1 MISO_M, 2 +5V, 3 SCK_M, 4 MOSI_M, 5 MCU_RST, 6 GND.
8. No-Connect flags on pins 1, 2, 9, 10, 11, 19, 20, 22, 26, 27, 28, 30, 31.

Sheet 3: Level shifter and ISP headers

U474LVC8T245PW (TSSOP-24)1 VCCA2 DIR3 A14 A25 A36-10 A4..A822 OE#24,23 VCCB21 B120 B219 B318-14 B4..B811-13 GND+5V+5V (A to B)MOSI_MSCK_MRST_Munused A inputs to GNDBUSY_NVTGTMOSI_TSCK_TRST_Tno connectU574LVC1T45GW (SC-88)1 VCCA3 A5 DIR6 VCCB4 B2 GND+5VMISO_MDIR low = B to AVTGTMISO_TDecoupling, OE# pull-up, A-side pull-downs+5VC10100nU4 VCCAVTGTC11100nU4 VCCB+5VC12100nU5 VCCAVTGTC13100nU5 VCCB+5VR1010kBUSY_NMOSI_MR11100kSCK_MR12100kRST_MR13100kR10 keeps OE# high (outputs off) while the ATmega8A is in reset or unprogrammed. R11-R13 stop the A inputs floating when the firmware releases the ISP pins.J22x5 box header (10-pin ISP)1 MOSI3 NC5 RST7 SCK9 MISO2 VCC4 GND6 GND8 GND10 GNDMOSI_TRST_TSCK_TMISO_Tno connectVTGTJ32x3 header (6-pin ISP)1 MISO3 SCK5 RST2 VCC4 MOSI6 GNDMISO_TSCK_TRST_TVTGTMOSI_TPin 1 = the corner with the square pad / the arrow on the box header.

Target-side nets end in _T. VTGT is both the target supply (when JP1 is fitted) and the level-shifter supply: no voltage on ISP pin 2 = outputs off.

Both VCC pins of U4 (23, 24) must be connected.

Parts of this sheet

RefQtyFunctionPartLCSC
U4174LVC8T245PW 8-bit dual-supply transceiver, TSSOP-2474LVC8T245PWC458788
U5174LVC1T45GW 1-bit dual-supply transceiver (MISO back), SC-8874LVC1T45GW,125C478004
C10, C11, C12, C134100 nF 1206CL31B104KBCNNNCC24497
R10110 k 1206, OE# pull-up (outputs off while the ATmega8A is in reset)1206W4F1002T5EC17902
R11, R12, R133100 k 12061206W4F1003T5EC17900
J212x5 box header: standard AVR 10-pin ISP2.54-2*5PC5665
J312x3 header: standard AVR 6-pin ISP2.54-2*3PC65114
Build steps (tick as you draw this sheet)
1. U4 74LVC8T245PW (C458788): pin 1 VCCA and pin 2 DIR to +5V (DIR high = A to B). Pins 23 and 24 VCCB to VTGT. Pins 11, 12, 13 GND.
2. U4 A side: pin 3 A1 = MOSI_M, pin 4 A2 = SCK_M, pin 5 A3 = RST_M, pins 6-10 (A4-A8) to GND. B side: pin 21 B1 = MOSI_T, pin 20 B2 = SCK_T, pin 19 B3 = RST_T, pins 14-18 No-Connect.
3. U4 pin 22 OE# = BUSY_N (the red-LED line) with R10 10 k to +5V.
4. U5 74LVC1T45GW (C478004): pin 1 VCCA +5V, pin 2 GND, pin 3 A = MISO_M, pin 4 B = MISO_T, pin 5 DIR to GND (B to A), pin 6 VCCB = VTGT.
5. C10 / C12 100 nF on +5V at U4 / U5, C11 / C13 100 nF on VTGT at U4 / U5. R11, R12, R13 100 k from MOSI_M, SCK_M, RST_M to GND.
6. J2 2x5 box header: 1 MOSI_T, 2 VTGT, 3 No-Connect, 4/6/8/10 GND, 5 RST_T, 7 SCK_T, 9 MISO_T. J3 2x3: 1 MISO_T, 2 VTGT, 3 SCK_T, 4 MOSI_T, 5 RST_T, 6 GND.

Pin guide: U1 ATmega8A-AU (TQFP-32, all 32 pins)

Top view as the footprint sits on the PCB: dot = pin 1 corner, pins 1-8 down the left, 9-16 along the bottom, 17-24 up the right, 25-32 along the top. Pin names and numbers from the Microchip ATmega8A datasheet, figure 1-1. Red X = place a No-Connect flag.

GND+5VUSBISP (to U4 / U5)LED / jumper / resetcrystal= No-Connect flagATmega8A-AUTQFP-32, top view1PD39PD517SCK_M PB5 SCK25SLOW_SCK PC22PD410PD618+5V AVCC26PC33GND GND11PD719ADC627PC44+5V VCC12USB_DN PB020AREF28PC55GND GND13USB_DP PB121GND GND29MCU_RST PC6 RESET6+5V VCC14RST_M PB222ADC730PD07XTAL1 PB6 XTAL115MOSI_M PB3 MOSI23LED_G_K PC031PD18XTAL2 PB7 XTAL216MISO_M PB4 MISO24BUSY_N PC132USB_DP PD2 INT0

What to do on each pin

PinNetAlso on this net
1 PD3No-Connect flag
2 PD4No-Connect flag
3 GNDGNDrail
4 VCC+5Vrail
5 GNDGNDrail
6 VCC+5Vrail
7 PB6 XTAL1XTAL1Y1.1, C3.1
8 PB7 XTAL2XTAL2Y1.3, C4.1
9 PD5No-Connect flag
10 PD6No-Connect flag
11 PD7No-Connect flag
12 PB0USB_DNR4.2, D2.K, R5.2
13 PB1USB_DPR3.2, D1.K
14 PB2RST_MU4.5, R13.1
15 PB3 MOSIMOSI_MJ4.4, U4.3, R11.1
16 PB4 MISOMISO_MJ4.1, U5.3
17 PB5 SCKSCK_MJ4.3, U4.4, R12.1
18 AVCC+5Vrail
19 ADC6No-Connect flag
20 AREFNo-Connect flag
21 GNDGNDrail
22 ADC7No-Connect flag
23 PC0LED_G_KLED2.K
24 PC1BUSY_NLED1.K, U4.22, R10.2
25 PC2SLOW_SCKJP2.1
26 PC3No-Connect flag
27 PC4No-Connect flag
28 PC5No-Connect flag
29 PC6 RESETMCU_RSTR6.2, J4.5
30 PD0No-Connect flag
31 PD1No-Connect flag
32 PD2 INT0USB_DPR3.2, D1.K

Pin guide: U4 74LVC8T245PW and U5 74LVC1T45GW

From the Nexperia datasheets (pin description and function tables): U4 DIR high = A to B, OE# high = all outputs Hi-Z; U5 DIR low = B to A. If either supply is 0 V, both parts go to suspend mode (all pins Hi-Z).

U4

PinNetAlso on this net
1 VCCA+5Vrail
2 DIR+5Vrail
3 A1MOSI_MU1.15, J4.4, R11.1
4 A2SCK_MU1.17, J4.3, R12.1
5 A3RST_MU1.14, R13.1
6 A4GNDrail
7 A5GNDrail
8 A6GNDrail
9 A7GNDrail
10 A8GNDrail
11 GNDGNDrail
12 GNDGNDrail
13 GNDGNDrail
14 B8No-Connect flag
15 B7No-Connect flag
16 B6No-Connect flag
17 B5No-Connect flag
18 B4No-Connect flag
19 B3RST_TJ2.5, J3.5
20 B2SCK_TJ2.7, J3.3
21 B1MOSI_TJ2.1, J3.4
22 OE#BUSY_NU1.24, LED1.K, R10.2
23 VCCBVTGTF2.2, U5.6, C11.1, C13.1, J2.2, J3.2
24 VCCBVTGTF2.2, U5.6, C11.1, C13.1, J2.2, J3.2

U5

PinNetAlso on this net
1 VCCA+5Vrail
2 GNDGNDrail
3 AMISO_MU1.16, J4.1
4 BMISO_TJ2.9, J3.1
5 DIRGNDrail
6 VCCBVTGTF2.2, U4.23, U4.24, C11.1, C13.1, J2.2, J3.2

Pin guide: J1 USB-C (TYPE-C-31-M-12)

PinNetAlso on this net
A4B9 VBUSVBUSU2.5, F1.1, C2.1
B4A9 VBUSVBUSU2.5, F1.1, C2.1
A1B12 GNDGNDrail
B1A12 GNDGNDrail
A5 CC1CC1R1.1
B5 CC2CC2R2.1
A6 DP1USB_DP_JU2.1, U2.6, R3.1
B6 DP2USB_DP_JU2.1, U2.6, R3.1
A7 DN1USB_DN_JU2.3, U2.4, R4.1
B7 DN2USB_DN_JU2.3, U2.4, R4.1
A8 SBU1No-Connect flag
B8 SBU2No-Connect flag
EH1-4 shellGNDrail

Final checks

1. Every net label is used at least twice. One GND, one +5V, one +3V3, one VTGT.
2. Compare the part count with the BOM page (45 pieces).
3. Compare every footprint with its datasheet before the layout: C165948 USB-C, TQFP-32 (0.8 mm pitch), TSSOP-24, SC-88, 3225 crystal, box header key position.
4. Check USB_DP is on BOTH U1 pin 13 and pin 32.
5. Export the schematic PDF and send it for a check.