Guest User

Programmable Wait State Generator

a guest
Jun 12th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.98 KB | None | 0 0
  1. RE = Rising Edge
  2. FE = Falling Edge
  3.  
  4. I'm sorry if this whole description of a circuit is confusingly written i tried my best to write down how i think this thing could work but i kept rewriting different parts of it over and over again, so it'll likely require a few reads.
  5.  
  6.  
  7. >>>>Programmable Wait State Generator:
  8. >>>>Main Idea:
  9.  
  10. the whole thing uses a "Slot" System, where each slot consists of atleast 3 registers.
  11. more Registers can be added too, for example the order/use of all 8 bits inside the first Control Register are reserved.
  12. so if you need more control bits you need to add an extra Control Register.
  13. it's recommended that all Registers of the same type are directly after one another and the overall order is always Control, Start, End.
  14.  
  15. (x refers to the slot number)
  16. (y refers to the Register number, if there are more than 1 of a Register Type Present)
  17. Cyx - Control Register
  18. Syx - Starting Address Register
  19. Eyx - Ending Address Register
  20.  
  21. so for example the 2nd Starting Address Register of slot 4 would be called "S14"
  22.  
  23. if the CPU Accesses a Memory Location that is equal to or between the contents of the Sx and Ex Registers
  24. or the opposite if the "invert" bit in the Cx Register is set (bit 1)
  25. and the "Slot enable" bit is set in the Cx Register (bit 0)
  26. then the ~RDY output will be pulled low on the next RE for some amount of clock cycles (+ 1) given by the Cx Register (bits 2-7)
  27. once all the cycles have passed, or the ~DONE input has been pulled low, ~RDY will be pulled high at the next RE.
  28.  
  29. Slots with a higher number have a higher priority
  30.  
  31.  
  32. >>>>Register Selection:
  33.  
  34. Accessing Registers is pretty simple. one IO Address is used for a Write-Only "Selection Register" that selects the slot which has it's Register placed in memory after itself.
  35. for example if the Selection Register is placed at 0xDF00 in Memory (and the devices uses a 4 register setup) then memory will look like this after selecting any slot.
  36.  
  37. 0xDF00 - Selection Register
  38. 0xDF01 - Control Register 0 (Slot x)
  39. 0xDF02 - Control Register 1 (Slot x)
  40. 0xDF03 - Starting Address Register (Slot x)
  41. 0xDF04 - Ending Address Register (Slot x)
  42.  
  43. this allows for a total of 256 Slots. (assuming an 8 bit Selection Register)
  44.  
  45.  
  46. >>>>Address Register Details:
  47.  
  48. The total width of the Address Registers and how the bits are ordered depend on what is required in the system.
  49. And also what resources are available (TTL Logic ICs, Small CPLD, Large FPGA, etc)
  50. essentically there are 3 ways to Address the Wait State Range.
  51.  
  52. 1. The full thing:
  53. Where the Address Registers have the same width as the Address Bus of the CPU (16/24 bit for 65C02/65816)
  54. This gives the you best Control as a Slot can select any range from a single Address to the whole Address Space.
  55. Downside is that it's rather expensive and requires a lot of Registers and logic (especially for the 65816).
  56.  
  57. CPU: xxxxxxxx xxxxxxxx xxxxxxxx
  58. Sx : ssssssss ssssssss ssssssss
  59. Ex : eeeeeeee eeeeeeee eeeeeeee
  60.  
  61. 2. Slicing off upper bits:
  62. Where the Address Register's width is smaller than the Address Bus of the CPU.
  63. for example on a 65C02, 8 bit Address Registers can represent the bottom 8 bits of the Address Bus, and the upper 8 bits are taken
  64. from an extra Control Register.
  65. this Limits the total range of a Slot to the current 256 byte page it is placed in by the 2nd Control Register.
  66. but it allows for individual Addresses to be selected and saves some resources.
  67. this is useful if you only have a Small CPLD or not a lot of slow multi-page large IO Devices.
  68.  
  69. CPU: xxxxxxxx xxxxxxxx
  70. Sx : cccccccc ssssssss (bottom 8 bits: Starting Address Register, upper 8 bits: 2nd Control Register)
  71. Ex : cccccccc eeeeeeee (bottom 8 bits: Ending Address Register, upper 8 bits: 2nd Control Register)
  72.  
  73. 3. Slicing off lower bits:
  74. Same idea as 2. but instead of the Addresss Registers being aligned with the bottom n bits of the Address Bus they are aligned with the upper n bits.
  75. using the 65C02 as an example, the Address Registers are 8 bit wide but this time represent the upper 8 bits of the Address Bus, the lower 8 bits are simply ignored. this means the range is always in steps of 256 bytes, making it impossible to select individual Addresses.
  76. This seems useful for selecting Memory (Slow ROM, DRAM, etc) or if you have a lot of similarly slow IO Devices in a single area.
  77.  
  78. CPU: xxxxxxxx xxxxxxxx
  79. Sx : ssssssss 00000000 (bottom 8 bits: 0, upper 8 bits: Starting Address Register)
  80. Ex : eeeeeeee 00000000 (bottom 8 bits: 0, upper 8 bits: Ending Address Register)
  81.  
  82.  
  83. >>>>Conclusion:
  84.  
  85. Overall i think a Universal/Progammable Wait State Generator like this could be useful for any PC-like System that allows you to add a lot of extra IO Devices, where it's not guaranteed that the IO Device will be fast enough or what the exact speed of the CPU at any given time is going to be.
  86. so instead of each IO Device having to implement it's own Wait State circuit, you just have one of these Wait State Generators with the CPU and then just slow down each device using Software/Drivers instead.
Add Comment
Please, Sign In to add comment