6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 2:28 pm

All times are UTC




Post new topic Reply to topic  [ 94 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject: Debugging my first SBC
PostPosted: Sun Mar 05, 2017 4:39 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
Hi, my name is Seppe. I am 18 years old, and just starting out in the world of 6502.

I have just built my own 6502 based system, so now comes the task of getting some code running on it. This is where I hit a brick wall...
I am trying to get ehBASIC on my system, but for this I would need to assemble it using an assembler. I understood that I can do this with cc65, but I cant seem to figure out how to use it..

So if anyone feels like helping out this noob, i would be very happy to know :D .
Thanks for reading!


Last edited by sepseel on Tue Mar 14, 2017 5:56 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 4:48 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
Hi, Seppe, and welcome.

Do you have a monitor program written (or borrowed) and successfully implemented?

How are you transferring the binary from a host to your unit? Serial link? EPROMs?

I'm sure that there are more "ready-to-go" languages freely available, but I would like to mention that ehBASIC is just one possible choice ... others would be Apple 1 BASIC, several free versions of Forth, and my own VTL-02, each of which require minimal resources and standard teletype-style I/O.

Mike B.


Last edited by barrym95838 on Sun Mar 05, 2017 4:55 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 4:55 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
So no, I dont have a monitor program written, or borrowed, as i dont know how to do this.

To transfer data to my computer I use EEPROMS and an EEPROMprogrammer.
My 65 system does have a 6551, but i have'nt figured out how to use this.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 5:31 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Welcome, Seppe!

I am curious to know more details about your 6502 based system. :) For example, does it include other I/O in addition to the 6551? Is it an NMOS CPU you're using? If you begin by providing lots of information then it might save time later.

cheers,
Jeff

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 5:37 pm 
Offline
User avatar

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

Probably I'd start with the basics: some code, any code, which for example prints Hello on some output device. Have you got that far?

To run EhBasic, I think you need to
- have a routine to read a character and one to write a character
- have EhBasic use those routines
- be able to assemble the thing to binary

Perhaps a good starting point is this post
viewtopic.php?f=2&t=2455&p=24630&hilit=ca65#p24630
and the thread around it. Although the package is called cc65, when working with assembly source the command you need is ca65.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 5:47 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
Hey jeff, good call!

First off, i included a picture of my system:
(bottom left is where the eeprom sits, the board on top is just an arduino acting as a variable clock, and the board on the bottom is just a bunch of led's connected to the data and adress lines.)

I am using a
R6502P cpu
R6551AP acia
at28c64b eeprom
tc551001cp-70l ram

I used the same memory mapping as described on this website: http://www.loomcom.com/projects/6502/


Attachments:
IMG_20170305_183600.jpg
IMG_20170305_183600.jpg [ 1.5 MiB | Viewed 4084 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 5:52 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
How far have you got with software? Can you run something which toggles the LEDs, say?

For EhBasic, perhaps have a look at Jeff Tranter's port, the Makefile tells you what you need to build and his mini-mon will provide the features you need to run:
https://github.com/jefftranter/6502/tre ... sm/ehbasic


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 5:57 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
The furthest i have gotten in terms of software, is filling the eeprom wit EA, wich is hex for the NOP opcode.
This way the led's ont the data lines display the value of EA in binary, and the adress lines start counting up.

As far as Jeff Tranter's port goes, I have no idea how to implement this.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 6:30 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Ah, good to know you've run and passed a NOP test!

I'm one of those people who do almost all their computing on the command line... so for me the next step would be to get you set up with the tools needed to run ca65 on the command line. Are you OK to try to do that, or looking for a GUI program to work with? (I gather the latest Windows has a bash command line which pretty much does what Linux does.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 6:35 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
I usually go for programs which have a GUI, so i have limited experience using the command line.
But for this project i would like to get more familiar with the command line tools, as they seem more common.


Last edited by sepseel on Sun Mar 05, 2017 6:37 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 6:36 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Great. First step then is get yourself to a command line and type
Code:
ca65
and have that do the right thing! Are you on Windows?


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 6:38 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
I am currently using windows 10, but I could switch over to ubuntu if that would make the proces easier ?

Btw in what directory should I use that command ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 7:05 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
If you can get to bash prompt, in either OS, then we should be in business.

If you choose Ubuntu, use your package manager to install cc65. Likewise in Windows bash - looks like you use apt-get install there too.

Then see if you can invoke ca65. That's the first hurdle. You're hoping to see
Code:
$ ca65
ca65: No input files


(If at any point you want to bale out or just see zip ahead to see where ehbasic takes you, I suggest you install the GUI tool Kowalski's "6502 Macro Assembler, Simulator, and Debugger" and use this version of EhBasic.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 8:18 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
Ok, so I managed to get the bash prompt in windows 10 to work.
Now you say i should install cc65 using the apt-get install command, however when I input: sudo apt-get install cc65,
I get an error saying: unable to locate package cc65.
Should i manually download cc65, and if so, what command get's it installed then ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 8:29 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8509
Location: Midwestern USA
BigEd wrote:
(If at any point you want to bale out or just see zip ahead to see where ehbasic takes you, I suggest you install the GUI tool Kowalski's "6502 Macro Assembler, Simulator, and Debugger" and use this version of EhBasic.)

The version of the the Kowalski Simulator linked at the above site is out of date. Here is the most recent version.

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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 94 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 27 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: