6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Oct 07, 2024 12:21 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Mar 23, 2018 7:44 pm 
Offline

Joined: Fri Mar 23, 2018 7:19 pm
Posts: 5
Location: Malaysia
Greetings,

This is my first attempt at trying out building an 8-bit computer. I'm currently working out the circuit from the link:
http://www.grappendorf.net/projects/6502-home-computer/the-microprocessor.html

Since I'm using 65c02, there's a few changes I made from the link above:
1. I leave the first pin floating (VPB).
2. Put a pull-up resistor to BE with 3.3k resistor to 5V+.
3. Connect the lower address bus to the 8 LED's.
4. Using a 4-pin crystal oscillator (1Mhz)

Since the data bus is inputted with $EA, I thought I want to run a visual test with LED's. I don't have an oscilloscope since I'm nowhere near my school except for a digital multimeter, so I thought I want something visual to debug before going any further.

I was expecting something a result akin to this https://www.youtube.com/watch?v=ZLhVni8Wy5Y but all of my LED's are turning on at the same time, but when I press the reset button it does stop at the last address it tries to fetch. Is this an expected behaviour for a 1Mhz?

To test it further, I put a piezo buzzer and connect it to A15 and all the way to A0 following the instructions from this http://www.6502.org/mini-projects/nop-gen/nop-gen.htm. The sound output do oscillates, and it's gradually getting faster and dimmer but it's not a low buzz noise at A15.

Is there any other way that I can test without using oscilloscope?


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 23, 2018 9:15 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Welcome!

Hmm, A15 might be going at about 7Hz - that's very fast for a flicker but I think you should see it. It's much too low for a sound to be heard. But somewhere in the middle of the address bus, A6 to A9, maybe you should hear an audio tone?

Can you build a little divider out of TTL? Or do you have a frequency readout on a multimeter?


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 23, 2018 10:34 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
Welcome!

At 1MHz, with LEDs on only the 8 address lsb's (since you said, "3. Connect the lower address bus to the 8 LED's."), the flashing will be too fast to see it, so yes, it will look like they're on all the time. At 1MHz, 2 cycles (for NOP) goes by in 2µs, meaning A0 will cycle on and off at 250kHz, A1 at 125kHz, ... and A7 at almost 2kHz!

Be sure to go through the 6502 primer, which about building your own 6502 computer, covering many aspects, at http://wilsonminesco.com/6502primer/ .

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 24, 2018 12:40 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8415
Location: Midwestern USA
crepesmort wrote:
This is my first attempt at trying out building an 8-bit computer...
1. I leave the first pin floating (VPB).
2. Put a pull-up resistor to BE with 3.3k resistor to 5V+.
3. Connect the lower address bus to the 8 LED's.
4. Using a 4-pin crystal oscillator (1Mhz)

I see mention of pulling BE up to Vcc, but no mention of doing so with RDY, IRQB and NMIB. None of these can be allowed to float.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 25, 2018 5:38 am 
Offline

Joined: Fri Mar 23, 2018 7:19 pm
Posts: 5
Location: Malaysia
BigDumbDinosaur wrote:
I see mention of pulling BE up to Vcc, but no mention of doing so with RDY, IRQB and NMIB. None of these can be allowed to float.

:) Oh forgot to mention, I did put a pull-up 3k3 resistor for these pins too.

BigEd wrote:
Welcome!

Hmm, A15 might be going at about 7Hz - that's very fast for a flicker but I think you should see it. It's much too low for a sound to be heard. But somewhere in the middle of the address bus, A6 to A9, maybe you should hear an audio tone?

Can you build a little divider out of TTL? Or do you have a frequency readout on a multimeter?

So i tie the higher address byte up until A15, and it does flicker. I also tested it with 1.8432Mhz oscillator can and it's indeed oscillates almost as twice faster.

I don't have an oscilloscope, but I do have an arduino, so I used the processing-oscilloscope to measure the frequency and look at the duty cycle for each of the signal, it does have a limitation being that it can't read past 1Khz properly, but so far the frequency from A15 to A8 doubles i.e. (A15 -> 7.4Hz, A14-> 14.8Hz and so on until A8).

GARTHWILSON wrote:
At 1MHz, with LEDs on only the 8 address lsb's (since you said, "3. Connect the lower address bus to the 8 LED's."), the flashing will be too fast to see it, so yes, it will look like they're on all the time. At 1MHz, 2 cycles (for NOP) goes by in 2µs, meaning A0 will cycle on and off at 250kHz, A1 at 125kHz, ... and A7 at almost 2kHz!

Be sure to go through the 6502 primer, which about building your own 6502 computer, covering many aspects, at http://wilsonminesco.com/6502primer/ .

Thanks for the link garth, there's still topics that I have yet to go through, but I've read the section that concerns with my progress so far.

So I took a leap of faith and venture to put an UART chip in it after burning the eeprom (atmel 28c256). Unfortunately, the ones I ordered is the latest w65c51 chip (with the lot no. A6A749.1 1016G015), and checking out the forum, there is a well known Xmit bug in it that prevents the bytes to stream to the receiver.

I am using an ft232rl usb to ttl chip to communicate with the UART, and I'm still referring to this schematic along with the code that was used http://www.grappendorf.net/projects/6502-home-computer/acia-serial-interface-hello-world.html, but just to be sure, if I were to modify the code to circumvent the xmit bug in the 65c51, would the code below works?

Code:
                  .setcpu "65C02"

                  ACIA_DATA = $0000
                  ACIA_STATUS = $0001
                  ACIA_COMMAND = $0002
                  ACIA_CONTROL = $0003

                  .segment "VECTORS"

                  .word   nmi
                  .word   reset
                  .word   irq

                  .code

reset:            jmp main

nmi:              rti

irq:              rti

main:
init_acia:        lda #%00001011        ;No parity, no echo, no interrupt
                  sta ACIA_COMMAND
                  lda #%00011111        ;1 stop bit, 8 data bits, 19200 baud
                  sta ACIA_CONTROL

write:            ldx #0
next_char:
wait_txd_empty:   lda ACIA_STATUS
                  and #$10
                  beq wait_txd_empty
                  lda text,x
                  beq read
                  sta ACIA_DATA
                  jsr delay_6551
                  inx
                  jmp next_char

read:
wait_rxd_full:    lda ACIA_STATUS
                  and #$08
                  beq wait_rxd_full
                  lda ACIA_DATA
                  jmp write

delay_6551:       phy
                  phx
delay_loop:       ldy #1
minidly:          ldx #$68
delay_1:          dex
                  bne delay_1
                  dey
                  bne minidly
                  plx
                  ply
delay_done:       rts

text:             .byte "Hello World!", $0d, $0a, $00


and I compile it using ca65
Code:
ca65 -o firmware.o -l firmware.lst firmware.s65
cl65 --cpu 65C02 -C firmware.cfg -t none -o firmware firmware.o


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: