Skip to content

Commit ad2ef9b

Browse files
Couple more days
1 parent 3c4716e commit ad2ef9b

File tree

4 files changed

+143
-0
lines changed

4 files changed

+143
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
## Some slight progress
2+
3+
It's very slight, like very very slight. I got some parts in today, but I really don't have time to do much. I did get an arduino programmer built, using an arduino nano to program [ATMEGA328P chips](https://www.jameco.com/Jameco/Products/ProdDS/2303943.pdf). The pinout is kinda funky but it works. Here's a thing that I generated.
4+
5+
## ATmega328P Pinout for Arduino
6+
7+
This table maps **Arduino pin numbers** (used in sketches) to the **ATmega328P physical pins** (28-pin DIP package), their **port/bit designations**, and **special functions**. This is useful for programming a bare ATmega328P on a breadboard, such as when using an Arduino Nano as an ISP programmer with a 16 MHz crystal and 20pF capacitors.
8+
9+
### Pin Mapping Table
10+
11+
| Arduino Pin | ATmega328P Physical Pin | Port/Bit | Special Functions |
12+
|-------------|-------------------------|----------|-------------------|
13+
| D0 (RX) | 2 | PD0 | UART RX, PCINT16 |
14+
| D1 (TX) | 3 | PD1 | UART TX, PCINT17 |
15+
| D2 | 4 | PD2 | INT0, PCINT18 |
16+
| D3 | 5 | PD3 | INT1, PWM (OC2B), PCINT19 |
17+
| D4 | 6 | PD4 | PCINT20 |
18+
| D5 | 11 | PD5 | PWM (OC0B), PCINT21 |
19+
| D6 | 12 | PD6 | PWM (OC0A), PCINT22 |
20+
| D7 | 13 | PD7 | PCINT23 |
21+
| D8 | 14 | PB0 | PCINT0 |
22+
| D9 | 15 | PB1 | PWM (OC1A), PCINT1 |
23+
| D10 | 16 | PB2 | SS (SPI), PWM (OC1B), PCINT2 |
24+
| D11 | 17 | PB3 | MOSI (SPI), PWM (OC2A), PCINT3 |
25+
| D12 | 18 | PB4 | MISO (SPI), PCINT4 |
26+
| D13 | 19 | PB5 | SCK (SPI), PCINT5 |
27+
| A0 | 23 | PC0 | ADC0, PCINT8 |
28+
| A1 | 24 | PC1 | ADC1, PCINT9 |
29+
| A2 | 25 | PC2 | ADC2, PCINT10 |
30+
| A3 | 26 | PC3 | ADC3, PCINT11 |
31+
| A4 | 27 | PC4 | ADC4, SDA (I2C), PCINT12 |
32+
| A5 | 28 | PC5 | ADC5, SCL (I2C), PCINT13 |
33+
34+
### Non-I/O Pins
35+
36+
| Function | ATmega328P Physical Pin | Port/Bit | Notes |
37+
|----------|-------------------------|----------|-------|
38+
| VCC | 7, 20 | - | 5V power |
39+
| GND | 8, 22 | - | Ground |
40+
| RESET | 1 | PC6 | Active-low reset |
41+
| XTAL1 | 9 | - | Crystal input (16 MHz crystal) |
42+
| XTAL2 | 10 | - | Crystal output (16 MHz crystal) |
43+
| AREF | 21 | - | Analog reference |
44+
45+
### Notes
46+
- **20pF Capacitors**: The 16 MHz crystal is connected between XTAL1 (pin 9) and XTAL2 (pin 10), with one 20pF capacitor from each pin to ground. These are suitable substitutes for the standard 22pF capacitors.
47+
- **ISP Programming**: When using an Arduino Nano as an ISP, connect:
48+
- Nano D10 → ATmega328P pin 1 (RESET)
49+
- Nano D11 → ATmega328P pin 17 (MOSI)
50+
- Nano D12 → ATmega328P pin 18 (MISO)
51+
- Nano D13 → ATmega328P pin 19 (SCK)
52+
- Nano 5V → ATmega328P pins 7, 20 (VCC)
53+
- Nano GND → ATmega328P pins 8, 22 (GND)
54+
- **Port/Bit Usage**: In AVR programming, use `PORTB`, `PORTC`, or `PORTD` registers (e.g., `PORTB |= (1 << PB5)` sets Arduino D13 high). Arduino abstracts this as `digitalWrite(13, HIGH)`.
55+
56+
---
57+
I'll have plenty of time to actually mess around with it tomorrow evening after work and Sunday, where I plan on finishing out the clock module, and making up at least a couple registers up. I don't think I'll put everything on a board yet, as I don't have a new piece of plywood or something. But I'm sure home depot or lowes would be happy to sell me something that's the right size. Just have to figure out how much space I want it to take up. Probably bigger than SAP-1, but I don't know how much bigger. It'll need to be designed out on paper first, because they won't be moveable once they're chucked down.
58+
59+
I know I'll still need to order some more chips, mainly ram, flash(or eeproms, but flash is cheaper), and try to get a 74hc181 chip.
60+
61+
---
62+
### 74xx181 progress.
63+
64+
So, the only problem with the 74ls181 chip is outputting to 74hc chips, due to the output voltage of the ls series being >=2.7v, while the hc series requires >= 3.15v.
65+
66+
It seems like I have two options, either pull-up resistors on every 74ls181 output (F0–F3, A=B, Cn+4, P, G) to 5V or add a buffer/level translator like a 74hct244/245.
67+
68+
#### resistor solution
69+
Pros:
70+
- Simple and cheap (only resistors needed).
71+
- Works on a breadboard.
72+
73+
Cons:
74+
- Slows rising edge transitions (adds ~10–20ns due to RC time constant), which may be an issue at high clock speeds (>10 MHz).
75+
- Increases power consumption slightly.
76+
77+
Shouldn't be a problem on a breadboard computer, and it doesn't take up much space.
78+
79+
#### 74hct244/245
80+
81+
Pros:
82+
- Fast (adds ~5–10ns delay, negligible for most breadboard computers).
83+
84+
- Reliable, with strong drive capability (~4mA source/sink).
85+
86+
Cons:
87+
- Requires an additional chip, increasing complexity and cost.
88+
89+
- Takes more breadboard space.
90+
91+
This really isn't a problem either, and it's technically faster, but I'll need two of them to handle the two 74ls181 chips.
92+
93+
94+
95+
---
96+
---
97+
---
98+
99+
## 9pm realizations
100+
101+
I just realized that I'm an idiot. The alu outputs to ONLY a 74hct245 to go back to the bus. IT DOESN'T go anywhere else. If anything, it'd just go out to a bunch of LED's somewhere else on the computer. So I can just buy two 74ls181's(I might get 4 for good measure) and call it a day.

_posts/2025-05-03-register-build.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Building the registers
2+
3+
I think I'm going to start off by building 8 8-bit registers. I've settled with a 74hc245 and a 74hc574 for the register, as mentioned at the end of [this blog](https://thecodingchicken.github.io/2025/04/29/design-goals-and-starting-the-build.html).
4+
It appears like I can cram 3 registers onto a single chip, which'll work well for the last 6 registers. The first two will be hooked up like in Ben Eater's SAP-1, that way I can see the values and it'll be easier to integrate with the ALU. I think I'll plan space on these boards for enamel wiring later on to have led bar displays to show their values. Enamel wire is kinda a pain, but the insulation is so much thinner, so it'll work better. Just need another tool just for that to strip it, my thermal stripper doesn't work on that stuff it seems...which is a shame, I hoped it would.
5+
Anyway, time to build a couple breadboards up. Doing it on temporary breadboards, and I'll build it for real later.
6+
7+
### Important
8+
I was debating on how to line them up, and I ended up doing a vertical line. I'll attach three pictures of my progress on the silly thing. The lines could have been neater, but it works in the end. I do need to get some 74hc02 NOR gates, as it seems that I don't have those.
9+
I need to figure out what are the final things that I need to stop ordering stuff. LOL.
10+
I'll probably wire it all up as if the NOR's in place, but just can't test it until I get them. I only have 74ls02's, and maybe 1 74hct02, but I'll need two, for the 6 total registers here. Not to mention the other two registers for the ALU. I've just started ordering 10 or 20 of these chips, because I'll probably find a use for them. Only costs a few bucks more, anyway.
11+
12+
### Final layout(planned)
13+
So I think the final layout of the board will be 3 breadboards, with the bottom one handling the control logic(3-8 decoding for both inputs and outputs), NOR gates for combining clock and register in controls, and maybe some led stuff. Or, more likely, space for something else that I'm forgetting. I do need to implement a shift register somewhere I suppose...don't know how that's gonna happen.
14+
But that's a topic for another day, I need to get some sleep.
15+
16+
---
17+
### Things to consider for the future
18+
How do I want to implement a shift register? Jameco doesn't have a 74hc194 4-bit shift register, need to look around for other options.

_random_posts/color_design.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Colors, and general board stuff
2+
3+
I want to lay out the basic building plans here, mainly about color and design choices where I can make it work. Obviously, space limiting, I can't do everything, everywhere, but this will help.
4+
5+
| Color | Purpose | Description |
6+
|---------|---------|----------------------------|
7+
| Red | 5v | 5V Power Only |
8+
| Black | 0V | Ground Only |
9+
| Blue | Bus | Only bus signals |
10+
| White | Clock | Clock Signal |
11+
| Green | Other | Intra-board stuff |
12+
| Gray | Control | Processed Control Lines |
13+
| Yellow | Control | Control Lines from Flash |
14+
| Orange | Reset | Reset lines |

_random_posts/stuff-to-print.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Stuff to print
2+
3+
This document will be full of various chips that I would recommend printing out, unless you like staring at tiny pdfs all day on a screen. Eventually I'll make a good pdf book, or add something [here](https://thecodingchicken.com/chips/)
4+
5+
6+
- [74HC574](https://www.jameco.com/Jameco/Products/ProdDS/46084.pdf) *3-state Octal D-Type Edge-Triggered Flip-Flop*
7+
- [74HCT245](https://www.jameco.com/Jameco/Products/ProdDS/45671.pdf) *Octal 3-state transceiver* ***BUS***
8+
- [74HC138](https://www.mouser.com/datasheet/2/149/mm74hc138-303670.pdf) *3-line to 8-line decoder*
9+
- [74HC02](https://www.jameco.com/Jameco/Products/ProdDS/45188FSC.pdf) *Quad 2-input NOR gate*
10+
- [74hc04](https://www.jameco.com/Jameco/Products/ProdDS/45209FSC.pdf) *Hex Inverter*

0 commit comments

Comments
 (0)