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

All times are UTC




Post new topic Reply to topic  [ 59 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Fri Jul 02, 2021 11:35 am 
Offline

Joined: Wed Jun 23, 2021 8:02 am
Posts: 166
BigDumbDinosaur wrote:

There are at least two other electronics distributors in the UK that sell WDC products: BD Electronics and Coltek. Since both are British companies, you might do better price-wise with them than with Digi-Key and Mouser.


If you click through from Coltek to the shop you get to the ebay listing that the original poster mentioned, so I guess he does actually have genuine parts.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 11:40 am 
Offline

Joined: Wed Jun 30, 2021 10:06 am
Posts: 25
kernelthread wrote:
BigDumbDinosaur wrote:

There are at least two other electronics distributors in the UK that sell WDC products: BD Electronics and Coltek. Since both are British companies, you might do better price-wise with them than with Digi-Key and Mouser.


If you click through from Coltek to the shop you get to the ebay listing that the original poster mentioned, so I guess he does actually have genuine parts.


Ahh, thats good to know, Im guessing thats why he was recommended, ive just had a look, my 65c22 from there looks good, my 65c02's from elsewhere are a mess (bent pins, some gunky glue on top of them etc)


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 11:53 am 
Offline

Joined: Wed Jun 30, 2021 10:06 am
Posts: 25
BigDumbDinosaur wrote:

One of my other hobbies is large-scale model railroading. I have scratched built a 1.6" scale model of an EMD F7 locomotive, in which I fabricated most of the parts from "raw" materials. As costs can quickly get out of hand if material is wasted, I heeded the ancient dictum of "measure twice and cut once."

It's the same in the homebrew computer hobby. Double-, triple- and quadruple-check your schematic and your PCB layout before ordering parts and having PCBs fabricated. Nothing can decimate your budget faster than making rookie mistakes and wasting parts. As Ed said a few posts back, electronic design is a very detail-oriented activity. "Close enough" might work in carpentry but will not in building a computer. Making assumptions about things will only lead to a DOA unit and wasted parts.


That scale model looks awesome, in a previous hobby when I had space, I had a metal workshop (CNC Mill, Lathe etc) where I made miniature petrol engines, so I have an appreciation of what can go into that sort of work (and for the cost, buying Aluminium stock always hurt)

As I get older im trying to calm down on switching hobbies, In the past I tended to get just good enough to be dangerous, and then move onto something else (it's a common thing with autistic people). I do often come back to Electronics/Computers in some form tough, whether RC Model Helicopters, Software Defined Radio etc. I think I just always need to be learning something.

In the past when my father had better eyesight he was really in to OO scale model trains (obviously a different ball game to you large scale stuff, more off the shelf parts etc), and often had me building stuff with PIC chips for him to help automate the signals etc (pre arduino days), I can remember I had trouble getting compilers and things to work back then so I ended up using one some Dutch guy wrote which worked flawlessly, only problem was it was his own language/syntax and so all the commands were dutch words, I got quite proficient at it despite not speaking a word of Dutch.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 11:54 am 
Offline

Joined: Wed Jun 30, 2021 10:06 am
Posts: 25
GARTHWILSON wrote:
djh82uk wrote:
I did find your LCD code, but got a bit confused. Initially by the sections for Forth (I've never really touched Forth, a bit of FORTRAN, Pascal, Delphi and the usual more modern stuff, I'm really not a good coder though), and on the ASM the bit that threw me is the reference to the JSR for WAIT_EIGHTH, I couldn't find that subroutine listed anywhere in the code? (I'm just looking for WAIT_EIGHTH:).

If you want to use the assembly-language code, you don't need the Forth portion of the file. WAIT_EIGHTH is overkill but was something that was there anyway for other parts of the project. I don't remember what it was, but hopefully just something in the set-up, since at this point I would never have a routine to simply waste that much time, but instead I would have the processor doing something else useful while the required time is passing! WAIT6800, DELAY_ms, and WAIT40 were also there for other parts of the project, written by the other engineer in the company. Any delay routine that gives the adequate period at your clock rate will be fine. There's a really slick delay routine from Bruce Clark a third of the way down the 6502 Primer's program-tips page at http://wilsonminesco.com/6502primer/PgmTips.html, just above the heading "Avoid commonly wasted instructions:" Obviously you need to know the number of cycles you want at whatever clock speed you're running. The delay can range from 8 to 589832 cycles, with a resolution of 9 cycles.

Quote:
How do you guys assemble/compile your code? I'm just using vasm at the moment but I'm guessing that has its own way of doing some things? Just that a lot of the asm samples I've found for 6502 seem to be quite different in their format. I mean I guess some are written for mainline 6502 systems like the PET/Apple etc.

The assembly language syntax was standardized early in the 6502's history; but there may be small differences in the assembler directives from one assembler to another. I have a list of assemblers at http://wilsonminesco.com/links.html#assem . Most of them are free. I've only used a couple of them for 65xx, plus my own that I have built into my Forth system. There's no way for me to be familiar with all of them linked there, but I can comment on a few:

  • There's Andrew Jacobs' As65 assembler which has program-structure capability built in, and seems to be a really good one. He was active on this forum but died about seven months ago.
  • There's Anton Treuenfels' HXA 6502 assembler which also has program-structure capability built in, apparently modeled after my article on program flow-control macros.
  • There's the Cross-32 (C32) assembler (which I use) formerly from Universal Cross Assemblers, now sold by Data Sync Engineering. Also available at http://www.mpeforth.com/cross32.htm. It's not free (it's $99US), but the one assembler is good for lots of different processors, and they even give you the information to adapt it to a processor of your own design. I really like how it handles the 8-/16-bit stuff on the 65816 processor which I think is much nicer and easier than how other assemblers do it.
  • The Kowalski assembler, IDE, and simulator seem to be popular here on the forum. It is being improved by forum member Daryl ("8BIT"). See more about it in my my list of assemblers.

Whatever you choose, make sure it has good macro capability, so as you move up and start wanting macros, you don't find that your chosen assembler won't do them, after you've invested time getting familiar with it. I show some examples of how the level of the language can be raised with assembly-language macros in the last 40% of my page on simple multitasking methods, at http://wilsonminesco.com/multitask/ . In most cases, they assemble exactly the same thing you would do by hand if you didn't have the macro capability; so there's no penalty in run speed or memory taken—it's just that you no longer have to look at the ugly internal details every time, and your code becomes much clearer (meaning also you'll tend to write fewer bugs), and more maintainable. Most of the labels will be gone. All of the structure macros can be nested with other structures of different kind; and the only ones that cannot be nested with others of the same kind are CASE and the 16-bit FOR...NEXT (which I doubt you'll ever need to nest with themselves anyway).



Thanks, I will take a look at some of those, makes sense to be using what others are when I have so much to learn. Im taking it Vasm doesn;t get used much here?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 12:29 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Just to note, fans of Basic, BBC Basic, or Acorn's BBC Micro might enjoy Beebasm, an assembler embedded in something rather like BBC Basic. Or at bbcmic.ro (Owlet IDE) you can play with small examples. If you want to learn from scratch or explore small code snippets, easy6502 is very handy.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 12:52 pm 
Offline

Joined: Wed Jun 30, 2021 10:06 am
Posts: 25
BigEd wrote:
Just to note, fans of Basic, BBC Basic, or Acorn's BBC Micro might enjoy Beebasm, an assembler embedded in something rather like BBC Basic. Or at bbcmic.ro (Owlet IDE) you can play with small examples. If you want to learn from scratch or explore small code snippets, easy6502 is very handy.


That Easy6502 looks great, something for my weekend reading :)


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 6:22 pm 
Offline
User avatar

Joined: Fri Jun 25, 2021 5:38 am
Posts: 72
Location: Portland, Oregon, USA
BigDumbDinosaur wrote:
Quote:
Im eyeing up getting one those expensive ZIF sockets for my EEPROM...

Although my hobby computing isn't constrained by a budget, the Irishman in me tends to be frugal. Rather than buy a ZIF socket for each machine I build, I put a conventional socket on the board and plug the ZIP socket into it. Doing so adds some parasitic capacitance, but I still managed to get my POC V1.2 unit to run at 20 MHz.

When you move on to the next design, merely remove the ZIF socket from the old unit and use it in the new one. That way, the socket becomes a one-time expenditure.


Wow, I love this tip. I'll need to order some conventional 28-pin wide sockets but this makes so much sense to me. Especially since I did pick up one of those slimmer cuter ZIF style sockets you mentioned.

_________________
https://github.com/Individual-Solid/


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 7:17 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
djh82uk wrote:
BigEd wrote:
Just to note, fans of Basic, BBC Basic, or Acorn's BBC Micro might enjoy Beebasm, an assembler embedded in something rather like BBC Basic. Or at bbcmic.ro (Owlet IDE) you can play with small examples. If you want to learn from scratch or explore small code snippets, easy6502 is very handy.

That Easy6502 looks great, something for my weekend reading :)

