6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 16, 2024 11:48 pm

All times are UTC




Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Mon Sep 14, 2015 7:21 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Thanks Garth!

Yeah, C2 & C3! My bad. I'd figure they were left out, but wanted to make sure.
I guess I got everything lined up. Parts should arrive by the end of the week.
Can't wait to play with the 65c02!

By the way, Thanks for the 6502 primer. It's impressively dense and very well documented.
I wonder how long did it take to finish it all. I'm glad you took the time to write that down :)

I've been looking around for books on building 6502 computers.
Most of what I found were books on assembly programming only.
Was there ever a book on building 6502 computers from scratch out there?

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 14, 2015 10:51 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Thanks. I wrote most of it in 2003, then pulled out of mothballs and updated and added photos and published in 2012 when I finally had a website. It has had countless little updates since then. As much as I wanted to do it, if I had known how much work it was going to be, I might not have done it. I was not (and still am not) aware of any such other resource, in print or online.

This is the most popular part of the website, although surprisingly, the next-most popular, in spite of getting no forum discussion or emails, is the section on 16-bit scaled-integer math (note that I did not say "fixed-point" which is a limited subset of scaled-integer) and the large look-up tables that become like a math co-processor. I'm about to make another major feature public with 19 chapters which I have been working on since the spring of 2013 as I got time (which means sometimes it sat dormant for months). Everything takes so much more work than I expect it to, even after I've been through the cycle several times. Even the article on assembly language's relevance, which I thought I could punch out quickly, turned out to be anything but quick.

_________________
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: Tue Sep 15, 2015 4:56 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8493
Location: Midwestern USA
GARTHWILSON wrote:
Everything takes so much more work than I expect it to, even after I've been through the cycle several times. Even the article on assembly language's relevance, which I thought I could punch out quickly, turned out to be anything but quick.

Good technical writing is not a trivial exercise, even for the experienced. Over the years, I have written a number of full-blown technical manuals, running in a few cases to several hundred pages. It is a time-consuming process, due to the need to make sure every jot and tittle is in place. Writing technical matter can also become tedious when the intended audience has only a modicum of knowledge of the topic, as a good deal of parenthetical explanation is often necessary to avoid losing the reader.

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


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 17, 2015 9:31 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Hi guys.
Let me give you some updates on my 6502 adventure :twisted:

Last night I got my 65c02 and other parts from Mouser.
Today I got to make a quick "free run" test on my 65c02 and it worked :)

I did a freerun using my arduino found here: from https://coronax.wordpress.com/2012/11/1 ... n-circles/
Looking at the serial port I could see the 65c02 going through its address bus.
Now, for some reason I had to change the baud rate from 115200 to 9600 to work.
Not sure why, but at 115200 it doesn't read :(
I also noticed the address were hoping back here and there, instead of changing linearly.

Anyone had a similar problem by any chance?
I'll upload a video to show my setup.

Next setp, get some simple code into my eeprom so I can setup the 6502 potpourri :)
Thank!


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 17, 2015 10:30 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
beholder wrote:
Now, for some reason I had to change the baud rate from 115200 to 9600 to work.
Not sure why, but at 115200 it doesn't read :(
I also noticed the address were hoping back here and there, instead of changing linearly.

Anyone had a similar problem by any chance?
I can't comment on the baud rate issue, since that would be an Arduino thing. But as for the addresses hopping back, by any chance do they hop back to $EAEA? :roll: I suspect your 'c02 is executing an NMI, IRQ or RESet. Those are the only things that would override the $EA (NOP) that you are continually forcing on the data bus. They would try to do three writes to stack and then there'd be a jump to $EAEA.

(Actually the writes amount to bus contention, since your hardwired $EA is forced even during writes. This could briefly upset the power supply, resulting in a jump somewhere other than $EAEA. If you wire the EA using eight 10K resistors instead of eight pieces of wire then the excess current drain will be avoided. That won't fix the reset problem, if any, but it'll render the symptoms more predictable!)

In your blog you mention that NMI and IRQ are taken care of, so maybe your Reset circuit is the source of some glitches. If it's not a reset issue, then maybe there's a power supply problem. Your setup is so simple there's really not a lot that can go wrong!

BTW, you also say, "The software on the Arduino side is trivial. It runs a loop where it toggles the clock output on and off, and then reads the values of the 8 address lines I hooked up. If the value has changed, it writes out the hexadecimal value on its serial port." I hope that in the case of an unchanged value the information isn't ignored entirely -- that whatever's on the receiving end knows enough to fill in the blank. Just checking!

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Thu Sep 17, 2015 10:49 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 17, 2015 10:48 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Hi Jefyll.

Thanks for the feedback!
By the way, I didn't write the blog. I just used his example to test my 6502.
Coronax did all the hard work, I just copied his example :D

I was working on it and then it started working just fine. Not sure what caused the hops... maybe power or some bad connection on my breadboard.
I did removed a capacitor from the reset circuit. Read that on a comment on his blog. Maybe that did it.

I made a quick video showing the setup:
https://www.youtube.com/watch?v=YmNbVczc618

Will now look into getting some code on my my eeprom.

Thanks!


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 18, 2015 9:12 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10981
Location: England
Just a quick note: it's always best to start a new thread when taking off in a new direction - the thread title remains as a good guide to the thread contents, and there's a new thread with a new and appropriate title for the new discussion.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 18, 2015 10:26 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Hi BigEd.

