Writing in EEPROM and reading by 6502

Building your first 6502-based project? We'll help you get started here.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Writing in EEPROM and reading by 6502

Post by GARTHWILSON »

hitlp wrote:
What would be the maximum acceptable time of edge rate?
That depends on the construction. Parts that are rated for 1 or 2MHz also tend to have slow edge rates that let you get away with murder, ie, solderless breadboards. But then you drop in a faster part, even running it at the same clock speed, and things quit working. If we can get a good picture, we can probably suggest, via photo editing, some changes in connection methods that will get things going again.
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?
Tor
Posts: 597
Joined: 10 Apr 2011
Location: Norway/Japan

Re: Writing in EEPROM and reading by 6502

Post by Tor »

Martin A wrote:
The 4 that I was given, that all tested as re-marked NMOS parts, have the following on them:
UMC
W65C02S8P-10
0119S
In other words, this ebay store (huayi-components) is selling fakes. Don't go there.
hitlp
Posts: 48
Joined: 05 Dec 2018

Re: Writing in EEPROM and reading by 6502

Post by hitlp »

Hello guys.

It's me again and I'm just totally stuck. I reset all my circuit and simply when I set up the data bus to run NOP forever, A0 stays at 500 Hz. That is, it is not consuming 2 CPU cycles. Is it possible for this processor to have a "cache" of execution?

If you can also put a link where I can buy an original 6502, I thank you immensely.

Below are images.
Attachments
osciloscope_01.PNG
20190213_003752.jpg
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: Writing in EEPROM and reading by 6502

Post by Chromatix »

Wow, that looks like a *really* faded Rockwell logo, and there's no other markings visible in the photo.

Here's one relatively reputable option. They don't guarantee what brand of 6502 you'll get, and I'm not sure they would 100% test everything they get, but they at least won't *deliberately* rip you off.

Or you could order a brand-new WDC part from Mouser, who are an Authorised Distributor.
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: Writing in EEPROM and reading by 6502

Post by whartung »

hitlp wrote:
Hello guys.

It's me again and I'm just totally stuck. I reset all my circuit and simply when I set up the data bus to run NOP forever, A0 stays at 500 Hz. That is, it is not consuming 2 CPU cycles. Is it possible for this processor to have a "cache" of execution?

If you can also put a link where I can buy an original 6502, I thank you immensely.

Below are images.
So, for laughs, is A1 half of A0, and A2 half of A1?
hitlp
Posts: 48
Joined: 05 Dec 2018

Re: Writing in EEPROM and reading by 6502

Post by hitlp »

whartung wrote:
hitlp wrote:
Hello guys.

It's me again and I'm just totally stuck. I reset all my circuit and simply when I set up the data bus to run NOP forever, A0 stays at 500 Hz. That is, it is not consuming 2 CPU cycles. Is it possible for this processor to have a "cache" of execution?

If you can also put a link where I can buy an original 6502, I thank you immensely.

Below are images.
So, for laughs, is A1 half of A0, and A2 half of A1?
Exactly!!
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: Writing in EEPROM and reading by 6502

Post by whartung »

hitlp wrote:
whartung wrote:

So, for laughs, is A1 half of A0, and A2 half of A1?
Exactly!!
So, you actually have a chip that a) seems to have something like an address bus that's counting up, b) recognizes the code EA as something that moves the address bus forward.

It would be interesting to change the EA to a branch code, and discern what an address pin might look like over time, and see if that matches.
User avatar
BigDumbDinosaur
Posts: 9426
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Writing in EEPROM and reading by 6502

Post by BigDumbDinosaur »

Chromatix wrote:
Wow, that looks like a *really* faded Rockwell logo, and there's no other markings visible in the photo.
A little late to the discussion...that supposed UMC 65C02 is a counterfeit part, likely a Rockwell NMOS 6502, judging by the faded markings. If you want a genuine WDC 65C02 you must purchase one from Mouser or other authorized distributors, not from eBay. WDC DOES NOT sell any parts on eBay or through eBay vendors.

The Jameco pulls (none are NOS, as far as I know) in the past have been Rockwell CMOS parts pulled out of unsold modems. Jameco is a trustworthy supplier.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Writing in EEPROM and reading by 6502

Post by BillO »

One of WDC's UK distributors actually does advertise on eBay. They have the best prices in the world too.

I bought 10 W65C02S6TPG-14 chips off him last year. All genuine prime stuff. They ended up costing me less than $5 USD each including the cost of shipping.

They go by the eBay name of toucano76, but they don't seem to have any on the offer right now, but they do have other WDC chips. When mine arrived they were shipped from Coltek UK Ltd. which is listed on WDC's site as a UK distributor.
Bill
hitlp
Posts: 48
Joined: 05 Dec 2018

Re: Writing in EEPROM and reading by 6502

Post by hitlp »

Hello guys,

I have some news about my project. While I can not get a real 6502, I'm using 6507 taken from an old Atari. The processor is responding correctly, for example when I use the data bus as "EA" (NOP). I made the connection to the EEPROM and it worked correctly.

Now, following the project http://www.grappendorf.net/projects/650 ... world.html [/ url], I called the ACIA and a FTI232 to receive a string (Hello World) via serial.

It turns out that I only receive garbage according to the attached image.

My schematics is:

Image

Since the 6507 has only 12 bits of address, my code used is:

Segments

Code: Select all

MEMORY
{
  ROM: start=$2000, size=$2000, type=ro, define=yes, fill=yes, file=%O;
}

SEGMENTS
{
  CODE: load=ROM, type=ro;
  VECTORS: load=ROM, type=ro, offset=$1ffa;
}
Principal Code:

Code: Select all

.setcpu "6502"

                 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
                 inx
                 jmp next_char
read:
wait_rxd_full:	 lda ACIA_STATUS
                 and #$08
                 beq wait_rxd_full
                 lda ACIA_DATA
                 jmp write

text:            .byte "Hello World!", $0d, $0a, $00
Any tips? :cry:
Regards.
Attachments
captura01.PNG
captura01.PNG (2.99 KiB) Viewed 1424 times
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: Writing in EEPROM and reading by 6502

Post by Chromatix »

So - a 6551. Exactly which 6551 is it? The "latest genuine" WDC parts have a nasty hardware bug, though I don't think that's what you're seeing here.

Also, 19200 baud is near the limit of the 6551's capabilities. Usually 9600 or 1200 baud are better choices for initial tests.

Make certain both ends are set to the same speed for both transmit and receive (many UARTs can set TX and RX parameters independently). It looks like you're receiving more characters than you sent, which may indicate the receive speed is set too high, or the transmit speed too low. Note also that the values you need to poke into the 6551 depend on the clock speed attached to it (usually a UART has a standard-frequency crystal dedicated for this purpose).
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Writing in EEPROM and reading by 6502

Post by Dr Jefyll »

How have you modified the circuit? The 6507 lacks several signals noted in the original diagram (which is intended for 6502).

I think the connections formerly driven by A15 can connect to A12 (as shown). But other wiring questions remain. Also, some of the values declared in the program may need to be changed.

First, please tell us what you've done with the wiring. :)

cheers
Jeff
Attachments
homecomputer-6502-v5-acia-schematic  .png
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
hitlp
Posts: 48
Joined: 05 Dec 2018

Re: Writing in EEPROM and reading by 6502

Post by hitlp »

Hello guys,

Well answering the questions, I tested with baudrate of 1200 and 9600 and kept getting trash on the way out. I am using as clock source, a crystal of 1.8432 MHz connected in pins 6 and 7 of 6551.

Answering Dr Jefyll, since the 6507 only has addressing up to A12, I connected this port to 6551 as if it were the A15 of 6502. Another replacement I did was that, instead of the AT28C256, I'm using the AE29f2008-12 which is a memory flash removed from a PC BIOS. The pinning is very similar to the AT28C256.

The other ROM address pins are disconnected, as A13, 14 and 15.

What can be wrong? :roll:
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: Writing in EEPROM and reading by 6502

Post by Chromatix »

The unused ROM input lines must be tied definitely either high or low, not left floating. This is generally true of all CMOS inputs, even of spare gates on a multi-gate 74-series chip. Having not done that, there is a good chance the ROM is confused about what addresses the CPU is requesting.
hitlp
Posts: 48
Joined: 05 Dec 2018

Re: Writing in EEPROM and reading by 6502

Post by hitlp »

Dr Jefyll wrote:
Also, some of the values declared in the program may need to be changed.

cheers
Jeff
What values may need to be changed?
Post Reply