The W65C134 SXB ?
Posted: Fri Nov 03, 2023 5:02 pm
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
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