6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun May 05, 2024 8:31 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Jul 28, 2020 10:07 pm 
Offline

Joined: Sat Apr 11, 2020 7:28 pm
Posts: 341
"w65c265sxb hacker" is the tool that Bitwise created to make things simpler when tinkering with this development board from WDC, that have that model number.

While working with the clone I'm building, I realized that the rom selection instruction in the "hacker" is inverted (as I see it) against changing the register directly in the Mensch monitor.

The register is $DF024, and when cold booted, it has a value of $C0. That means to me: EEPROM BANK 0. Why #0? Because it's logic for me that after a reset the chip would set the first of the four available banks as the active one.

Changed to $C8, means to me: EEPROM BANK 1
Changed to $D0, is for me: EEPROM BANK 2
and changed to $D8, means EEPROM BANK 3.

But in the "hacker", it seems to me that it's:

$C0 = BANK 3
$C8 = BANK 2
$D0 = BANK 1
$D8 = BANK 0

I checked with the R instruction of the "hacker" and then read the $DF24 value, and got that information. I also put two LEDs attached to P43_FA15 and P44_FAMS and watched them light on and off when changing those values.

And finally, as I was able, thanks to Bitwise and it's utils, to burn its port of EhBasic in the EEPROM of the SXB clone.

And I realized that if I set R 0 with the hacker and then burn the EEPROM as he teaches, when I reset the board and read the $8000 memory, the EhBASIC code is not there.

But by changing $DF24 to $D8 with the M instruction of the Mensch monitor, then the bank selection makes the code to be shown and can be executed.

Is all of this me that is getting all of this the wrong way?

Thanks.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2020 10:52 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
The flash memory is a 128K chip divided into 4 32K banks. The pins used to select the active bank of the flash memory (P43 & P44) are configured as input pins when the W65C265 is reset and two 3K pull-up resistors (R12 & R13) on the SXB board force the P43_FA15 and P44_AMS address lines high, so by default bank 3 is selected.

This bit of code changes the pin direction (PDD4 @ $DF24) and state (PD4 @DF20) to make the pins P43 and P44 low outputs when a 0 is need or an input when a 1 is needed on the address lines.
Code:
; Select the flash ROM bank indicated by the two low order bits of A. The pins
; should be set to inputs when a hi bit is needed and a low output for a lo bit.

                public RomSelect
RomSelect:
                php
                short_a
                and     #$03                    ; Strip out bank number
                asl     a                       ; And rotate into bits
                asl     a
                asl     a
                pha                             ; Save bit pattern
                eor     #$18                    ; Invert to get directions
                eor     PDD4                    ; Work out change
                and     #$18
                eor     PDD4                    ; And apply to direction reg
                sta     PDD4
                pla
                eor     PD4                     ; Then adjust data register
                and     #$18
                eor     PD4
                sta     PD4
                plp                             ; Restore register sizes
                rts                             ; Done

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


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

All times are UTC


Who is online

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