TITLE ***UNTESTED_CONCEPT_ONLY*** SCMP with 128kB Memory, USB PATTERN Code is 64kB, Data is 64kB-32B, Code cannot be updated in-system REVISION 0.99 USR io is hex, quad, long, word & byte. AUTHOR Diego Basul FB, (select senseA/B for USB, other for USR) COMPANY Scarness, Hervey Bay, Queensland, AUSTRALIA, 4655 DATE 2023 Done just to keep my brain cells alive (longer) CHIP _SCMP128k mach210 ;------------------------------------------------------------------- PIN ? nads ;CPU..same as /ADS (PALASM expects +ve iCLK's) NODE ? c[1,0] REG ;Code/Data counts..see ram/rom below ;------------------------------------------------------------------- PIN ? /rst ;CPU /Reset PIN ? nwr ;CPU /Write..(PALASM expects +ve iCLK's) PIN ? nrd ;CPU /Read...(just for consistency with nwr) PIN ? d[5,3..0] ;CPU DataBusBits needed this version PIN ? a[11..0] ;CPU AddrBusBits11:0 PIN ? a[15..12] COMB ;CPU AddrBusBits15:12 NODE ? ocf COMB ;CPLD OpCodeFetch..like 6502:sync ? NODE ? devs COMB ;data0000:001F (32B used for IO) ;-------------------------------------------------------------------- PIN ? /hex COMB ;data0010:001F any 16B device (for USER) ;-------------------------------------------------------------------- PIN ? /quad COMB ;data0008:000F any 8B device (for USER) ;-------------------------------------------------------------------- PIN ? /long COMB ;data0004:0007 any 4B device (for USER) ;-------------------------------------------------------------------- PIN ? /word COMB ;data0002,0003 any 2B device (for USER) ;-----SystemConsoleInterrupt----------------------------------------- PIN ? /rxf ;USB we have data..so READ it PIN ? sense COMB ;CPU choose senseA/B ;.....SystemConsole.................................................. PIN ? /wUSB COMB ;USB data0001wr..ft245r PIN ? rUSB COMB ;USB data0001rd..ft245r ;-------------------------------------------------------------------- PIN ? byte COMB ;data0000rw (Toggle/wrConfigByte) ;-------------------------------------------------------------------- PIN ? /ram COMB ;ChipSelect 61c512 (data is 64kB-32B) PIN ? /rom COMB ;ChipSelect 28c512 (64x 4kB, 0'th is BootRom) ;========Constants=================================================== STRING NO '0' ;Negated or False STRING OK '1' ;Asserted or True ;-------------------------------------------------------------------- STRING RD '(/nrd)' ;StrobeRD STRING WR '(/nwr)' ;StrobeWR STRING RW '(RD+WR)' ;StrobeEither ;------FlagRD-------------------------------------------------------- STRING rFlag 'd[4]' ;Flag RD on nads..still thinking ! ;------OpCodeFetch--------------------------------------------------- STRING iFlag 'd[5]' ;Flag OpCodeFetch on nads ;******************************************************************** EQUATIONS ;==================================================================== sense.TRST = VCC ;use transistor inverter due 36 signals sense = /rxf ;for xc9572xl vs 38 signls for mach210. ;==================================================================== devs = /c[1]*/a[15]*/a[14]*/a[13]*/a[12]*/a[11]*/a[10]*/a[9]*/a[8]*/a[7]*/a[6]*/a[5] ;==================================================================== c[1,0].SETF=GND c[1,0].RSTF=rst c[1,0].CLKF=nads ;-------------------------------------------------------------------- case(ocf, c[1,0])begin ;NB: /ads signifies that CPU will use the buses 0: begin c[1,0] = 1 end ;c1:0++ (next nads is code operand) 1: begin c[1,0] = 2 end ;c1:0++ (next nads is data) 2: begin c[1,0] = 3 end ;c1:0++ (next nads is data) 3: begin c[1,0] = 3 end ;reload (ditto) 4..7: begin c[1,0] = 0 end ;clr on an iFlag end ;NB: c1:0 will CLR on rst+ocf, ++c1:0 on nads, (interrupt ???) ;=================================================================== a[15..12].TRST = VCC ;-------------------------------------------------------------------- MINIMIZE_OFF ;do NOT minimize (leave as 3 Product Terms each) a[15..12]= /nads*d[3..0] +nads*a[15..12] +d[3..0]*a[15..12] ocf = /nads* d[5] +nads*ocf +d[5]*ocf ;similar to 6502:sync ? MINIMIZE_ON ;minimization will degenerate and make it will fail ! ;==================================================================== hex.TRST= VCC ;-------------------------------------------------------------------- hex = devs* a[4]*RW ;data0010:001Frw ;==================================================================== quad.TRST= VCC ;-------------------------------------------------------------------- quad = devs*/a[4]* a[3]*RW ;data0008:000Frw ;==================================================================== long.TRST= VCC ;-------------------------------------------------------------------- long = devs*/a[4]* a[3]* a[2]*RW ;data0004:0007rw ;==================================================================== word.TRST= VCC ;-------------------------------------------------------------------- word = devs*/a[4]* a[3]*/a[2]* a[1]*RW ;data0002,0003rw ;==================================================================== rUSB.TRST= VCC ;-------------------------------------------------------------------- rUSB = devs*/a[4]* a[3]*/a[2]*/a[1]* a[0]*RD ;data0001rd ;==================================================================== wUSB.TRST = VCC ;-------------------------------------------------------------------- wUSB = devs*/a[4]* a[3]*/a[2]*/a[1]* a[0]*WR ;data0001wr ;==================================================================== byte.TRST = VCC ;-------------------------------------------------------------------- byte = devs*/a[4]* a[3]*/a[2]*/a[1]*/a[0]*RW ;data0000 ;==================================================================== ram.TRST=VCC ;-------------------------------------------------------------------- ram = /devs*c[1]*RW ;data0020:FFFFrw ;==================================================================== rom.TRST=VCC ;-------------------------------------------------------------------- rom = /c[1]*RD ;code0000:FFFFrd ;******************************************************************** ; On rst, SCMP lowest 4kB of 29f020 is bootRom, 16B 'IO available, rest RAM ; On data000Frd, toggles monitor EXECUTES from Flash/codeRam ; On data0000wr, updates m23:12 (2x6b writes to update 12b) ; dataFxxx is a window into 4kB of 256kB Flash and 64kB codeRam ; codeFxxx is only affected by m23:22=F2C and m21:18=F ;-------------------------------------------------------------------- ; m17:12 selects 4kB Rom function as specified by m23:22 ; m21:18 selects 4kB Ram function as specified by m23:22 ; m23:22=NUL,C2F,F2C,F2D function control how dataFxxx operates on RW ;-------------------------------------------------------------------- ; NUL dataFxxx RW's does NO translation...dataRam ; C2F dataFxxx RD's codeRam m21:18 & WR's Flash at m17:12 ; F2C dataFxxx WR's codeRam m21:18 & RD's Flash at m17:12 ; F2D dataFxxx WR's dataRam m21:18 & RD's Flash at m17:12 ; NB:D2F use C2F, WR's same, but RW's from any 4kB of dataRam ;-------------------------------------------------------------------- ; This gives user ability to RW the entire 384kB of memory ; Take care when erasing any part of Flash, especially boot. ;******************************************************************** ; NB:Leave pin locs as '?' use header pins to route FUTURE loc changes. ; Still thinking xppc 3 in interrupts affect c1:0 (none ?) ;********************************************************************