r/beneater

▲ 1.1k r/beneater+1 crossposts

My CPU now loads programs from an SD card

Finally got the SD-card boot path working on my CPU.

I use a ROM bootloader which initializes the SD card and jumps to loaded programs.

A few build details:

8-bit data bus

16-bit address space

48 KB RAM

boot ROM at 0xC000

bit-banged SPI / SD-card interface

128x64 OLED display

Project overview:

https://fadil-1.github.io/

GitHub:

https://github.com/Fadil-1/8-BIT-BREADBOARD-CPU

YouTube version:

https://www.youtube.com/watch?v=jY9QqDrkifg

u/StraightCondition4 — 4 days ago

Finally completed the 8-bit!

This was a very enlightening project as a prospective CS student. Big thanks to Mr Eater and this wonderful community ❤️

u/SaxyCat — 4 hours ago
▲ 235 r/beneater+2 crossposts

Here's a pic of my PCB version of the 6502 microcomputer. It's a BE6502 with some mods. It has 32K of SRAM, 4K of I/O space, and 28K of ROM. Also RS-232 serial communications. The 40-pin box headers break out the address, data and control busses for expansion.

u/grilledch33z — 8 days ago
▲ 399 r/beneater

Used a 555 timer to jump between lower and upper half of eeprom to make a 2 frame gif . maybe you can have 32 frame gif using a 29c040 and using a 74ls161 counter. A cool upgrade!!

u/ClockFickle3935 — 10 days ago

Output Register Switch

New Here- First post. Can someone please tell me where Ben talks about what the switch in the schematic for this Output Register is for, and how to use it? I am sure I missed it in the videos.... Thanks. MJ

u/ComparisonLonely7461 — 5 days ago

Problem using the ADC with a W65C816S CPU

Hello everyone, I’m just starting to use a W65C816S processor and I’d like to try writing some simple programs to begin understanding programming in machine language/assembly.

Here is the program I currently have:

rom[0] = 0xD8 # CLD

rom[1] = 0x18 # CLC

rom[2] = 0xAD # LDA $83E8

rom[3] = 0xE8

rom[4] = 0x83

rom[5] = 0x69 # ADC #05

rom[6] = 0x05

rom[7] = 0x8D # STA $8400

rom[8] = 0x00

rom[9] = 0x84

rom[1000] = 0x2D

rom[0x7FFC] = 0x00

rom[0x7FFD] = 0x80

The problem here is that in the STA section, the CPU writes 0x22 to memory when the result should be 0x32.

If I remove the section with the ADC, the value written is indeed 0x2D (value read at address 83E8).

I suppose I’m not far off, but I can’t seem to find where my mistake is.

Here is what I read on the two buses at a 1Hz clock rate from initialisation, with the bus address first, read or write second, and the data bus value third:

fffc R 00

fffd R 80

8000 R d8

8001 R 18

8001 R 18

8002 R ad

8002 R ad

8003 R e8

8004 R 83

83e8 R 2d

8005 R 69

8006 R 05

8007 R 8d

8008 R 00

8009 R 84

8400 W 22

Thank you in advance for taking the time to read this

reddit.com
u/FinancialShow7176 — 5 days ago

Buggy ask heck, but after a lot of work, it's good to see typed characters appear on the screen!

Working:

  • cgetc(), cputc(), cgets()
  • Lowercase characters, enter, tab
  • backspace (sometimes glitches)
  • Line wrap
  • Scroll up for new line

Not yet working:

  • Shift, caps lock, num lock
  • Reliably working after reset

Not yet tested:

  • Keyboard LEDs (bit-bang hack involving a 74HC125, an RC pulse, and temporarily redefining pins on the 6522...shudder)
  • Control key (ASCII caret codes)
  • Combinations of shift and caps (should be lowercase alphabets but still "uppercase" symbols)
  • The rest of conio.h and stdio.h
u/Ancient-Ad-7453 — 13 days ago

As shown in video; other LEDs on the registers are fine. I've added two 104 capacitors next to the power source for the LEDs but to no avail.

Additionally, these LEDs don't always follow what I set on the DIP switch, sometimes dimly shining (or not at all). They also seem to randomly light up/brighten when I put my finger near the LS157 chip, even though I'm not seeing any floating inputs (?)

Any help would be greatly appreciated 🙏 I've been stuck on this for a while now

u/SaxyCat — 11 days ago

Hi guys i want to build a homebrew gpu using a cpu (zilog z80) but i have like almost no experience of how the cpu works because i only work with logic gates and if someones willing to help it would be great! ty

reddit.com
u/Mediocre_Insurance91 — 7 days ago

https://reddit.com/link/1t4v6f7/video/z4qcx9jreezg1/player