Note that Easy6502 does not have the added CMOS instructions and addressing modes. It will have some value for starting out; but don't depend on it to go much beyond that.

_________________
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: Fri Jul 02, 2021 7:22 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Yes, there's lots easy6502 doesn't offer - I'd hoped to convey that in what I wrote! (But it's a great tutorial for beginners, and a handy place to try short snippets of code.)


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 03, 2021 3:17 pm 
Offline

Joined: Wed Jun 30, 2021 10:06 am
Posts: 25
Just a quick update,

I put together a quick reset circuit from a 555, it's way overkill in that it gives a 2s delay. But it works consistently, regardless of whether power is initiated from the PSU, switch or pwering on it RST held and then released :)

Now just waiting om ordering a new PCB, DS1813 etc :)

Thanks guys


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 03, 2021 4:07 pm 
Offline

Joined: Wed Jun 30, 2021 10:06 am
Posts: 25
Ok, so ive been working through my re-design of the PCB's and trying to apply what ive learnt from you guys and Garths primer.

Ive taken a lot from Grant Searles 6502 design, and added a 65c22 (same address spaces as $6000 - $6FFF was free on Grants design, so I could wires it up the same way it was on the original design.

Ive got the DS1813 reset circuit, decoupling caps for every chip, and tied the extra lines via 3.3k.

Also added the serial interface, and additional board for video/keyboard based on Grants design.

I think if I can get this to work, then I can start looking at my own changes etc as I learn more.

I want to do a bit more validation etc before getting the pcb's ordered.

The Memory Map should be:
0000-7FFF 32K RAM
8000-9FFF VIA
9000-9FFF FREE SPACE (4K)
A000-BFFF SERIAL INTERFACE
C000-FFFF 16K ROM

But im worried whether ive miscalculated on the VIA being at $8000? Is tying A15 and inverted A15 to CS1 and _CS2 the right approach?

But advice welcome as always


Attachments:
Schematic_GSx1966_2021-07-03.png
Schematic_GSx1966_2021-07-03.png [ 200.11 KiB | Viewed 1030 times ]
Schematic_GSx GIO V1.0_2021-07-03.png
Schematic_GSx GIO V1.0_2021-07-03.png [ 95.56 KiB | Viewed 1030 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 03, 2021 5:37 pm 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
If you want you VIA respond to address in the $8000 or $9FFF range then you need to decode the 3 address lines A13 to A15, not just A15.
A15 high decodes every address from $8000 to $FFFF.
IF you want just the $8000 to $8FFF then you'll need to include A12 as well.

If you look at the binary values
Code:
$8000-$8FFF = 1000 xxxx xxxx xxxx
$9000-$9FFF = 1001 xxxx xxxx xxxx
then it becomes obvious what address lines need to be dcodes, and at what level.

For the larger range you need A15 high, A14 and A13 low. So if A15 goes to the active high chip select then that means (A13 OR A14) needs to be fed to the active low, as if either of the address lines is high the address is out of the range required.

For the smaller block, that would A15 again to the active high select, with (A14 OR A13 OR A12) to the ative low.

For running at slow speeds, the simplest decode method to add IO devices to Grant's design is to use the 74HCT138. The 138 has 3 selects one high and two low. So will decode the $8000 to &9FFF memory area without any additional support. Wiring A10 to A12 to the A, B & C inputs gives you 8 device selects each for a 1k block within that range.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 03, 2021 8:46 pm 
Offline

Joined: Wed Jun 30, 2021 10:06 am
Posts: 25
Awesome Thank you, I had a suspicion it wasn't right, still struggling to calculate them, I made the mistake of only looking at the binary for $8000 which is where the A15 came from, but can see now where I went wrong.

What would you consider low speed for the 74HC138? I guess it is simpler to do the OR of the A14 & A13 for this one? Ive got nothing else to put in that address space.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 04, 2021 6:18 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8509
Location: Midwestern USA
Why are you using that 68B50? That UART doesn't have a baud rate generator and is not CMOS-compatible. See if you can track down a non-WDC 65C51.

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


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 04, 2021 10:48 am 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
djh82uk wrote:
What would you consider low speed for the 74HC138?

That's relative, and depends on the CPU etc. A little digging in data sheets and some maths is required.

The modern W65C22 needs the chip selects stable 10ns before the clock rises, so chip selection has to be completed in 10ns less than the low half of the clock cycle.

The data sheet for the Nexperia HCT138 says worst case propagation delay at room temperature is 40ns. Other manufacture's parts may not be exactly the same, but will be similar.

If you've also got the WDC 65C02 then that has a worst case of 30ns from the clock going low to address being stable when running at 5v.

Add the three valuess together and that's 80ns minimum for the clock to be low for the chip select to meet all of the specified maximums. That is then 160ns for a complete clock cycle, which works out at 6mhz give or take a few fractions well short of what the CPU is capable of.

The older 65xx parts will have longer setup times and a lower maximum clock.

That's not to say you can't run faster than that it's just not guaranteed.

NB if you do have all WDC parts then the HC138 is also suitable and a little faster. The "T" part is designed to cope with TTL inputs ie NMOS 6502.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 23 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: