Using the /TIME line for more than bank switching?
Using the /TIME line for more than bank switching?
Hi all,
Probably a simple question. How are you guys making cartridges that take advantage of SD cards, USB ports, etc?
Is it just the /TIME line or are other lines required too?
I assume you are doing something along the lines of seeing what address is on the bus when the /TIME line is toggled then each address acts as a sort of register. For example, $A13000 could relate to something to do with SPI for an SD card.
I am probably overlooking something very simple, I just cant seem to fix the pieces together in my mind.
Regards.
Probably a simple question. How are you guys making cartridges that take advantage of SD cards, USB ports, etc?
Is it just the /TIME line or are other lines required too?
I assume you are doing something along the lines of seeing what address is on the bus when the /TIME line is toggled then each address acts as a sort of register. For example, $A13000 could relate to something to do with SPI for an SD card.
I am probably overlooking something very simple, I just cant seem to fix the pieces together in my mind.
Regards.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 292
- Joined: Sat Apr 21, 2007 1:14 am
Re: Using the /TIME line for more than bank switching?
It depends on what kind of hardware you are mapping to A10300-A130FF, but generally it can be as simple as just using /TIME for a 'strobe' that does something when you write or read from that range.Alan wrote:Is it just the /TIME line or are other lines required too?
For finer control you would check the address bus and /LWR, /UWR (if using D15-D8 as well) and /CAS0.
Exactly. So when /TIME goes low, I check the other address bits to enable or disable different peripherals within that range, and then also use /LWR and /CAS0 to control those that can be read or written or both. For example the input port is enabled when reading from one address range, the output port is enabled when writing to another range, and the USB chip for reads OR writes in a third range. I can tell which range I'm in by observing the higher address bits like A7 and A6, etc.I assume you are doing something along the lines of seeing what address is on the bus when the /TIME line is toggled then each address acts as a sort of register. For example, $A13000 could relate to something to do with SPI for an SD card.
I think you've got it right; when /TIME goes low you know there's a valid address on the bus within the A13000-A130FF range. If you need to resolve a finer range of addresses you could check the lower address bits (A7-A1), and if you need to check specifically for reading or writing you'd also check /LWR,/UWR and /CAS0.I am probably overlooking something very simple, I just cant seem to fix the pieces together in my mind.
The simplest example would be having a 8-bit latch connected to D0-D7 that is clocked every time /TIME goes low. Maybe to flash some LEDs. This way you could just write anywhere within $A130xx to load it (at odd addresses) and you wouldn't have to use any other signals.
One gotcha would be that reading would also load the latch with garbage data (as you are just going by /TIME, not by /LWR as well) so you'd want to avoid trying to read it. But as you are in control of the software it's never a problem.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
I use !TIME to control all on-cart stuff, such as EEPROM handling and banking mechanisms.
For ultra fast shift left by 8 bits have a register mapped to higher byte, but do a write on lower byte. 68K has both upper and lower byte with same value on writes so the register will get the byte, and when you read it back you get the value, but with a shift
For ultra fast shift left by 8 bits have a register mapped to higher byte, but do a write on lower byte. 68K has both upper and lower byte with same value on writes so the register will get the byte, and when you read it back you get the value, but with a shift
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Thanks for your replies guys, much better understanding now.
What about when I need to read from my 'device' I must need to somehow put that data onto the data lines. What considerations should I take? Maybe the megadrive or my game ROM is already asserting the data lines. Is there a valid sequence or timing I should follow?
Regards.
What about when I need to read from my 'device' I must need to somehow put that data onto the data lines. What considerations should I take? Maybe the megadrive or my game ROM is already asserting the data lines. Is there a valid sequence or timing I should follow?
Regards.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
ROM only puts out data when you access 000000-3FFFFF area. For reads strobing you use the !OE / !CAS0 / B16 signal, for writes strobing you use !UWR and !LWR signals (B28, B29).
Very easy and effective.
Very easy and effective.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Hi, please could you take a few minutes to look over the small schematic I made.
The top shows a 8bit latch attached to D0..7, and by checking !LWR and !TIME via a NOR gate will latch the data bus on writes to $A130xx. Results then displayed on LEDs.
The bottom shows 8 lines that are controlled via the DIP switch to be high or low. This is then fed into a 8bit buffer/line driver. !CAS0 and !TIME via a OR gate controls the output enable on the buffer on reads from $A130xx, allowing the data onto the bus.
Have I missed anything? Once again thanks.
Regards.
The top shows a 8bit latch attached to D0..7, and by checking !LWR and !TIME via a NOR gate will latch the data bus on writes to $A130xx. Results then displayed on LEDs.
The bottom shows 8 lines that are controlled via the DIP switch to be high or low. This is then fed into a 8bit buffer/line driver. !CAS0 and !TIME via a OR gate controls the output enable on the buffer on reads from $A130xx, allowing the data onto the bus.
Have I missed anything? Once again thanks.
Regards.
-
- Very interested
- Posts: 745
- Joined: Sat Dec 15, 2007 7:49 am
- Location: Kazakhstan, Pavlodar
-
- Very interested
- Posts: 208
- Joined: Mon Jun 25, 2007 7:19 pm
- Location: Besançon,France
- Contact:
Hi,
Sorry for bumping this thread but i have a question regarding /TIME.
I work on a Multigame cartridge project and i want to use /TIME as an input for a PIC.
The PIC will drive upper memory adress for bankswicth game.
/TIME will be use as a clock counter.
For the first test i just solder a Led in the /TIME pin ( with a 150 ohm Resistor) , the Led always enabled even if i write into the $A13000-$A130FF range...
Can you tell me what's i'm doing wrong ?
Here is my test code :
Thanks in advance
Sorry for bumping this thread but i have a question regarding /TIME.
I work on a Multigame cartridge project and i want to use /TIME as an input for a PIC.
The PIC will drive upper memory adress for bankswicth game.
/TIME will be use as a clock counter.
For the first test i just solder a Led in the /TIME pin ( with a 150 ohm Resistor) , the Led always enabled even if i write into the $A13000-$A130FF range...
Can you tell me what's i'm doing wrong ?
Here is my test code :
Code: Select all
while (1)
{
VDP_waitVSync();
{
vu8 *pb;
u16 i;
pb = (vu8 *) 0xA13000;
i =255 ;
while(i--) *pb++ = 0;
}
}
-
- Very interested
- Posts: 374
- Joined: Mon Jun 11, 2007 3:09 am
- Location: Azeitão, PT
-
- Very interested
- Posts: 89
- Joined: Mon Feb 24, 2014 6:04 pm
- Location: Kapuskasing, Ontario, Canada
- Contact:
The only way you can get the PIC microcontroller to respond to the #TIME signal would be to trigger a negative edge interrupt (or input capture perhaps, depending on which PIC you are using) - #TIME is not low long enough for any sort of software polling to detect it.
What does db stand for? Well that's an excellent question...
http://www.db-electronics.ca
http://www.db-electronics.ca