here is my code btw

PORTB = $6000
PORTA = $6001
DDRB = $6002
DDRA = $6003


E  = %10000000
RW = %01000000
RS = %00100000


  .org $8000


reset:
  ldx #$ff
  txs


  lda #%11111111 ; Set all pins on port B to output
  sta DDRB
  lda #%11100000 ; Set top 3 pins on port A to output
  sta DDRA


  lda #%00111000 ; Set 8-bit mode; 2-line display; 5x8 font
  jsr lcd_instruction
  lda #%00001110 ; Display on; cursor on; blink off
  jsr lcd_instruction
  lda #%00000110 ; Increment and shift cursor; don't shift display
  jsr lcd_instruction
  lda #$00000001 ; Clear display
  jsr lcd_instruction


  ldx #0
print:
  lda message,x
  beq loop
  jsr print_char
  inx
  jmp print


loop:
  jmp loop


message: .asciiz "nikolai!!!"


lcd_wait:
  pha
  lda #%00000000  ; Port B is input
  sta DDRB
lcdbusy:
  lda #RW
  sta PORTA
  lda #(RW | E)
  sta PORTA
  lda PORTB
  and #%10000000
  bne lcdbusy


  lda #RW
  sta PORTA
  lda #%11111111  ; Port B is output
  sta DDRB
  pla
  rts


lcd_instruction:
  jsr lcd_wait
  sta PORTB
  lda #0         ; Clear RS/RW/E bits
  sta PORTA
  lda #E         ; Set E bit to send instruction
  sta PORTA
  lda #0         ; Clear RS/RW/E bits
  sta PORTA
  rts


print_char:
  jsr lcd_wait
  sta PORTB
  lda #RS         ; Set RS; Clear RW/E bits
  sta PORTA
  lda #(RS | E)   ; Set E bit to send instruction
  sta PORTA
  lda #RS         ; Clear E bits
  sta PORTA
  rts


  .org $fffc
  .word reset
  .word $0000
reddit.com
u/PC_Defender — 8 days ago

Recently started working on Ben's projects. Got the clock built and was working fine, then started on the 6502 computer. Suddenly the clock is no longer functioning properly. Single steps work fine but astable mode has quit, LED solid not flashing. Any tips appreciated.

u/SurroundNo9473 — 11 days ago

I wanted to post this in case it's helpful to anyone. I found some advice here over the past week that gave me some really good troubleshooting ideas so I wanted to try to return the favor. Anyway, here are some of the pitfalls that I fell into..

My clock signal looked very clean on the oscilloscope (and a high around 3.4V) but was causing extra triggers, sometimes several rapid fire outputs from the 6502 from one clock pulse. I also noticed some noise on the clock signal when I would push the button on the 6502 reset circuit. I added decoupling capacitors here and there but I think the most important thing I changed was removing the blue LED from the clock output. I noticed when I removed it, my clock output voltage squares went to 5V (and 5V was working perfectly when I tried using the Arduino for the clock signal). I did want an output LED so I hooked one up to the base of a 2N2222 in some space that I had left on the clock module breadboard. This lowered the clock output voltage a bit but it was still well above the 3.4 or so that it was before. And now I can advance the 6502 one pulse at a time--woohoo.

Another one.. and this was diabolical. I wired the Arduino pins backwards in relation to the 6502's 8 digital input/output pins. The really pesky part was that I somehow adjusted for this (i.e. *masked* the problem) with how I wrote my Arduino bit shifting statements. So I'm seeing "ea" in the serial output--thinking I had that right--but it's not doing anything close to incrementing the addresses. The output was jumping all over the place and I never saw FFFC or FFFD, etc.

I'll probably think of another pitfall after I post this but I did want to wrap this up and say thanks again to those of you who have posted guidance and troubleshooting ideas here. Some of those ideas helped guide me and kept me motivated.

reddit.com
u/burritonite — 13 days ago

I have followed your builds for quite a while. I just got the recent video on square waves. While that interests me some, I think your expertise in building the 6502 computer is what I liked the most. There are many others out there working on square waves, particularly as it applies to synthesizers. I wish you'd do more with the 6502 ben eater computer.

reddit.com
u/dkknab — 12 days ago

So my registor was working perfectly fine but then LEDS stopped working. The problem is that now when I put the ground leg of LED in output pin of 173 and other leg to vcc, LED lights up, like working in opposite direction

reddit.com
u/Confident-Pay-4554 — 12 days ago

Has anybody made modifications to the worlds worst video card to make it display multiple images. (Show one the wait 3 seconds and show the next etc.) I’m wanting to show Homer Simpson fading in to the bushes…

reddit.com
u/Eastern_Guest_4930 — 14 days ago