I was able to connect to my SAF-C164CI-8RM MCU using Minimon. First I connected pins of the MCU like this: RD=0, ALE=0, EA=1, then connceted P3.10/TxD0 and P311/RxD0 to an USB/UART 5V converter.
In Minimon, I went to Target -> Configuration, where I selected Controller type = C164CI-8R and Initialize register to SYSCON = 0x0600 and BUSCON0 = 02C0. I connected to the target and uploaded data from address range 0x0000 - 0x7FFF and 0x18000 - 0x1FFFF (which hopefully should be ROM of the MCU) to Minimon:
*Loader file Prepare
*Minimon file Prepare
*send 0 Byte + Loader + MinimonCore
*RECEIVE - MC-Identifier: D5
*RECEIVE - LoaderACK 01 received
*RECEIVE - Minimon ACK 03 received
*Minimon successfully launched
*Reset: BUSCON0=02C0
*Reset: SYSCON=0690
*Reset Configuration: External Bus disabled
*Reset Configuration: 16 Bit multiplexed Bus
*Reset Configuration: WR# acts as WRL#, BHE# acts as WRH# (P0H.0=1)
*Reset Configuration: On chip watchdog timer is enabled (RD#=1)
*Reset Configuration: Lengthened ALE signal
*Initialisation: Write to SYSCON
*Initialisation: Write to BUSCON0
*Initialisation: Enable X-Peripherals via SYSCON
*Initialisation: Call EINIT Command
*Upload: 1024 bytes
*Upload: 2048 bytes
*Upload: 3072 bytes
*Upload: 4096 bytes
*Upload: 5120 bytes
*Upload: 6144 bytes
*Upload: 7168 bytes
*Upload: 8192 bytes
*Upload: 9216 bytes
*Upload: 10240 bytes
*Upload: 11264 bytes
*Upload: 12288 bytes
*Upload: 13312 bytes
*Upload: 14336 bytes
*Upload: 15360 bytes
*Upload: 16384 bytes
*Upload: 17408 bytes
*Upload: 18432 bytes
*Upload: 19456 bytes
*Upload: 20480 bytes
*Upload: 21504 bytes
*Upload: 22528 bytes
*Upload: 23552 bytes
*Upload: 24576 bytes
*Upload: 25600 bytes
*Upload: 26624 bytes
*Upload: 27648 bytes
*Upload: 28672 bytes
*Upload: 29696 bytes
*Upload: 30720 bytes
*Upload: 31744 bytes
*Upload: 32768 bytes
*Upload: 33792 bytes
*Upload: 34816 bytes
*Upload: 35840 bytes
*Upload: 36864 bytes
*Upload: 37888 bytes
*Upload: 38912 bytes
*Upload: 39936 bytes
*Upload: 40960 bytes
*Upload: 41984 bytes
*Upload: 43008 bytes
*Upload: 44032 bytes
*Upload: 45056 bytes
*Upload: 46080 bytes
*Upload: 47104 bytes
*Upload: 48128 bytes
*Upload: 49152 bytes
*Upload: 50176 bytes
*Upload: 51200 bytes
*Upload: 52224 bytes
*Upload: 53248 bytes
*Upload: 54272 bytes
*Upload: 55296 bytes
*Upload: 56320 bytes
*Upload: 57344 bytes
*Upload: 58368 bytes
*Upload: 59392 bytes
*Upload: 60416 bytes
*Upload: 61440 bytes
*Upload: 62464 bytes
*Upload: 63488 bytes
*Upload: 64512 bytes
*Upload: 65536 bytes
If I click on View -> Disassemble, I always get something like this:
002BA0: TRAP #7B
002BA2: TRAP #7B
002BA4: RETI
002BA6: RETI
002BA8: BSET R13.9
002BAA: BSET R13.9
002BAC: RETI
002BAE: RETI
002BB0: RETS
002BB2: RETS
002BB4: BSET R12.9
002BB6: BSET R12.9
002BB8: BSET R12.15
002BBA: BSET R12.15
002BBC: RETI
002BBE: RETI
002BC0: Illegal Operand
*****************************
I'm not an expert but the code doesn't look valid to me. Can somebody confirm? What should I do to read valid code from the MCU?
Also, if I change e.g. first two bytes (address 0x0000 and 0x0001) and I click Download to write 32 byte long chunk of data I just edited to MCU, I get:
*ERROR: download not successful
How to write code to MCU's ROM?