6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue May 21, 2024 9:54 pm

All times are UTC




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: The W65C134 SXB ?
PostPosted: Fri Nov 03, 2023 5:02 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1415
Location: Scotland
Anyone using this SBC from WDC (or any of the "SXB" boards?)

I got one some time back with the idea of using it as a host for my RubyOS projects, but found it quite limiting so left it to gather dust, however I dusted it off yesterday tried to use it and it almost went back into the "pile of useless boards" but I persevered ...

So the '134 CPU is an '816 core (although there seems to be confusion on that in manuals and online notes, etc. as some say 6502 core and some say '816 - I'm suspecting it's really 6502) in a package that allows for a 16-bit address bus and 8-bit data bus with an on-board 4KB ROM (not flash) and on-board 192 bytes of RAM. It has what's similar to 2 VIAs, so 4 x 8-bit ports and 4 timers (one is dedicated to the baud rate generator for the on-board ACIA) and one is for the watchdog timer). One of the ports is used for chip select signals to enable the external RAM and Flash EPROM and some other bits like ACIA pins...

More on the ACIA later, but there is also this weird daisy-chain serial bus thing. I haven't a clue what it's for. Not a scooby. It looks like you could connect multiple devices together in a sort of token-ring type thing, but why? What for? (and why not SPI ...)

The SXB puts it on a board with 32KB of RAM and 128KB of Flash/EEPROM which is addressable in 4 x 32KB 'banks' ... and there is a weird thing about mapping the internal 4K ROM or not...

So I thought I could put a version of my TinyBasic (GIBL) in it (even though it could easily run BBC Basic, but what the heck), and ran into many issues that made me wonder if anyone actually uses this chip or board?

The first is that the hardware registers are mapped into zero page - $00 through $2F... Now I know that some people think this is a good thing - one less byte and cycle to access and all that but my precious zero page! And that it only has 192 bytes of RAM which is mapped to both $0000 and $0100 from $0030 and $0130... Which for an embedded application might just be enough - harking back to the Atari 2600 days, maybe, but in these enlightened days?

Fortunately the SXB board has 32K of external RAM and one of the first things the on-board monitor ROM does is enable it, so phew, real RAM from $0030 up to $7FFF...

So I thought I'd start by running GIBL in RAM before moving it to flash, so followed through my own porting guide (fixing mistakes as I went) and made an image in SREC format to load at $7000 and that's when it all started to go downhill...

The on-board monitor ROM needs hardware or software handshaking but I've found that's not always a workable thing over USB serial ports, but no matter, there are workarounds in my terminal (minicom under Linux) and it was soon squirting code down the line to the RAM..

Now... Here is a thing - the monitor has a list of entry points to do handy things like print a character, get a character and one called CRLF to print a CR then an LF... Except it doesn't. It just prints the CR and you have to get your terminal emulator to auto-add a line feed, else everything is all on one line.

Then the next stumbling block - Zero page - I'd read through the monitor user guide and lifted the base of zero page data and moved some data into higher RAM, but it was still crashing.. Until I read the monitor source code and in the middle I find more zero page data for the interrupt driven serial buffers (all in ZP), so even less zero page for my program to use. In fact, I only got it to work when I raised the base of my ZP data to $D0. That leaves me a mere 48 bytes of zero page data. Putting data into higher RAM is fine and easy but it does slow things down a little.

Then double-characters? The monitor echos input to output - You have to set a bit in some zero page byte to stop the echo - and at that point I wanted to write my own serial handlers...

The next step was to think about running it without any need for the monitor but fell at another hurdle - I've not found out how to poll the ACIA. It seems it's interrupt driven only. There are 2 dedicated interrupt vectors for Tx data and Rx data and from what I can see, the only way to use them is to re-program the Flash EPROM (from code running in RAM) and enable it, disabling the internal monitor in the process and hope it works. The internal monitor does have a way to detect a program in Flash and will auto-start it if it's there - The Flash needs to have the characters "WDC" at address $8000, then it jumps to $8004... So I need code at $8000, vectors up in $FFxx and off it goes...

Of-course if your code breaks then there is no way back without removing the Flash device, erasing it externally and starting again... fortunately it does the same for code in RAM at $0200, and of-course test it by omitting that "WDC" signature, but it still feels like a bit of a "light the blue touch paper and run away" scenario...