Sure, will start a new tread with my 6502 progress to keep this one related to what to buy as a beginner.

Getting back to equipment buying questions :D
I found this eeprom programmer on amazon for a decent price:
http://www.amazon.com/Signstek-Universa ... 2661618011
Was wondering if its worthy? Anyone have tried this one?

seems like it programs 28cxx

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 19, 2015 12:59 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8493
Location: Midwestern USA
beholder wrote:
Hi BigEd.

Sure, will start a new tread with my 6502 progress to keep this one related to what to buy as a beginner.

Getting back to equipment buying questions :D
I found this eeprom programmer on amazon for a decent price:
http://www.amazon.com/Signstek-Universa ... 2661618011
Was wondering if its worthy? Anyone have tried this one?

seems like it programs 28cxx

Thanks

It's gotten good reviews. Let that be your guide.

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


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 19, 2015 11:37 am 
Offline
User avatar

Joined: Sun Oct 13, 2013 2:58 pm
Posts: 491
Location: Switzerland
Would be interesting to know if it really burns GALs as well. As programmer I use a Genius G540 which sells for the same price and it does all my EEPROMs and GALs


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 19, 2015 11:58 am 
Offline
User avatar

Joined: Sun May 03, 2015 7:07 pm
Posts: 42
Location: London, UK
I had no luck with the GAL22V10D with this programmer

_________________
All my stuff


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 19, 2015 5:55 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
cbscpe wrote:
Would be interesting to know if it really burns GALs as well. As programmer I use a Genius G540 which sells for the same price and it does all my EEPROMs and GALs

Only if you threaten it with a hammer! ;)

@beholder
With regard to the serial speed of the arduino... did you change it in the arduino sketch and in the terminal program on your PC as well? For instance, I use PuTTY to communicate with my projects and that has options to set the serial speed, number of data bits, stop bit, and hand shaking. All must match.


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 19, 2015 11:22 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Hi Banedon.

I figured out why it wasn't working on 115200, the serial window has a dropdown option box where you choose which rate.
Didn't know I had to set the arduino project and the serial window :oops:

I got both the free run and tight loop examples working, from this website:
http://mysite.du.edu/~jcalvert/tech/6504.htm

I hooked up LEDs on all 16 pins of the address bus to check what was happening.
As expected from the tight loop example, the address are always jumping at $00, $01 and $02.
Works perfect and I guess the reset works as well.

Now... I got this funny thing happening when I reset my 65c02. The address bus always starts at FFFF(all leds light up), then it will spit out some random address for 4 clocks (low-high) then it goes to $FFFC, then $FFFD (which from what I understand is the reset vector), then it starts the tight loop.

Any explanation why I get these random values at reset? Could a reset circuit cause this? Im using Garth's reset circuit form his potpourri example with the 74HC138. I wonder if I made a mistake :roll:

I'm using my arduino to provide the clock. At the beginning of my loop I set the output pin to LOW then to HIGH. Then I read the address bus pins to see what's happening with the 6502.

Here's a quick copy of what my serial is capturing form the 6502. This right after a reset:
The hex is from address bus pins A0-A7. I can see the full address from the LEDs
The first is always FFFF, then 4 random values, than FFFC and FFFD, than the loop starts.
Doesn't matter if I change the clock speed to very fast or very slow, same results.

########## RESET ##########
- clock low: 1
- clock high: 2
- clock low: 3
ff
- clock high: 4
- clock low: 5
03
- clock high: 6
- clock low: 7
f0
- clock high: 8
- clock low: 9
ef
- clock high: 10
- clock low: 11
ee
- clock high: 12
- clock low: 13
fc
- clock high: 14
- clock low: 15
fd
- clock high: 16
- clock low: 17
00
- clock high: 18
- clock low: 19
01
- clock high: 20
- clock low: 21
02
- clock high: 22
- clock low: 23
00
- clock high: 24
- clock low: 25
01
- clock high: 26
- clock low: 27
02
- clock high: 28
- clock low: 29
00
- clock high: 30
- clock low: 31
01
- clock high: 32
- clock low: 33
02
- clock high: 34
- clock low: 35
00
- clock high: 36
- clock low: 37
01
- clock high: 38
- clock low: 39
02
- clock high: 40
- clock low: 41
00


Top
 Profile  
Reply with quote  
PostPosted: Sun Sep 20, 2015 2:25 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
beholder wrote:
Now... I got this funny thing happening when I reset my 65c02. The address bus always starts at FFFF(all leds light up), then it will spit out some random address for 4 clocks (low-high) then it goes to $FFFC, then $FFFD (which from what I understand is the reset vector), then it starts the tight loop.

Any explanation why I get these random values at reset? Could a reset circuit cause this? Im using Garth's reset circuit form his potpourri example with the 74HC138. I wonder if I made a mistake :roll:

I did not show a '138 there, so I don't know where you're bringing it in. However, the WDC data sheet shows the reset sequence doing two clock cycles of internal operations, followed by pushing things on the stack, before fetching the reset vector. That's normal.

_________________
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: Sun Sep 20, 2015 3:39 am 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
Hi Garth.

Sorry, I meant 74HC132 :oops:
I always get these 7400 ics wrong :D

Then how does the 6502 knows when to start reading an address after reset?
Will it just read the data bus when it gets to FFFC and FFFD?
Or can it read these "weird" values?

Thanks


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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: