Unable to run a program

A forum for users of EhBASIC (Enhanced BASIC), a portable BASIC interpreter for 6502 microcomputers written by Lee Davison.
creoguy
Posts: 12
Joined: 24 May 2018

Re: Unable to run a program

Post by creoguy »

My understanding of Chris's design is that the 32k SRAM is divided up so half is for the OS, and then the other half is for the ACIA, VIA and the remainder for use as potential I/O space in a future revision. I'm completely new to all this so my grasp of how it all ties together is almost zero, so take everything I say with a grain of salt!

Looking at the topic for NichH93's issue, it sounds very similar as he was also able to run LIST as well but hit a wall when trying use RUN or text strings. Might be worth picking up another 65C02 to test that option out as my first ACIA didn't work as well, but I chalk that up to it being a used eBay item.
User avatar
GaBuZoMeu
Posts: 660
Joined: 01 Mar 2017
Location: North-Germany

Re: Unable to run a program

Post by GaBuZoMeu »

Have you tried to enter a smaller memory count when Basic starts, say 8000 or 4000. Perhaps this will work.
Klaus2m5
Posts: 442
Joined: 28 Jul 2012
Location: Wiesbaden, Germany

Re: Unable to run a program

Post by Klaus2m5 »

Then there is another problem as the RAM Test in EhBASIC may trash your IO.

Code: Select all

Ram_base		= $0300	; start of user RAM (set as needed, should be page aligned)
Ram_top		= $8000	; end of user RAM+1 (set as needed, should be page aligned)
should be changed to

Code: Select all

Ram_base		= $0300	; start of user RAM (set as needed, should be page aligned)
Ram_top		= $4000	; end of user RAM+1 (set as needed, should be page aligned)
However this should not be causing the problems you are seeing.
6502 sources on GitHub: https://github.com/Klaus2m5
creoguy
Posts: 12
Joined: 24 May 2018

Re: Unable to run a program

Post by creoguy »

Quote:
Have you tried to enter a smaller memory count when Basic starts, say 8000 or 4000. Perhaps this will work.
Just attempted 8000 and 4000 and both would either result in "Memory Size ?" coming up again or system lockup.
Klaus2m5
Posts: 442
Joined: 28 Jul 2012
Location: Wiesbaden, Germany

Re: Unable to run a program

Post by Klaus2m5 »

The "Memory size ?" prompt will be repeated if EhBASIC thinks the number you entered is too small (below RAM_base) or too large (more than 64k). However it uses already quite a lot of its routines including floating point to determine this. Have you verified that the EPROM was correctly programmed?
6502 sources on GitHub: https://github.com/Klaus2m5
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Unable to run a program

Post by Dr Jefyll »

Klaus2m5 wrote:
Shouldn't this be a 32k RAM?
creoguy wrote:
My understanding of Chris's design is that the 32k SRAM is divided up so half is for the OS, and then the other half is for the ACIA, VIA and the remainder for use as potential I/O space in a future revision.
The RAM is a 32K chip, but half of the capacity is deliberately unused. That's to simplify the glue logic, I assume.

Basically, the /OE input of the RAM is used as an extra /CS input, and it's driven from address line A14. Of course placing /OE high doesn't really de-select the chip, but it prevents a read from taking control of the data bus -- and that's sufficient. The chip becomes a Write Only Memory anytime A14 is high. That includes $4000-7FFF, which is where I/O appears.


ETA: the same "/OE as an additional /CE" trick is used in Garth's very basic whole-computer schematic. In fact all the glue for memory/I-O is pretty much identical, except Garths' "whole computer in one diagram" design has no ACIA, just a VIA.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Unable to run a program

Post by Dr Jefyll »

creoguy wrote:
I did use a 1mHz can oscillator connected to pin 37 of the 65c02.
Hm, the specs for the oscillator seen in the photo fail to confirm it meets the specified input requirement on a WDC CPU. The oscillator only guarantees 2.4V as a logic high, but the PHI2 input supposedly needs at least VDD-0.4V, or 4.6V. (The VIA and ACIA might supposedly require 4.6V, too -- I didn't check.)

There's a very easy experimental remedy. Just add a pullup resistor (470 ohm? 1K?) from the osc output to +5V. I'll be a little surprised if this clock-voltage thing turns out to be the answer we're looking for. But if it works then you can either leave the pullup in place (although it wastes power) or swap in a more appropriate oscillator. Edit: I notice BDD asked about the oscillator earlier.

Edit 2: creoguy, did we confirm that the Phi2 inputs on the VIA and ACIA also connect to the oscillator (not the CPU PHI2O output on pin 39)?

-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Unable to run a program

Post by GARTHWILSON »

Dr Jefyll wrote:
ETA: the same "/OE as an additional /CE" trick is used in Garth's very basic whole-computer schematic. In fact all the glue for memory/I-O is pretty much identical, except Garths' "whole computer in one diagram" design has no ACIA, just a VIA.
The diagram only shows one VIA and no AICAs; but see Note 9 below it. The design allows up to ten I/O ICs with the existing glue logic, and in fact my workbench computer has three VIAs and three ACIAs with this scheme.

I was not able to find a schematic on the OP's linked github pages, to compare. The closest I could find was a text file that apparently KiCAD (sp?) uses to form or interpret a picture, an actual schematic diagram. Maybe there is a picture there somewhere; but this is the top reason I hate github. I never can find what I'm looking for!
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?
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Unable to run a program

Post by Dr Jefyll »

GARTHWILSON wrote:
I was not able to find a schematic on the OP's linked github pages, to compare.
Hoglet very thoughtfully posted a PDF version here.
Quote:
this is the top reason I hate github. I never can find what I'm looking for!
I get that, too. It's gotten so I won't even try unless it's something pretty important.
Quote:
The design allows up to ten I/O ICs with the existing glue logic
Pretty slick -- especially considering the existing glue logic is next to none!
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
creoguy
Posts: 12
Joined: 24 May 2018

Re: Unable to run a program

Post by creoguy »

Quote:
oscillator seen in the photo fail to confirm it meets the specified input requirement on a WDC CPU
I added the pull-up resistor to the oscillator output and it made no difference.
Quote:
Phi2 inputs on the VIA and ACIA also connect to the oscillator (not the CPU PHI2O output on pin 39)
I moved the PHI2 inputs for VIA and ACIA to the oscillator output with no difference in the systems.

At this point, my plan is to wait for the new parts to come in next week to help rule out an IC issue. If the problem continues I'm going to test it out on a breadboard, not my first choice as it has the potential for its own issues, but at least I can easily test out some different glue logic configurations.

Thanks again for everyone's help! :D
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Unable to run a program

Post by BillO »

creoguy wrote:
Here are the two data sheets. The note was just to head off any questions if I had wired up the AS6C62256 using the pinout of the CY62256N, which would cause all sorts of issues! :D
It shouldn't. /WE, /CE and /OE are in the right places, so are the address and data lines. That the address lines (or data lines for that matter) are labeled differently is immaterial for RAM.

BTW, what is this using as a clock generator? I don't see one on the schematic (but I see an oscillator in the picture)?

Never mind - I found your post on the oscillator.
Bill
creoguy
Posts: 12
Joined: 24 May 2018

Re: Unable to run a program

Post by creoguy »

When in doubt, a shotgun approach is always a valid option, even if it's not an elegant one! I got in the CY62256N SRAM chip today and swap it in for the AS6C62256, without changing any of the wiring, and things are now working as expected. That'll teach me to order parts for someone else's design without verifying I'm matching their BOM. The only thing I can think of is the 55ns vs. the 70ns access time was enough of a difference to cause an issue.

Thanks again for everyone's help! :D
Last edited by creoguy on Wed Jun 27, 2018 5:37 am, edited 1 time in total.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Unable to run a program

Post by GARTHWILSON »

See this post and the ones following it, regarding speed ratings.
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?
creoguy
Posts: 12
Joined: 24 May 2018

Re: Unable to run a program

Post by creoguy »

With some head scratching, I finally got my Cylon assembly code modified to run in EhBASIC! Now that I have a functioning board, let the fun begin!
Attachments
IMG_7841.gif
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Unable to run a program

Post by BigEd »

Congratulations!
Post Reply