6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 16, 2024 1:24 pm

All times are UTC




Post new topic Reply to topic  [ 78 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Advice needed on SBC
PostPosted: Fri Nov 09, 2018 3:20 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
BigDumbDinosaur wrote:
Mike Naberezny wrote:
I had always used UV EPROMs but I tried an EEPROM for the first time when I built the SBC-2.

I continue to use AMD 27C256 EPROMs, which are rated at 55ns, as no EEPROM will keep up with my POC V1 unit at 12.5 MHz. Atmel (aka Microchip) continues to produce an OTP version of the 27C256 in a 45ns rating.


A few years ago, I bought a tube (I think qty. 20) of brand new Atmel AT28C256 EEPROMs in PLCC-32 rated at 70ns. I can't remember if it was Mouser, Digikey or Newark, but it was from one of their normal distributors. I also found an old gold-pinned ceramic adapter in my old stash and soldered one of these on it so I could use it in place of the standard 28-pin DIP version. I've been running this at 12MHz on my earlier dual-board setup. Not the most timing-efficient board setup, as it uses 3-chips for I/O and ROM decode plus memory write qualifications (74HC00, 74HC30, 74HC138). It has been running for a few months non-stop with EhBasic running a looped program (Bill O's Mandelbrot Basic program).

I also picked up some 70ns Atmel pieces in DIP-28 a while back from UtSource.... they do work, but I've not actually tried one in the 12MHz board setup yet.... I probably should, as it should verify if they are really 70ns parts. I have found the Atmel parts are pretty conservative on ratings... I've been running several of their 150ns EEPROMs with a 10MHz clocked CPU for several years now without a single glitch. Of course, your mileage may vary...

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Mon Dec 24, 2018 2:05 am 
Offline
User avatar

Joined: Thu Jul 26, 2018 4:08 am
Posts: 40
I finally got another set of probes for my logic analyzer. I was going to test them out on one of my boards but when I read the data nothing seemed right. I messed around for about 2 hours before I started the question the working state of the computer. Anyway, when I swapped out the 65C02 it seemed to work? I'm just running a loop. The analyzer triggers after the reset.
Code:
*$8000
8000 LDA #50
8002 JMP $8000
END

Very simple, when I use the suspicious processor it first looks at $FFFA then $FFFB (I have $8000 written in) then it jumps to $8002 and after that I'm not sure what it's thinking.

I attached a very crude capture of the screen. (it's not great) The top capture one is the working processor.

What's happening? Did I blow it, I'm usually cautious of static discharge? Side question; does anyone else have a Tektronix 1240 or 1241? I'm having problems using the disassembly cartridge. It's a bit disappointing, these cost 7$ a piece and with my salary I count every penny!


Attachments:
Capture.JPG
Capture.JPG [ 92.86 KiB | Viewed 1657 times ]

_________________
-Floopy
Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Mon Dec 24, 2018 10:21 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Looks to me as though A1 is stuck high on the "bad" CPU. The first few cycles show it low, but once it goes high, it stays there. That could indicate the low-side pin driver is blown.


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Mon Dec 24, 2018 5:13 pm 
Offline
User avatar

Joined: Thu Jul 26, 2018 4:08 am
Posts: 40
Chromatix wrote:
Looks to me as though A1 is stuck high on the "bad" CPU. The first few cycles show it low, but once it goes high, it stays there. That could indicate the low-side pin driver is blown.

What a shame :( I'll have to be more careful bout static discharge probably. These are so fragile.

I'm working on writing some 1602 LCD routines. It's so much different to program. Different way of thinking and organizing. It's very easy to make mistakes. That's why I'm using the LA to follow the program. I only do it when all else seems lost though because running through lots of hexadecimal numbers is not my cup of tea. (Ah it need to be an 8 not a 0)
I only have NMOS 6502s left. Good thing I put a jumper on the board to select between the two.

_________________
-Floopy


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Mon Dec 24, 2018 5:45 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
I also think A2 is stuck low. See how the $FFFF near the top turns into $FFFB, and the Reset vector pull is from the wrong pair of addresses for A1 to be the only faulty line.

So another plausible root-cause is due to shorting A1 and A2 together while one was driving high and the other low.


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Mon Dec 24, 2018 6:55 pm 
Offline
User avatar

Joined: Thu Jul 26, 2018 4:08 am
Posts: 40
Chromatix wrote:
I also think A2 is stuck low. See how the $FFFF near the top turns into $FFFB, and the Reset vector pull is from the wrong pair of addresses for A1 to be the only faulty line.

So another plausible root-cause is due to shorting A1 and A2 together while one was driving high and the other low.

Maybe when I was hooking it up the LA (over 29 input lines are needed for disassembly). The data/address pins are all connected to a single header.

_________________
-Floopy


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Thu Jan 24, 2019 9:08 pm 
Offline
User avatar

Joined: Thu Jul 26, 2018 4:08 am
Posts: 40
BigDumbDinosaur wrote:
Floopy wrote:
Anyone have recommendations for writing programs?

The Kowalski 65C02 editor/assembler/simulator is what I use.


So I got tired of rewriting everything by hand and I thought I would give the assembler a go. I'm a bit confused on the syntax though. Is there a document explaining how the syntax works? I've never used an assembler of any kind. This isn't my field of expertise.

For example, I'd like to define the variables to be in a specific area of memory.
-Thanks!

_________________
-Floopy


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Thu Jan 24, 2019 9:19 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
The general idea is to assign constants (or labels, which amount to the same thing) with the addresses of your variables. You can then use them in place of literal addresses.

The special label * refers to the current point of assembly. You can assign to * in order to start laying down code at a specific place. Other labels are defined by placing them in the code, starting in the first column. Actual instructions should have whitespace before them, and appear one per line.

The 6502 has a number of different addressing modes, which each have a distinctive syntax which follows the instruction mnemonic. Immediates are prefixed with #, indirections are surrounded by brackets, and indexes are indicated by a comma followed by the index register name. Zero-page is automatically selected for addresses that fit in one byte, versus absolute for two-byte addresses.

Once you have those basics down, look into macros.


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Thu Jan 24, 2019 9:36 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8437
Location: Southern California
Floopy wrote:
For example, I'd like to define the variables to be in a specific area of memory.

I'm not familiar with the Kowalski assembler; but assemblers normally have some way to ORG (ie, set the ORiGin, ie, where you begin laying down code, data, or assigning variables), which takes care of what you're saying. You can use the ORG directive as many times as you want. It's not just a one-time thing. Also, if you want to force a variable to be at a particular exact address, you can make it an equate. For example if you want variable FOOBAR to be at address $001A, you can have a line that says something like
Code:
FOOBAR:  EQU  $1A
and then if you do for example LDA FOOBAR, it will lay down A5 1A (load accumulator with the contents found at address $1A in ZP).

A good macro assembler has way more capability and flexibility than you probably imagine, and removes all kinds of anticipated barriers.

_________________
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  
 Post subject: Re: Advice needed on SBC
PostPosted: Thu Jan 24, 2019 10:51 pm 
Offline
User avatar

Joined: Thu Jul 26, 2018 4:08 am
Posts: 40
Wow thanks! .ORG, I'm also using the document on http://exifpro.com/utils.html as a reference. I think I've got it figured out, it's really nice! It's nice to see the explanation to the instructions show up as I type them.

_________________
-Floopy


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Fri Jan 25, 2019 7:13 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8186
Location: Midwestern USA
Chromatix wrote:
...indirections are surrounded by brackets...
You mean parentheses, such as LDA (PTR1),Y.

In 65C816 assembly language, brackets are used to denote long indirections, such as LDA [PTR1],Y. In this case, PTR1 is assumed to contain a 24-bit address in little endian format.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Fri Jan 25, 2019 7:20 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8186
Location: Midwestern USA
Floopy wrote:
Wow thanks! .ORG, I'm also using the document on http://exifpro.com/utils.html as a reference.

Note, however, that the version of the Kowalski simulator at that site is out-of-date.

Quote:
I think I've got it figured out, it's really nice! It's nice to see the explanation to the instructions show up as I type them.

If you search forum posts for Kowalski you will turn up additional information. For example, here's a list of assembler pseudo-ops (aka directives) you can use:

Code:
IO_AREA           ;define console I/O area address
.ASCII .BYTE .DB  ;define static data, e.g., strings, tables, etc.
.ASCIS            ;like .BYTE, but EOS defined with bit 7 set
.DBYTE .DD        ;assembles big-endian word
.DCB              ;equivalent to *=*+N, where N is arg to .DCB,...
                  ;w/optional initialization pattern, e.g., .DCB 10,$FF
.DS .RS           ;equivalent to *=*+N, where N is arg to .DS
.DW .WORD         ;assembles little-endian word
.ELSE             ;conditional assembly directive
.END              ;marks end of source file, optional
.ENDIF            ;marks end of conditional assembly
.ENDM             ;marks end of macro definition
.ENDR             ;marks end of repeated text
.ERROR            ;emits error message & halts assembly
.EXITM            ;halt continued macro expansion
.IF               ;start conditional assembly
.INCLUDE          ;insert contents of named source file
.IO_WND           ;define I/O window size (cols, rows)
.MACRO            ;marks start of macro definition
.OPT              ;set assembly options
.ORG              ;set start of assembly address, also * = <addr>
.PARAMTYPE        ;determine macro parameter type
.REF              ;determine if label/symbol was defined
.REPEAT .REPT     ;repeat following text N times
.ROM_AREA         ;set write-protected address range
.SET              ;(re)defines variable value, e.g., .SET .=
.START            ;sets simulator start of execution
.STR .STRING      ;generates text string, 1st byte is length (0-255)
.STRLEN           ;determines macro parameter string length

Incidentally, you can set the assembler's program counter with .ORG or with *=. You can also use *=*+N to advance the program counter, where N is the number of bytes to advance. Similarly, *=*-N works in reverse.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Fri Jan 25, 2019 7:31 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8186
Location: Midwestern USA
GARTHWILSON wrote:
Also, if you want to force a variable to be at a particular exact address, you can make it an equate. For example if you want variable FOOBAR to be at address $001A, you can have a line that says something like
Code:
FOOBAR:  EQU  $1A
and then if you do for example LDA FOOBAR, it will lay down A5 1A (load accumulator with the contents found at address $1A in ZP).

In the Kowalski assembler, that would be written as:

Code:
FOOBAR    =$1a

Note that the assembler requires that all labels and symbols start in the first column. Everything else must start in column two or beyond.

You might also find reference to the following useful.

Code:
   .opt proc65c02,caseinsensitive
;KOWALSKI ASSEMBLER LOGICAL, BITWISE & ARITHMETIC OPERATORS
;
;
;   number radices...
;
;       @     binary, e.g., @01011010
;       $     hex, e.g., $5a
;       none  decimal
;
test0001 =@00001111
test0002 =test0001 << 4        ;logical shift left 4 bits
test0003 =test0002 >> 4        ;logical shift right 4 bits
test0004 =test0001 & test0002  ;bitwise AND
test0005 =test0001 | test0002  ;bitwise OR
test0006 =test0001 && test0002 ;logical AND
test0007 =test0001 || test0002 ;logical OR
test0008 =!0                   ;bitwise NOT
test0009 =$5a ^ test0005       ;bitwise XOR
test0010 =4 == 3               ;equality test
test0011 =4 == 4               ;equality test
test0012 =4 != 3               ;inequality test
test0013 =4 != 4               ;inequality test
test0014 =4 > 3                ;greater-than test
test0015 =4 < 3                ;lesser-than test
test0016 =~1                   ;2s complement
;
;
;   arithmetic operators...
;
;       +   addition
;       -   subtraction
;       *   multiplication
;       /   division
;       %   modulo
;
sum      = 5   + 6             ;evaluates to 11
diff     = sum - 6             ;evaluates to 5
prod     = 5   * 6             ;evaluates to 30
quot     =prod / diff          ;evaluates to 6
mod      =prod % sum           ;evaluates to 8
;
;
;   example using square brackets to alter evaluation precedence...
;
test0017 =5 + 6 * 2            ;evaluates to 17
test0018 =[5 + 6] * 2          ;evaluates to 22
;
   .end

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Thu Feb 07, 2019 7:09 pm 
Offline
User avatar

Joined: Thu Jul 26, 2018 4:08 am
Posts: 40
A bit of an update:
Balancing projects and college is an interesting experience. I got into electronics because it looked like a great side hobby, but now it's eating more and more time. Although I don't regret it!

I had a few 1602 LCDs lying around and I thought it would be nice to be able to display text. I wrote a few routines to take care of the interfacing and it works great!
I just had some issues with the timing on the LCD. I also had some issues in my "delay" routine. Thank fully I finally got the disassembly software to work on my logic analyzer and it helped track down the bug. Although now my SBC looks like it's on life-support.

I'm currently running the LCD with an 8 bit data bus and 3 extra lines for the control pins. If I could reduce it down to just 4 bit (send two 4 bit instructions instead of one 8 bit) then I could use the extra I/O on the VIA for exterior control.

Thank you all for the information, I wouldn't be here without any of you!


Attachments:
100_0629.JPG
100_0629.JPG [ 1.51 MiB | Viewed 807 times ]

_________________
-Floopy
Top
 Profile  
Reply with quote  
 Post subject: Re: Advice needed on SBC
PostPosted: Fri Feb 08, 2019 12:44 am 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 586
Location: Michigan, USA
Floopy wrote:
... I'm currently running the LCD with an 8 bit data bus and 3 extra lines for the control pins. If I could reduce it down to just 4 bit (send two 4 bit instructions instead of one 8 bit) then I could use the extra I/O on the VIA for exterior control.

Have you considered using an LCD "Backpack"? The PCF8574 based I2C backpacks work well, too.


Attachments:
K8LH 2-Pin Backpacks.png
K8LH 2-Pin Backpacks.png [ 52.87 KiB | Viewed 783 times ]
3-Pin 74HC595 LCD 8-Bit Mode Backpack.jpg
3-Pin 74HC595 LCD 8-Bit Mode Backpack.jpg [ 51.58 KiB | Viewed 783 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 78 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

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