6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 10, 2024 9:35 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Sat Jun 01, 2024 8:25 am 
Offline

Joined: Sat Jun 01, 2024 8:05 am
Posts: 9
Hi! This is my first post. I have been lurking here for a few weeks and decided on getting an W65C816SXB board to get my feet wet and see where I want to go... And that is a hurtful experience so far.

I did try some sxb.py-scripts that are floating around first, because I do not run Windows on any computer. They all gave communication issues.

When powering the board from factory the X has flashes that goes around 4 laps, then the SRAM LED turns on.

When trying to communicate with the board the VIA2 LED turns on.

I did install a VM with Windows and followed the guide on https://wdc65xx.com/ but the program locks up for a long time on startup and when I go to "View Target Info" I only get
Code:
0xFF...
in all fields.

If I choose restart and then Go To "2000" I get "WDCDB Info" -> "Unknown fault at 00000000: code = 00FF"

The FTDI chip is identifying fine and I have tried multiple USB cables.

Is this salvageable before I need to try to return it? I hope I can download a ROM dump someone made and write to the flash, but I don't have a flasher so before investing hours to build one or a lot of cash to buy one I would like some kind of hint that it might work.


Last edited by cyberdo on Sat Jun 01, 2024 6:31 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 01, 2024 11:04 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
I don't have anything helpful to add but I am looking for the stock ROM for the W65C816SXB too. I managed to overwrite the monitor / communication programs on mine. I didn't think it would let me do that.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 01, 2024 11:30 am 
Offline

Joined: Sat Jun 01, 2024 8:05 am
Posts: 9
AndrewP wrote:
I don't have anything helpful to add but I am looking for the stock ROM for the W65C816SXB too. I managed to overwrite the monitor / communication programs on mine. I didn't think it would let me do that.

viewtopic.php?f=4&t=6326&start=15#p91144

That is the one I am hoping will help for me.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 02, 2024 9:02 pm 
Offline

Joined: Sat Jun 01, 2024 8:05 am
Posts: 9
I have just ordered a socket and some hardware to build a flash reader/writer. It should get here in a few days and I'll keep this thread updated. Hopefully no one else has this issue, but if they do this might help.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 03, 2024 1:28 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Thanks for the helpful attitude, cyberdo. And congrats on your graduation from lurkerdom!

--Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 05, 2024 9:20 pm 
Offline

Joined: Sat Jun 01, 2024 8:05 am
Posts: 9
So, a really ugly rats nest (both in hardware and software) later I managed to read the flash and it indeed looks like it is accessing XCS* to blink the LEDs. The disassembly was not good but looks close enough to something viable. The interrupt vectors does not match the XLEDFLASH nor the monitor and it blinks the X like the monitor does not but accesses VIA-USB like the XLEDFLASH does not.

I did get a very quick reply from Western Design Center but he didn't have time to help at that time (he's hopefully getting back this week).

He was suspecting something as easy as the monitor being updated and the software being outdated. That would be simple and an easy solution. I have other engagements I can focus on while waiting, so this might be delayed a few days.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 17, 2024 8:00 am 
Offline

Joined: Sat Jun 01, 2024 8:05 am
Posts: 9
So, this issue has been resolved!

The problem is that newer dev boards use a newer monitor with a new protocol. I did ask if I was allowed to publish the flash images (old and new) but did not get a response.

The uploader is MIT licenced though, so I am attaching it here. USE IT AT YOUR OWN RISK of course. For me it worked flawlessly on Linux using Python3.

The image it expects is the output file from the WDC assemblers. My current "myled.s" starts at
Code:
.org $1000
and the make script is:

Code:
#!/bin/sh
wine WDC02AS -g -l -DUSING_02 myled.s || exit
wine WDCLN -g -sz -t -HZ myled || exit
wine WDCSYM -A -L myled.sym>myled_sym.txt || exit
wine WDCOBJ myled>myled_obj.txt || exit

python3 wdc_uploader_term.py -d /dev/ttyUSB0 -a 001000 -x -m write -v myled.bin


EDIT: A warning: The monitor leaves the CPU running in native mode (non-emulated, so not the same state as on boot). This caused me a lot of head scratching. Symptoms are for instance:
Code:
ldx #0
requires a trailing nop (to account for the missing byte of the second half of 16 bit value). Sequences like:
Code:
    ldx #0
    nop ; Required because ldx is expecting more data to the instruction
delay:
    dex
    bne delay

takes much longer time than expected since X is 16 bits instead of 8.

For newcomers using the WDC assembler, this is the first few lines I use to set up the org and switch back to 6502:
Code:
        .org $1000
        CHIP 65816 ; start in native mode
        SEC ; set carry for emulation mode
        XCE ; go into emulation mode
        CHIP 65C02 ; don't want to use any 65816 codes


EDIT: "WDC assembler" instead of "WDC compiler"


Attachments:
wdc_uploader_term.txt [54.17 KiB]
Downloaded 37 times


Last edited by cyberdo on Fri Jun 21, 2024 6:23 am, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 17, 2024 8:55 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8481
Location: Midwestern USA
cyberdo wrote:
Sequences like:

Code:
    ldx #0
    nop ; Required because ldx is expecting more data to the instruction
delay:
    dex
    bne delay

takes much longer time than expected since X is 16 bits instead of 8.

Just to clarify what you are saying, the longer execution time is due to .X being counted down from (effectively) 59,904 by sticking the NOP in there.  The DEX instruction uses two clock cycles, regardless of register width.  Since .X is “wide,” just change LDX #0 - NOP to LDX #$0100, which will produce the desired delay.

Quote:
For newcomers using the WDC compiler, this is the first few lines I use to set up the org and switch back to 6502:

Code:
        .org $1000
        CHIP 65816 ; start in native mode
        SEC ; set carry for emulation mode
        XCE ; go into emulation mode
        CHIP 65C02 ; don't want to use any 65816 codes

The above is something you would use in the assembler, not the compiler.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 21, 2024 6:24 am 
Offline

Joined: Sat Jun 01, 2024 8:05 am
Posts: 9
BigDumbDinosaur wrote:
[color=#000000]
cyberdo wrote:
The above is something you would use in the assembler, not the compiler.


I have now corrected the compiler/assembler.

Thanks for clarifying and explaining! For all intents and purposes I am pretty new to this.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 21, 2024 6:29 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Welcome, cyberdo! Don't worry about the pedantry, be sure to enjoy yourself!


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 21, 2024 7:22 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8481
Location: Midwestern USA
BigEd wrote:
Welcome, cyberdo! Don't worry about the pedantry, be sure to enjoy yourself!

It isn’t “pedantry,” Ed, no matter how hard you try to make it so.  A compiler and an assembler are two different software tools, same as a screwdriver and a wrench (spanner) are two different mechanic’s tools.  How about if you keep your insults to yourself?

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 21, 2024 7:25 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
I'm not posting insults, BDD. I'm aware of the difference in dialects - there are plenty of places where "compiler" and "compiling" is the term in use. I'm adopting the descriptivist stance, rather than the prescriptivist stance. You could do the same, if you wished. You can't convert the world's usage, one person at a time - but you can certainly run the risk of putting people off.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 23, 2024 12:27 pm 
Offline

Joined: Sat Jun 01, 2024 8:05 am
Posts: 9
I definitely know of people that would be put off by comments that might be well meaning, but was interpreted as negative. I did not interpret the correction as such, but I could have if I had been in the wrong mood. So I am fine. I appreciate you both for trying to educate AND encourage. Thank you! But maybe we could nip it in the bud?

Now, to stay on topic: I have put up a modified uploader at https://github.com/cyberdo/wdc_uploader_term including some changes to enable binary and Intel HEX-format (besides the original ZARDOZ format).

If someone is interested in the future.

I also have MS BASIC running on the board and have sent a PR to https://github.com/mist64/msbasic for the changes but I am not sure it is "in the spirit" of the repo because it is a new board. We'll see.

I feel I should start a new thread as a diary. My wife lost interest way before I started playing with this :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

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