Summer growing season is about done. I have 50 gallons of wines fermenting away in the garage; dahlias still in the field waiting for the killing frost so I can dig them up. Sent off a few pc boards to JLCPCB; next I'm returning to the W65C816 overclock experiment. First thing is checking W65C02 still work at 40MHz where I left it, it does. Removing W65C02 and replacing it with W65C816 (Mouser W65C816S6TPG-14) and it still work at 40MHz like nothing changed but power consumption is 15mA higher. Verify E pin is high so W65C816 is in emulation mode after reset as it should.
Hmm, so 0.6u W65C816 can run to 40MHz, at least in the emulation mode. Like W65C02, I found it necessary to raise voltage to 5.2V to have reliable operation with my simple test program which means 40MHz is right at the frequency limit.
Now I need to read the manual to figure out how to run it in native mode...
*******Update*****
Never imagine it would be XCE instruction to switch between emulation and native modes! So here is a modified ROMtest program that prints 256 bytes to console in emulation mode including wrapping around 64K memory boundary and then switches mode to native mode and prints 256 bytes to console and then switches back to emulation mode and repeat.
Code:
;ROM space from 0xC000 to 0xFFFF and from 0x0000-0x3FFF
;Actual ROM is 64 bytes, alias every 64 bytes over the ROM space
;serial port space from 0x4000 to 0xBFFF. data is at even address, status is at odd address
; Status d0 is receive data ready; status d1 is transmit empty
SerData = $7001 ;Serial transmit register
SerStat = $7000 ;Serial transmit status
;
.p816
.ORG $FFC0
.word start ;this is operand of 'JMP start' instruction
;wrapped around 64K memory boundary
; ROM based test program
; write data out to serial port, then wait for TxEmpty flag
; JMP instruction wrap around 64K boundary
start:
STX SerData ;write to serial port
chkTXE:
LDA SerStat
AND #2 ;check transmit empty
BEQ chkTXE
INX
NOP
NOP
NOP
NOP
BNE $FFFF
CLC ;switch to native mode
XCE
;execution in native mode
start1:
STX SerData ;write to serial port
chkTXE1:
LDA SerStat
AND #2 ;check transmit empty
BEQ chkTXE1
INX
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
BNE start1 ;do no do instruction wrap around at 64K
SEC ;switch to emulation mode
XCE
JMP $FFFF
.org $fffc
.word start
; .byte 0
JMP start ;instruction wrap around 64K.
Attached picture is screen capture of the program running at 40MHz @5.3V It appears to run successfully alternating between emulation and native modes. Examine the 'E' output of 65816 I see it toggles between high and low every 22.8mS. Since the serial baud is derived by 40MHz/22 effectively 113600N81 (98.6% of standard baud of 115200), it takes about 22.5mS to transmit 256 bytes, so that's about right.
I think W65C816 CAN run to 40MHz.
Bill