Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

Post Reply
Haruka
Posts: 53
Joined: Fri Mar 23, 2018 8:58 pm

Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by Haruka »

Hello guys! As the title said, recently I built a circuit using 74HCs that implemented 3 switchable + 1 fixed PRG banks (just like n163).

Code: Select all

            138                       670 x 2
        -----v-----                  ----------
CPU R/W-|A0    VCC|          CPU A12-|WA    RA|-CPU A14
 CPU A0-|A1    /Y0|          CPU A13-|WB    RB|-CPU A13  ++++++++-VCC
 CPU A1-|A2    /Y1|                  |        |          ||||||||
/ROMSEL-|/E1   /Y2|   ---------------|/WE  /OE|------    RRRRRRRR
CPU A14-|/E2   /Y3|   |              |        |     |    ||||||||
     M2-|E3    /Y4|----       CPU D0-|D0    Q0|-----|----|||||||+-PRG A13
        |/Y7   /Y5|           CPU D1-|D1    Q1|-----|----||||||+--PRG A14
        |GND   /Y6|           CPU D2-|D2    Q2|-----|----|||||+---PRG A15
        -----------           CPU D3-|D3    Q3|-----|----||||+----PRG A16
            00                       ----------     |    ||||
        -----v-----           CPU D4-|D0    Q0|-----|----|||+-----PRG A17
CPU R/W-|1A    VCC|           CPU D5-|D1    Q1|-----|----||+------PRG A18
CPU R/W-|1B     3A|-CPU A13   CPU D6-|D2    Q2|-----|----|+-------PRG A19
PRG /OE-|1Y     3B|-CPU A14   CPU D7-|D3    Q3|-----|----+--------PRG A20
        |2A     3Y|-+                ----------     |
        |2B     4A|-+                               |
        |2Y     4B|-+                               |
        |GND    4Y|----------------------------------
        -----------
According to my design, 3 regs are in $8002, $A002 and $9002 (mirrored every 4 bytes), which control the bank id of $8000~$9FFF, $A000~$BFFF and $C000~$DFFF. $E000~$FFFF is fixed to the last bank.
But it does not work as I expected. The fixed bank worked perfectly, but writing to any regs didn't switch any bank.
Oh, one thing is unusual: the two 670s are a little hotter than 138 and 00. Not burning hot, but noticable. Maybe short-cut somewhere?
Could anybody give me some hints? Thanks!
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by lidnariq »

Haruka wrote: Wed May 18, 2022 4:05 am but writing to any regs didn't switch any bank.
Nothing obviously wrong. Can you get an LED or "logic tester" on the output of the 74'138 to make sure it's changing?
Oh, one thing is unusual: the two 670s are a little hotter than 138 and 00. Not burning hot, but noticeable. Maybe short-cut somewhere?
74C, HC, HCT, AC, ACT parts run very low power. But 74'670s never came in that variety - the best you get is 74LS. And LS and other older families (F, S, letterless) consume a lot more power statically. It's probably not anything wrong with the '670s.
Haruka
Posts: 53
Joined: Fri Mar 23, 2018 8:58 pm

Re: Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by Haruka »

lidnariq wrote: Wed May 18, 2022 4:58 am Nothing obviously wrong. Can you get an LED or "logic tester" on the output of the 74'138 to make sure it's changing?
Writing to $8002 didn't change 138./Y4, but writing to $8001, $9001, $A001, $B001 (and their mirrors) did! I'm going to dig out the reason.
Haruka
Posts: 53
Joined: Fri Mar 23, 2018 8:58 pm

Re: Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by Haruka »

Further test result:
Writing to $8000, $9000, $A000, $B000
/Y0: low frequency pulse (lfp for short)
/Y1: high frequency pulse (hfp for short)
/Y2: 1
/Y3: hfp
/Y4: 1
/Y5: hfp
/Y6: 1
/Y7: hfp

Writing to $8001 etc.
/Y0: 1
/Y1: hfp
/Y2: 1
/Y3: hfp
/Y4: lfp
/Y5: hfp
/Y6: 1
/Y7: hfp

Writing to $8002 etc.
/Y0: 1
/Y1: hfp
/Y2: lfp
/Y3: hfp
/Y4: 1
/Y5: hfp
/Y6: 1
/Y7: hfp

Writing to $8003 etc.
/Y0: 1
/Y1: hfp
/Y2: 1
/Y3: hfp
/Y4: 1
/Y5: hfp
/Y6: lfp
/Y7: hfp

The low frequency seems equal to the frequency of CPU R/W, while the high freq seems equal to M2. I'm unaware of the precise value of the frequency, I can only distinguish them through the flashing speed of the LED.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by lidnariq »

Somehow you've got the A0-A2 inputs to the 74'138 in the wrong order.
Haruka
Posts: 53
Joined: Fri Mar 23, 2018 8:58 pm

Re: Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by Haruka »

Yes, exactly!
I made a mistake when drawing the pcb, confused CPU A0 and CPU A1 from the daughterboard to the chip.
So a quick fix will be cutting the trace from /Y4, and connect it to /Y2. Am I right?
Last edited by Haruka on Thu May 19, 2022 4:17 am, edited 1 time in total.
Haruka
Posts: 53
Joined: Fri Mar 23, 2018 8:58 pm

Re: Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by Haruka »

Fixed and worked like a charm! Yeah!!!
Thank you so much, lidnariq! You are a genius!
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by Memblers »

Nice, glad you got it to work. I was wondering of those pull-up resistors would be contributing to the '670 running warm. Depends on the resistance I guess.
lidnariq wrote: Wed May 18, 2022 4:58 am 74C, HC, HCT, AC, ACT parts run very low power. But 74'670s never came in that variety - the best you get is 74LS. And LS and other older families (F, S, letterless) consume a lot more power statically. It's probably not anything wrong with the '670s.
Seemed like it was rare and expensive before, but 74HC670 seems to be making a surprise comeback through NXP. Digikey claims to have 9000 in stock, you have to buy 800, but at 37 cents each, that's not so bad. I always shied away from it because of availability, but unless that's some kind of clearance pricing, it's kinda looking like this part might manage to outlive the low-end CPLDs.
wangnengjie
Posts: 6
Joined: Wed Jun 29, 2022 11:27 pm

Re: Help! (3+1) x 8K bankswitch implemented with TTLs, not working?

Post by wangnengjie »

Haruka wrote: Wed May 18, 2022 4:05 am Hello guys! As the title said, recently I built a circuit using 74HCs that implemented 3 switchable + 1 fixed PRG banks (just like n163).

Code: Select all

            138                       670 x 2
        -----v-----                  ----------
CPU R/W-|A0    VCC|          CPU A12-|WA    RA|-CPU A14
 CPU A0-|A1    /Y0|          CPU A13-|WB    RB|-CPU A13  ++++++++-VCC
 CPU A1-|A2    /Y1|                  |        |          ||||||||
/ROMSEL-|/E1   /Y2|   ---------------|/WE  /OE|------    RRRRRRRR
CPU A14-|/E2   /Y3|   |              |        |     |    ||||||||
     M2-|E3    /Y4|----       CPU D0-|D0    Q0|-----|----|||||||+-PRG A13
        |/Y7   /Y5|           CPU D1-|D1    Q1|-----|----||||||+--PRG A14
        |GND   /Y6|           CPU D2-|D2    Q2|-----|----|||||+---PRG A15
        -----------           CPU D3-|D3    Q3|-----|----||||+----PRG A16
            00                       ----------     |    ||||
        -----v-----           CPU D4-|D0    Q0|-----|----|||+-----PRG A17
CPU R/W-|1A    VCC|           CPU D5-|D1    Q1|-----|----||+------PRG A18
CPU R/W-|1B     3A|-CPU A13   CPU D6-|D2    Q2|-----|----|+-------PRG A19
PRG /OE-|1Y     3B|-CPU A14   CPU D7-|D3    Q3|-----|----+--------PRG A20
        |2A     3Y|-+                ----------     |
        |2B     4A|-+                               |
        |2Y     4B|-+                               |
        |GND    4Y|----------------------------------
        -----------
According to my design, 3 regs are in $8002, $A002 and $9002 (mirrored every 4 bytes), which control the bank id of $8000~$9FFF, $A000~$BFFF and $C000~$DFFF. $E000~$FFFF is fixed to the last bank.
But it does not work as I expected. The fixed bank worked perfectly, but writing to any regs didn't switch any bank.
Oh, one thing is unusual: the two 670s are a little hotter than 138 and 00. Not burning hot, but noticable. Maybe short-cut somewhere?
Could anybody give me some hints? Thanks!
crazy guys. you all post the circut with code? why not post picture like jpg? and how to preview the code picture?
sincerely, you did well.
Post Reply