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...
Advice needed on SBC
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: Advice needed on SBC
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 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
https://github.com/floobydust
Re: Advice needed on SBC
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.
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!
Code: Select all
*$8000
8000 LDA #50
8002 JMP $8000
END
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!
-Floopy
Re: Advice needed on SBC
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.
Re: Advice needed on SBC
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.
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
Re: Advice needed on SBC
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.
So another plausible root-cause is due to shorting A1 and A2 together while one was driving high and the other low.
Re: Advice needed on SBC
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.
So another plausible root-cause is due to shorting A1 and A2 together while one was driving high and the other low.
-Floopy
Re: Advice needed on SBC
BigDumbDinosaur wrote:
Floopy wrote:
Anyone have recommendations for writing programs?
For example, I'd like to define the variables to be in a specific area of memory.
-Thanks!
-Floopy
Re: Advice needed on SBC
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.
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.
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Advice needed on SBC
Floopy wrote:
For example, I'd like to define the variables to be in a specific area of memory.
Code: Select all
FOOBAR: EQU $1AA 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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Advice needed on SBC
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
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Advice needed on SBC
Chromatix wrote:
...indirections are surrounded by brackets...
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!
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Advice needed on SBC
Floopy wrote:
Wow thanks! .ORG, I'm also using the document on http://exifpro.com/utils.html as a reference.
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.
Code: Select all
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 lengthx86? We ain't got no x86. We don't NEED no stinking x86!
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Advice needed on SBC
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
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).
Code: Select all
FOOBAR: EQU $1ACode: Select all
FOOBAR =$1aYou might also find reference to the following useful.
Code: Select all
.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
;
.endx86? We ain't got no x86. We don't NEED no stinking x86!
Re: Advice needed on SBC
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!
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!
-Floopy
Re: Advice needed on SBC
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.