However, GIBL supports hex number, peek and poke and I (temp.?) added CLI/SEI commands into it so am now embarking on using it to move programs into Flash, although that's where I gave-up last night.

I think I'll carry on with this - It might be nice to have the board boot directly into BASIC (and for anyone with one of these gathering dust, I'll publish it all) - the board documentation does mention a BASIC and some logging (I think) software for it, but I can't find it, so it's a bit of a little challenge for me right now...

But I'd really like to know if anyone's using these boards - for fun/work/gathering dust?

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Fri Nov 03, 2023 6:16 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
Hi Gordon,

I have some older docs for the 134... also a ROM listing which is oddly formatted... looks like a printer file for an old HP printer. It was assembled on the 2500 AD assembler version 5.01g. The date in the listing file is from 1993, so I don't think SPI was around yet??

Also, it's a 65C02 core per the datasheet. I'm attaching both files here.... I'll keep looking, as I think I have a better ROM list file somewhere.

Hope this helps.

Attachment:
W65C134S.pdf [1.09 MiB]
Downloaded 43 times


Attachment:
134IROMLIST.txt [309.55 KiB]
Downloaded 41 times


Note: I had to change the extension from LST to TXT to get this to upload to the forum.

EDIT:

Turns out the old westerndesigncenter.com site is still up... and has the docs for the ROM monitor and the ROM listing.

https://www.westerndesigncenter.com/wdc ... omlist.pdf

https://www.westerndesigncenter.com/wdc ... monrom.pdf

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


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Fri Nov 03, 2023 6:48 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1415
Location: Scotland
floobydust wrote:
Hi Gordon,

I have some older docs for the 134... also a ROM listing which is oddly formatted... looks like a printer file for an old HP printer. It was assembled on the 2500 AD assembler version 5.01g. The date in the listing file is from 1993, so I don't think SPI was around yet??

Also, it's a 65C02 core per the datasheet. I'm attaching both files here.... I'll keep looking, as I think I have a better ROM list file somewhere.


Thanks - I have the (original?) ROM listing (a a PDF) - but yes, it looks like it was formatted for 70 lines per page and printed on a printer (pdf maker) that did 66 lines per page, so somewhat odd! It's usable though.

It's just the rest of the hardware that's somewhat odd, but I'm getting there...

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Fri Nov 03, 2023 7:24 pm 
Offline

Joined: Wed Aug 21, 2019 6:10 pm
Posts: 217
drogon wrote:
Anyone using this SBC from WDC (or any of the "SXB" boards?) ... So the '134 CPU is an '816 core (although there seems to be confusion on that in manuals and online notes, etc. as some say 6502 core and some say '816 - I'm suspecting it's really 6502) ...


It's the W65C265 that has a '816 core.

The WDC blurb says that the serial bus is for a token passing network of multiple 134's, so I guess the point is not whether it talks to anything else, but rather that it can talk to duplicate versions of itself.


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Fri Nov 03, 2023 7:25 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 706
Location: Texas
For a good long while, I was looking into the W65C265, so I can relate to some of this.

drogon wrote:
I'm suspecting it's really 6502


Yes that's what I got from the datasheet too. The 65265 is the '816 version.

EDIT: Bruce got to it before me!

drogon wrote:
Of-course if your code breaks then there is no way back without removing the Flash device, erasing it externally and starting again... fortunately it does the same for code in RAM at $0200, and of-course test it by omitting that "WDC" signature, but it still feels like a bit of a "light the blue touch paper and run away" scenario...


It's things like this that turned me off from using them. I really liked the idea of adding 2x VIA's essentially, but it's just so goofy to get started and rolling that I was ultimately turned off.

I hope things turn out better in the days ahead! You are confirming my reasons for not going down this road too far. Thanks for that confirmation Gordon!

Chad


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Fri Nov 03, 2023 7:39 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8190
Location: Midwestern USA
sburrow wrote:
For a good long while, I was looking into the W65C265, so I can relate to some of this...
drogon wrote:
...
it still feels like a bit of a "light the blue touch paper and run away" scenario...

It's things like this that turned me off from using them.

Same here. It seemed too much hardware integration was built into these units. Gordon’s wisecrack about “light the blue touch paper...” is apt.  Or, another take is “cut the red wire...”  If it turns out the red wire was the wrong wire...oops!  :D  At least if I mess up one of my POC units, I can fix it.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Fri Nov 03, 2023 7:41 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1415
Location: Scotland
sburrow wrote:
I hope things turn out better in the days ahead! You are confirming my reasons for not going down this road too far. Thanks for that confirmation Gordon!
Chad


Well, right now, it's a dead-end as I don't seem to be able to program the flash. I've tried my own flashing code both in Basic and assembler and even remembered I'd had a brief message from the late Andrew Jacobs (BitWise) and even tried his code on the board (although his was for a different board it's the same flash device), so I've either got the wrong handle on this, or a duff Flash chip - and I don't have an external programmer right now to test it with. There is an LED on the chip-select pin, so I know I'm reading/writing it and I'm sending it the right magic codes to unlock and write, but... nothing.

However it's been a mix of fun and frustrations but using my TinyBasic to test it was fun - being able to call the assembly code from it - I have worked out how to vector and interrupt to a basic subroutine too, should I ever want to (latency would be high compared to asm) and added a new command: old - which Acorn users will recognise - beats the cold/warm start prompt...

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Fri Nov 03, 2023 9:06 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
the 65C134 is 65C02 based, the 65C265 is 65C816 based.
I haven't used the premade SBCs from WDC before, but i still have a discrete 65C265 lying around that i do want to use for a board similar to WDC's, but better (1MB of RAM, more Flash, FT240X instead of an internal UART, DS1086 Programmable Clock, maybe some other stuff too)

but the architecture of these chips is pretty convoluted.
especially trying to boot of an external ROM, i still don't fully understand how that is supposed to work with the BE pin state during reset and stuff.
very weird stuff


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Sat Nov 04, 2023 7:43 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1415
Location: Scotland
drogon wrote:
Well, right now, it's a dead-end as I don't seem to be able to program the flash. I've tried my own flashing code both in Basic and assembler and even remembered I'd had a brief message from the late Andrew Jacobs (BitWise) and even tried his code on the board (although his was for a different board it's the same flash device), so I've either got the wrong handle on this, or a duff Flash chip - and I don't have an external programmer right now to test it with. There is an LED on the chip-select pin, so I know I'm reading/writing it and I'm sending it the right magic codes to unlock and write, but... nothing.

However it's been a mix of fun and frustrations but using my TinyBasic to test it was fun - being able to call the assembly code from it - I have worked out how to vector and interrupt to a basic subroutine too, should I ever want to (latency would be high compared to asm) and added a new command: old - which Acorn users will recognise - beats the cold/warm start prompt...

-Gordon


Just a follow-up...

I did have better things to do, but decided to spend time on it because it really started to bug me so after some time going through the data sheet, schematic and ROM listing in as much detail as I could, using an external programmer (after spending an hour searching for it) for the Flash device, I have eventually worked out how the damn thing works.

At least programming the Flash EEPROM, anyway.

A combination of many things had thwarted me including lack of a simple document that might have said: If you want to re-program the flash in-situ, you do this, and if you want to program it in a programmer, you do that. (Because oh-no, just putting it in a programmer and writing data into it from address 0 would be too easy - you have to do it another way because, surprise! Address 0 in the flash device is not address $8000 in the 6502 memory map...) and other silly issues like writing to the register that has the 4 on-board LEDs is also the 32K bank select register for the flash EEPROM (which is 128KB arranged as 4 banks of 32KB)

I'll write all this up soon, but now I have to replace (re-write) their somewhat dated ROM monitor with something usable, for no reason other than if I want my own serial routines and more zero page, and to do this, I need to take-over the interrupts, throw away their time of day clock and alarm which I don't need and all the other code in there.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Sat Nov 04, 2023 8:55 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8190
Location: Midwestern USA
drogon wrote:
(Because oh-no, just putting it in a programmer and writing data into it from address 0 would be too easy - you have to do it another way because, surprise! Address 0 in the flash device is not address $8000 in the 6502 memory map...)

Hey, Gordon, reading that gave me a chuckle.  :D :lol:  My first attempt to test POC V1.2 tripped over essentially the same booby trap.

In my update to the  V1.1 circuit, I had relocated I/O to $00C000 and the start of ROM to $00D000.  My first spin on the ROM was to program it starting at $0000, like what you did.  However, $0000 in the ROM was effectively being decoded as $00C000 in V1.2’s memory map, which, of course, exposed I/O, not ROM.  So no worky!  :shock:

As Garth once noted, when you figure out something like that, it’s one of those head-slapping moments that makes you feel a little bit stupid.  :evil:

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


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Sun Nov 05, 2023 9:41 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10802
Location: England
Great to hear you persevered and made some progress, Gordon!


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Sun Nov 05, 2023 1:45 pm 
Offline

Joined: Mon Sep 14, 2015 8:50 pm
Posts: 110
Location: Virginia USA
If you wish to go further into the 65c134 there’s a patent available for reading:
US7123107A which can be found at google patents.
There’s also a variety of patents filed for the 65c265. Search William D. Mensch inventor.

Cheers,
Andy


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Sun Nov 05, 2023 4:56 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1415
Location: Scotland
handyandy wrote:
If you wish to go further into the 65c134 there’s a patent available for reading:
US7123107A which can be found at google patents.
There’s also a variety of patents filed for the 65c265. Search William D. Mensch inventor.

Cheers,
Andy


It's somewhat ... amusing and fascinating at the same time...

https://patents.justia.com/patent/5123107

But no - as a mere hobbyist, I don't think I should have to work my way through patent filings just to work out how something works but maybe we hobbyists are not really the target audience for these devices...

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Sun Nov 05, 2023 4:58 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10802
Location: England
We can perhaps safely say that WDC's documentation lets them down again... but it still might be interesting if we can share enough notes to make the thing useful.


Top
 Profile  
Reply with quote  
 Post subject: Re: The W65C134 SXB ?
PostPosted: Sat Nov 11, 2023 7:01 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1415
Location: Scotland
Well after many frustrations, today has been a good one.

I have written my own tiny stub of an IO harness for the 134-SXB - really nothing more than a driver for the ACIA running under interrupts with RAM based buffers (not in zero page) and no handshaking that launches a ROM based version of my TinyBasic. (I could not find a way to poll the ACIA on the '134). The ACIA is an interesting part of the SoC - and works in a way I've not seen in the past, but.

So I have disabled the internal ROM, replaced it with my own IO code in EEPROM and it runs TinyBasic (also residing in EEPROM).

Right now, I have to power on, type a 'g' command (g E000) and it launches my thing. I can get it to auto-start, but it's a bit of a one-way process and if it doesn't work I'd need to take the EEPROM chip out to reset it - although I have that technology, so maybe I shouldn't be too scared...

Overall, somewhat underwhelming on one level, and it's taken a lot of effort to work out how the hardware works on the '134-SXB and to get the ACIA going without all the overhead of what the on-board ROM was doing (not to mention the vast swathes of Zero Page usage).

Locations $00 through $3F are used by the hardware - I initially though it was just up to $2F but it turns out those last 16 are also used, but even when not using them has hardware port IO they are still unavailable when you enable the external address and data bus... Which to all intents and purposes you absolutely have to do unless you can persuade WDC to have your own custom ROM inside it and live with the limitation of 192 bytes of RAM shared from $40 through $FF and mirrored from $140 through $1FF ...

I added in an LED command to control the on-board LEDs because why not. (It sort of reflects the STAT command in the original NIBL) also added in an EOR command as that was handy too. GIBL can poke the rest of the hardware (basically one 8-bit GPIO port another port which you can only use 7 bits off and a few other bits spare in other ports, but not worth it IMO - and just don't get me started on the IO pin choices for some of the on-board functions)

I'm going to add save & load commands as there is a lot of spare EEPROM - sort of debating how to do it, but I think I'll keep it stupidly simple and say that programs can be no more than 16KB in size and filename are numbers from 0 through 6. (There is 128KB of EEPROM, obviously I'm using some for the monitor and TinyBasic) Save, Load and Chain commands and I can arrange it to auto-run program 0 is it has some magic string at the start of it. e.g. REM!BOOT

So power-on and boot to basic just like we (me, anyway) did in 1978.

This may seem like a somewhat fruitless project but it's actually made a good little test-bed for another project I'm in the process of making as a solstice project this year as I'll have a week or 3 off my teaching work.

Does anyone have one of these boards? Is it worth my while putting together a "how to" of loading up the EEPROM on them?

And has anyone heard of the BASIC that WDC has/can supply with these systems? The manuals refer to something called Com Log Basic, but I can't find not a mention of it anywhere ...

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


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

All times are UTC


Who is online

Users browsing this forum: okwatts and 6 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: